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

[KO-293] - Adding support for dynamic config change. #262

Merged
merged 27 commits into from
Apr 10, 2024
Merged

Conversation

tanmayja
Copy link
Contributor

This PR is to handle aerospike config fields which can be changed dynamically without any rolling restart.
whenever user will change any config in CR, operator will do certain operations:

Compare the spec and status config from CR and fetch different config in a specific format.
Check whether that field is static or dynamic.
If dynamic, construct the set-config command based on the context and sub-context.
Execute the command in all the hosts via asinfo.
If command fails for any reason, fall back to rolling restart.

@tanmayja tanmayja marked this pull request as ready for review February 5, 2024 05:49
config/crd/bases/asdb.aerospike.com_aerospikeclusters.yaml Outdated Show resolved Hide resolved
pkg/utils/utils.go Outdated Show resolved Hide resolved
api/v1/aerospikecluster_mutating_webhook.go Outdated Show resolved Hide resolved
api/v1/aerospikecluster_types.go Show resolved Hide resolved
controllers/statefulset.go Outdated Show resolved Hide resolved
controllers/pod.go Outdated Show resolved Hide resolved
controllers/rack.go Outdated Show resolved Hide resolved
controllers/rack.go Outdated Show resolved Hide resolved
test/dynamic_config_test.go Outdated Show resolved Hide resolved
test/dynamic_config_test.go Outdated Show resolved Hide resolved
test/utils.go Outdated Show resolved Hide resolved
test/dynamic_config_test.go Show resolved Hide resolved
test/dynamic_config_test.go Show resolved Hide resolved
api/v1/aerospikecluster_mutating_webhook.go Outdated Show resolved Hide resolved
api/v1/aerospikecluster_validating_webhook.go Show resolved Hide resolved
controllers/reconciler.go Outdated Show resolved Hide resolved
controllers/rack.go Outdated Show resolved Hide resolved
controllers/rack.go Outdated Show resolved Hide resolved
controllers/rack.go Show resolved Hide resolved
controllers/aero_info_calls.go Outdated Show resolved Hide resolved
controllers/aero_info_calls.go Outdated Show resolved Hide resolved
controllers/pod.go Outdated Show resolved Hide resolved
controllers/pod.go Outdated Show resolved Hide resolved
namespaceConfig["replication-factor"] = 3
aeroCluster.Spec.AerospikeConfig.Value["namespaces"].([]interface{})[len(nsList)-1] = namespaceConfig

err = k8sClient.Update(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use update with wait. The current call will only check for validation and not actual dynamic setting of rf

api/v1/utils.go Outdated
@@ -63,7 +63,7 @@ const (
AerospikeInitContainerRegistryEnvVar = "AEROSPIKE_KUBERNETES_INIT_REGISTRY"
AerospikeInitContainerDefaultRegistry = "docker.io"
AerospikeInitContainerDefaultRegistryNamespace = "tanmayj10"
AerospikeInitContainerDefaultRepoAndTag = "aerospike-kubernetes-init:2.1.0-dev1"
AerospikeInitContainerDefaultRepoAndTag = "aerospike-kubernetes-init:2.1.0-dev3"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a new init tag and use that. Init changes are merged.

@sud82 sud82 merged commit 27f19b6 into master Apr 10, 2024
8 of 9 checks passed
@tanmayja tanmayja changed the title Adding support for dynamic config change. [ko-293] - Adding support for dynamic config change. May 20, 2024
@tanmayja tanmayja changed the title [ko-293] - Adding support for dynamic config change. [KO-293] - Adding support for dynamic config change. May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants