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

Cannot disable PDB due to Operator setting maxUnavailable #325

Open
AustinConcepcion opened this issue Nov 25, 2024 · 2 comments
Open

Cannot disable PDB due to Operator setting maxUnavailable #325

AustinConcepcion opened this issue Nov 25, 2024 · 2 comments

Comments

@AustinConcepcion
Copy link

Context

The newer versions of the operator automatically deploy a PDB for any given Aerospike cluster and set the maxUnavailable to 1 by default. I would like to disable that PDB but have encountered an issue with the requirement to set maxUnavailable to nil.

If maxUnavailable is null in the Aerospike cluster manifest, the operator will automatically set the maxUnavailable to 1. To set disablePDB to true, maxUnavailable must be null. Because maxUnavailable cannot be set to null, disablePDB can never be set to true. Is there a workaround for this?

Example

Define an Aerospike cluster without setting maxUnavailable

apiVersion: asdb.aerospike.com/v1
kind: AerospikeCluster
metadata:
  name: aerospike
  namespace: aerospike
spec:
  size: 3
  rackConfig: ...

View the live manifest and check if the operator has added the maxUnavailable property

# kubectl get aerospikeclusters.asdb.aerospike.com -n aerospike aerospike -o yaml
apiVersion: asdb.aerospike.com/v1
kind: AerospikeCluster
metadata:
  name: aerospike
  namespace: aerospike
spec:
  size: 3
  rackConfig: ...
  maxUnavailable: 1 # the default value of 1 has been added

Attempting to add disablePDB: true at this point will fail with the error admission webhook "vaerospikecluster.kb.io" denied the request: maxUnavailable must be nil if PDB is disabled.
Attempting to remove the maxUnavailable field will have no effect; it will immediately reappear on the resource.

@sud82
Copy link
Collaborator

sud82 commented Nov 26, 2024

Hi @AustinConcepcion,
To disable the PDB, you must set disablePDB: true and maxUnavailable: null in the CR manifest.

@AustinConcepcion
Copy link
Author

This is a creating conflicts when implemented via GitOps.

When we set maxUnavailable: null without defining a value for disablePDB, the operator will set maxUnavailable: 1, which creates drift between the manifest definition and the live resource.

If we set maxUnavailable: null alongside disablePDB: true, the operator will remove the maxUnavailable attribute and again create drift between our manifests and the live resource.

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

No branches or pull requests

2 participants