Skip to content

Commit

Permalink
[bitnami/rabbitmq-cluster-operator] Add PodDistruptionBidget (PBDs)
Browse files Browse the repository at this point in the history
Allow running the Operator, and especially the validating webhook, in HA
mode.

Signed-off-by: Jiří Pinkava <j-pi@seznam.cz>
  • Loading branch information
pinkavaj committed Sep 23, 2024
1 parent ad8f8ea commit 75cc35b
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bitnami/rabbitmq-cluster-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ maintainers:
name: rabbitmq-cluster-operator
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/rabbitmq-cluster-operator
version: 4.3.22
version: 4.3.23
8 changes: 7 additions & 1 deletion bitnami/rabbitmq-cluster-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ extraDeploy:
| `clusterOperator.customStartupProbe` | Custom startupProbe that overrides the default one | `{}` |
| `clusterOperator.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if clusterOperator.resources is set (clusterOperator.resources is recommended for production). | `nano` |
| `clusterOperator.resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` |
| `clusterOperator.pdb.create` | Enable a Pod Disruption Budget creation | `true` |
| `clusterOperator.pdb.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `""` |
| `clusterOperator.pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable | `""` |
| `clusterOperator.podSecurityContext.enabled` | Enabled RabbitMQ Cluster Operator pods' Security Context | `true` |
| `clusterOperator.podSecurityContext.fsGroupChangePolicy` | Set filesystem group change policy | `Always` |
| `clusterOperator.podSecurityContext.sysctls` | Set kernel settings using the sysctl interface | `[]` |
Expand Down Expand Up @@ -428,6 +431,9 @@ extraDeploy:
| `msgTopologyOperator.existingWebhookCertCABundle` | PEM-encoded CA Bundle of the existing secret provided in existingWebhookCertSecret (only if useCertManager=false) | `""` |
| `msgTopologyOperator.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if msgTopologyOperator.resources is set (msgTopologyOperator.resources is recommended for production). | `nano` |
| `msgTopologyOperator.resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` |
| `msgTopologyOperator.pdb.create` | Enable a Pod Disruption Budget creation | `true` |
| `msgTopologyOperator.pdb.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `""` |
| `msgTopologyOperator.pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable | `""` |
| `msgTopologyOperator.podSecurityContext.enabled` | Enabled RabbitMQ Messaging Topology Operator pods' Security Context | `true` |
| `msgTopologyOperator.podSecurityContext.fsGroupChangePolicy` | Set filesystem group change policy | `Always` |
| `msgTopologyOperator.podSecurityContext.sysctls` | Set kernel settings using the sysctl interface | `[]` |
Expand Down Expand Up @@ -632,4 +638,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}

{{- if .Values.clusterOperator.pdb.create }}
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "rmqco.clusterOperator.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: rabbitmq-operator
app.kubernetes.io/part-of: rabbitmq
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.clusterOperator.pdb.minAvailable }}
minAvailable: {{ .Values.clusterOperator.pdb.minAvailable }}
{{- end }}
{{- if or .Values.clusterOperator.pdb.maxUnavailable (not .Values.clusterOperator.pdb.minAvailable) }}
maxUnavailable: {{ .Values.clusterOperator.pdb.maxUnavailable | default 1 }}
{{- end }}
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.clusterOperator.podLabels .Values.commonLabels ) "context" . ) }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: rabbitmq-operator
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}

{{- if .Values.msgTopologyOperator.pdb.create }}
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "rmqco.msgTopologyOperator.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: messaging-topology-operator
app.kubernetes.io/part-of: rabbitmq
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.msgTopologyOperator.pdb.minAvailable }}
minAvailable: {{ .Values.msgTopologyOperator.pdb.minAvailable }}
{{- end }}
{{- if or .Values.msgTopologyOperator.pdb.maxUnavailable (not .Values.msgTopologyOperator.pdb.minAvailable) }}
maxUnavailable: {{ .Values.msgTopologyOperator.pdb.maxUnavailable | default 1 }}
{{- end }}
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.msgTopologyOperator.podLabels .Values.commonLabels ) "context" . ) }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: messaging-topology-operator
{{- end }}
20 changes: 20 additions & 0 deletions bitnami/rabbitmq-cluster-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,16 @@ clusterOperator:
## memory: 1024Mi
##
resources: {}
## Pod Disruption Budget configuration
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
## @param clusterOperator.pdb.create Enable a Pod Disruption Budget creation
## @param clusterOperator.pdb.minAvailable Minimum number/percentage of pods that should remain scheduled
## @param clusterOperator.pdb.maxUnavailable Maximum number/percentage of pods that may be made unavailable
##
pdb:
create: true
minAvailable: ""
maxUnavailable: ""
## Configure Pods Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
## @param clusterOperator.podSecurityContext.enabled Enabled RabbitMQ Cluster Operator pods' Security Context
Expand Down Expand Up @@ -775,6 +785,16 @@ msgTopologyOperator:
## memory: 1024Mi
##
resources: {}
## Pod Disruption Budget configuration
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
## @param msgTopologyOperator.pdb.create Enable a Pod Disruption Budget creation
## @param msgTopologyOperator.pdb.minAvailable Minimum number/percentage of pods that should remain scheduled
## @param msgTopologyOperator.pdb.maxUnavailable Maximum number/percentage of pods that may be made unavailable
##
pdb:
create: true
minAvailable: ""
maxUnavailable: ""
## Configure Pods Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
## @param msgTopologyOperator.podSecurityContext.enabled Enabled RabbitMQ Messaging Topology Operator pods' Security Context
Expand Down

0 comments on commit 75cc35b

Please sign in to comment.