Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a paused flag to pause the reconciliation of the AerospikeCluster #302

Merged
merged 7 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 24 additions & 18 deletions helm-charts/aerospike-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
{{- end }}

## Pause reconciliation of the cluster
sud82 marked this conversation as resolved.
Show resolved Hide resolved
paused: { { .Values.paused } }
127 changes: 58 additions & 69 deletions helm-charts/aerospike-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,99 +21,82 @@ 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: {}

## 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
Expand All @@ -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: []
# - <node-name>
# - <node-name>

## Pause reconciliation of the cluster
paused: false

## Dev Mode
devMode: false
4 changes: 2 additions & 2 deletions test/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -140,7 +141,6 @@ func PauseReconcileTest(ctx goctx.Context) {
}

return podUpgraded

}, 2*time.Minute, 1*time.Second,
).Should(BeTrue())

Expand Down
Loading