From 188b473e97935207f84d77cf2aeb9c1cbc65412e Mon Sep 17 00:00:00 2001 From: sud82 Date: Fri, 9 Aug 2024 15:16:53 +0530 Subject: [PATCH] Fix helm --- helm-charts/aerospike-cluster/README.md | 42 +++--- .../templates/aerospike-cluster-cr.yaml | 5 +- helm-charts/aerospike-cluster/values.yaml | 127 ++++++++---------- test/cluster_test.go | 4 +- 4 files changed, 88 insertions(+), 90 deletions(-) diff --git a/helm-charts/aerospike-cluster/README.md b/helm-charts/aerospike-cluster/README.md index 52d051aa7..7c640dd24 100644 --- a/helm-charts/aerospike-cluster/README.md +++ b/helm-charts/aerospike-cluster/README.md @@ -44,24 +44,30 @@ helm install aerospike ./aerospike-cluster/ \ ## Configurations -| Name | Description | Default | -| ---------- | ----------- | --------- | -| `replicas` | Aerospike cluster size | `3` | -| `image.repository` | Aerospike server container image repository | `aerospike/aerospike-server-enterprise` | -| `image.tag` | Aerospike server container image tag | `7.1.0.0` | -| `imagePullSecrets` | Secrets containing credentials to pull Aerospike container image from a private registry | `{}` (nil) | -| `customLabels` | Custom labels to add on the aerospikecluster resource | `{}` (nil) | -| `aerospikeAccessControl` | Aerospike access control configuration. Define users and roles to be created on the cluster. | `{}` (nil) | -| `aerospikeConfig` | Aerospike configuration | `{}` (nil) | -| `aerospikeNetworkPolicy` | Network policy (client access configuration) | `{}` (nil) | -| `commonName` | Base string for naming pods, services, stateful sets, etc. | Release name truncated to 63 characters (without hyphens) | -| `podSpec` | Aerospike pod spec configuration | `{}` (nil) | -| `rackConfig` | Aerospike rack configuration | `{}` (nil) | -| `storage` | Aerospike pod storage configuration | `{}` (nil) | -| `validationPolicy` | Validation policy | `{}` (nil) | -| `operatorClientCert` | Client certificates to connect to Aerospike | `{}` (nil) | -| `seedsFinderServices` | Service (e.g. loadbalancer) for Aerospike cluster discovery | `{}` (nil) | -| `devMode` | Deploy Aerospike cluster in dev mode | `false` | +| Name | Description | Default | +| ---------- |---------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------| +| `replicas` | Aerospike cluster size | `3` | +| `image.repository` | Aerospike server container image repository | `aerospike/aerospike-server-enterprise` | +| `image.tag` | Aerospike server container image tag | `7.1.0.0` | +| `imagePullSecrets` | Secrets containing credentials to pull Aerospike container image from a private registry | `{}` (nil) | +| `customLabels` | Custom labels to add on the aerospikecluster resource | `{}` (nil) | +| `aerospikeAccessControl` | Aerospike access control configuration. Define users and roles to be created on the cluster. | `{}` (nil) | +| `aerospikeConfig` | Aerospike configuration | `{}` (nil) | +| `aerospikeNetworkPolicy` | Network policy (client access configuration) | `{}` (nil) | +| `commonName` | Base string for naming pods, services, stateful sets, etc. | Release name truncated to 63 characters (without hyphens) | +| `podSpec` | Aerospike pod spec configuration | `{}` (nil) | +| `rackConfig` | Aerospike rack configuration | `{}` (nil) | +| `storage` | Aerospike pod storage configuration | `{}` (nil) | +| `validationPolicy` | Validation policy | `{}` (nil) | +| `operatorClientCert` | Client certificates to connect to Aerospike | `{}` (nil) | +| `seedsFinderServices` | Service (e.g. loadbalancer) for Aerospike cluster discovery | `{}` (nil) | +| `maxUnavailable` | maxUnavailable defines percentage/number of pods that can be allowed to go down or unavailable before application disruption | `1` | +| `disablePDB` | Disable the PodDisruptionBudget creation for the Aerospike cluster | `false` | +| `enableDynamicConfigUpdate` | enableDynamicConfigUpdate enables dynamic config update flow of the operator | `false` | +| `rosterNodeBlockList` | rosterNodeBlockList is a list of blocked nodeIDs from roster in a strong-consistency setup | `[]` | +| `k8sNodeBlockList` | k8sNodeBlockList is a list of Kubernetes nodes which are not used for Aerospike pods | `[]` | +| `paused` | Pause reconciliation of the cluster | `false` | +| `devMode` | Deploy Aerospike cluster in dev mode | `false` | ### Default values in "dev" mode (`devMode=true`): diff --git a/helm-charts/aerospike-cluster/templates/aerospike-cluster-cr.yaml b/helm-charts/aerospike-cluster/templates/aerospike-cluster-cr.yaml index 103e13f6e..ad6fd4ee0 100644 --- a/helm-charts/aerospike-cluster/templates/aerospike-cluster-cr.yaml +++ b/helm-charts/aerospike-cluster/templates/aerospike-cluster-cr.yaml @@ -125,4 +125,7 @@ spec: ## k8sNodeBlockList is a list of Kubernetes nodes which are not used for Aerospike pods. {{- with .Values.k8sNodeBlockList }} k8sNodeBlockList: {{- toYaml . | nindent 4 }} - {{- end }} \ No newline at end of file + {{- end }} + + ## Pause reconciliation of the cluster + paused: { { .Values.paused } } diff --git a/helm-charts/aerospike-cluster/values.yaml b/helm-charts/aerospike-cluster/values.yaml index 2b1ad06f1..e661a40d6 100644 --- a/helm-charts/aerospike-cluster/values.yaml +++ b/helm-charts/aerospike-cluster/values.yaml @@ -21,89 +21,75 @@ customLabels: {} ## Aerospike access control configuration aerospikeAccessControl: {} - # users: - # - name: admin - # secretName: auth-secret - # roles: - # - sys-admin - # - user-admin - # adminPolicy: - # # timeout in milliseconds - # timeout: 1000 - # roles: - # - name: - # privileges: [] - # whitelist: [] +# users: +# - name: admin +# secretName: auth-secret +# roles: +# - sys-admin +# - user-admin +# adminPolicy: +# # timeout in milliseconds +# timeout: 1000 +# roles: +# - name: +# privileges: [] +# whitelist: [] ## Aerospike Configuration aerospikeConfig: - # service: - # feature-key-file: /etc/aerospike/secrets/features.conf - - # security: - # enable-security: false - - # network: - # service: - # port: 3000 - # fabric: - # port: 3001 - # heartbeat: - # port: 3002 - - # namespaces: - # - name: test - # replication-factor: 2 - # storage-engine: - # type: memory - # data-size: 1073741824 # 1GiB - - -## Aerospike secrets -## To add feature key file, tls certificates etc. -## We may be able to add feature key file, certificates and other secrets dynamically during helm install -## when, -## 1. operator supports adding multiple secret sources, or -## 2. https://github.com/helm/helm/pull/8841 feature is added. - -# aerospikeSecretName: aerospike-secrets -# aerospikeSecretMountPath: /etc/aerospike/secrets/ +# service: +# feature-key-file: /etc/aerospike/secrets/features.conf +# +# network: +# service: +# port: 3000 +# fabric: +# port: 3001 +# heartbeat: +# port: 3002 +# +# namespaces: +# - name: test +# replication-factor: 2 +# storage-engine: +# type: memory +# data-size: 1073741824 # 1GiB ## Network policy aerospikeNetworkPolicy: {} - # access: pod - # alternateAccess: hostExternal - # tlsAccess: pod - # tlsAlternateAccess: hostExternal +# access: pod +# alternateAccess: hostExternal +# tlsAccess: pod +# tlsAlternateAccess: hostExternal ## Pod spec podSpec: {} - # Multi pod per host - # multiPodPerHost: true - # sidecars: - # - name: aerospike-prometheus-exporter - # image: "aerospike/aerospike-prometheus-exporter:1.1.6" - # ports: - # - containerPort: 9145 - # name: exporter +## Multi pod per host +# multiPodPerHost: true +# sidecars: +# - name: aerospike-prometheus-exporter +# image: aerospike/aerospike-prometheus-exporter:v1.18.0 +# ports: +# - containerPort: 9145 +# name: exporter ## Rack configuration rackConfig: {} ## Storage configuration storage: {} - # volumes: - # - name: aerospike-config-secret - # source: - # secret: - # secretName: aerospike-secret - # aerospike: - # path: /etc/aerospike/secrets +# volumes: +# - name: aerospike-config-secret +# source: +# secret: +# secretName: aerospike-secret +# aerospike: +# path: /etc/aerospike/secrets ## Validation policy validationPolicy: {} - # skipWorkDirValidate: true - # skipXdrDlogFileValidate: true +# skipWorkDirValidate: true +# skipXdrDlogFileValidate: true ## seedsFinderServices defines service (e.g. loadbalancer) to connect to Aerospike seedsFinderServices: {} @@ -111,9 +97,6 @@ seedsFinderServices: {} ## operatorClientCert defines certificates to connect to Aerospike 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 @@ -132,4 +115,10 @@ rosterNodeBlockList: [] ## 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: [] -# - \ No newline at end of file +# - + +## Pause reconciliation of the cluster +paused: false + +## Dev Mode +devMode: false diff --git a/test/cluster_test.go b/test/cluster_test.go index d27c51e92..fb88bd186 100644 --- a/test/cluster_test.go +++ b/test/cluster_test.go @@ -131,7 +131,8 @@ func PauseReconcileTest(ctx goctx.Context) { // Check if at least one pod is upgraded podUpgraded := false - for podName, podStatus := range aeroCluster.Status.Pods { + for podName := range aeroCluster.Status.Pods { + podStatus := aeroCluster.Status.Pods[podName] if podStatus.Image == nextImage { pkgLog.Info("One Pod upgraded", "pod", podName, "image", podStatus.Image) podUpgraded = true @@ -140,7 +141,6 @@ func PauseReconcileTest(ctx goctx.Context) { } return podUpgraded - }, 2*time.Minute, 1*time.Second, ).Should(BeTrue())