Skip to content

Commit

Permalink
Adding missing fields in aerospike-cluster-cr.yaml (#306)
Browse files Browse the repository at this point in the history
* Adding missing fields in aerospike-cluster-cr.yaml

* Adding fields value reference in values.yaml
  • Loading branch information
tanmayja authored Aug 9, 2024
1 parent 13514b7 commit aeb0ec9
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ metadata:

spec:
# Aerospike cluster size
size: {{ .Values.replicas | default 3 }}
size: {{ .Values.replicas }}

# Aerospike server docker image
image: {{ .Values.image.repository | default "aerospike/aerospike-server-enterprise" }}:{{ .Values.image.tag | default "7.1.0.0" }}

## maxUnavailable defines percentage/number of pods that can be allowed to go down or unavailable
## before application disruption.
maxUnavailable: {{ .Values.maxUnavailable }}

## Disable the PodDisruptionBudget creation for the Aerospike cluster.
disablePDB: {{ .Values.disablePDB }}

# Aerospike access control configuration
{{- with .Values.aerospikeAccessControl }}
aerospikeAccessControl: {{- toYaml . | nindent 4 }}
Expand Down Expand Up @@ -50,6 +57,9 @@ spec:

{{- end }}

## enableDynamicConfigUpdate enables dynamic config update flow of the operator.
enableDynamicConfigUpdate: {{ .Values.enableDynamicConfigUpdate }}

# Aerospike network policy
{{- with .Values.aerospikeNetworkPolicy }}
aerospikeNetworkPolicy: {{- toYaml . | nindent 4 }}
Expand Down Expand Up @@ -106,3 +116,13 @@ spec:
{{- with .Values.seedsFinderServices }}
seedsFinderServices: {{- toYaml . | nindent 4 }}
{{- end }}

## rosterNodeBlockList is a list of blocked nodeIDs from roster in a strong-consistency setup
{{- with .Values.rosterNodeBlockList }}
rosterNodeBlockList: {{- toYaml . | nindent 4 }}
{{- end }}

## k8sNodeBlockList is a list of Kubernetes nodes which are not used for Aerospike pods.
{{- with .Values.k8sNodeBlockList }}
k8sNodeBlockList: {{- toYaml . | nindent 4 }}
{{- end }}
22 changes: 21 additions & 1 deletion helm-charts/aerospike-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ image:
tag: 7.1.0.0

## In case the above image is pulled from a registry that requires
## authentication, a secret containining credentials can be added
## authentication, a secret containing credentials can be added
## imagePullSecrets:
## - secret_with_credentials_to_custom_registry
imagePullSecrets: {}
Expand Down Expand Up @@ -113,3 +113,23 @@ operatorClientCert: {}

## Dev Mode
devMode: false

## maxUnavailable defines percentage/number of pods that can be allowed to go down or unavailable
## before application disruption.
maxUnavailable: 1

## Disable the PodDisruptionBudget creation for the Aerospike cluster.
disablePDB: false

## enableDynamicConfigUpdate enables dynamic config update flow of the operator.
enableDynamicConfigUpdate: false

## rosterNodeBlockList is a list of blocked nodeIDs from roster in a strong-consistency setup
## Replace the value with aerospike node id which needs to be blocked.
rosterNodeBlockList: []
# - <aerospike-node-id>

## k8sNodeBlockList is a list of Kubernetes nodes which are not used for Aerospike pods.
## Replace the value with kubernetes cluster node name which needs to be blocked.
k8sNodeBlockList: []
# - <node-name>
2 changes: 1 addition & 1 deletion helm-charts/aerospike-kubernetes-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ operatorImage:
pullPolicy: IfNotPresent

## In case the above image is pulled from a registry that requires
## authentication, a secret containining credentials can be added
## authentication, a secret containing credentials can be added
## imagePullSecrets:
## - secret_with_credentials_to_custom_registry
imagePullSecrets: {}
Expand Down
20 changes: 11 additions & 9 deletions test/on_demand_operations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package test
import (
goctx "context"
"fmt"
"time"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -80,7 +81,7 @@ var _ = Describe(
)

It(
"Should execute podRestart operations on all pods", func() {
"Should execute podRestart operation on all pods", func() {
aeroCluster, err := getCluster(
k8sClient, ctx, clusterNamespacedName,
)
Expand Down Expand Up @@ -138,16 +139,17 @@ var _ = Describe(
err = k8sClient.Update(ctx, aeroCluster)
Expect(err).ToNot(HaveOccurred())

aeroCluster, err = getCluster(
k8sClient, ctx, clusterNamespacedName,
)
Expect(err).ToNot(HaveOccurred())
Eventually(func() error {
aeroCluster, err = getCluster(
k8sClient, ctx, clusterNamespacedName,
)
Expect(err).ToNot(HaveOccurred())

aeroCluster.Spec.Operations[0].Kind = asdbv1.OperationPodRestart
aeroCluster.Spec.Operations[0].ID = "2"
aeroCluster.Spec.Operations[0].Kind = asdbv1.OperationPodRestart
aeroCluster.Spec.Operations[0].ID = "2"

err = updateCluster(k8sClient, ctx, aeroCluster)
Expect(err).ToNot(HaveOccurred())
return updateCluster(k8sClient, ctx, aeroCluster)
}, 1*time.Minute).ShouldNot(HaveOccurred())

operationTypeMap := map[string]asdbv1.OperationKind{
"operations-1-0": asdbv1.OperationPodRestart,
Expand Down

0 comments on commit aeb0ec9

Please sign in to comment.