diff --git a/stable/rocketchat/Chart.yaml b/stable/rocketchat/Chart.yaml index ed5bb26601..3c103efb89 100644 --- a/stable/rocketchat/Chart.yaml +++ b/stable/rocketchat/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: rocketchat -version: 1.1.2 +version: 1.1.3 appVersion: 1.0.3 description: Prepare to take off with the ultimate chat platform, experience the next level of team communications keywords: diff --git a/stable/rocketchat/README.md b/stable/rocketchat/README.md index 04915e8678..bcdf08174b 100644 --- a/stable/rocketchat/README.md +++ b/stable/rocketchat/README.md @@ -53,6 +53,10 @@ Parameter | Description | Default `smtp.host` | Hostname of the SMTP server | `""` `smtp.port` | Port of the SMTP server | `587` `extraEnv` | Extra environment variables for Rocket.Chat. Used with `tpl` function, so this needs to be a string | `""` +`podAntiAffinity` | Pod anti-affinity can prevent the scheduler from placing RocketChat replicas on the same node. The default value "soft" means that the scheduler should *prefer* to not schedule two replica pods onto the same node but no guarantee is provided. The value "hard" means that the scheduler is *required* to not schedule two replica pods onto the same node. The value "" will disable pod anti-affinity so that no anti-affinity rules will be configured. | `""` | +`podAntiAffinityTopologyKey` | If anti-affinity is enabled sets the topologyKey to use for anti-affinity. This can be changed to, for example `failure-domain.beta.kubernetes.io/zone`| `kubernetes.io/hostname` | +| `affinity` | Assign custom affinity rules to the RocketChat instance https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ | `{}` | +`minAvailable` | Minimum number / percentage of pods that should remain scheduled | `1` | `externalMongodbUrl` | MongoDB URL if using an externally provisioned MongoDB | `""` `externalMongodbOplogUrl` | MongoDB OpLog URL if using an externally provisioned MongoDB. Required if `externalMongodbUrl` is set | `""` `mongodb.enabled` | Enable or disable MongoDB dependency. Refer to the [stable/mongodb docs](https://github.com/helm/charts/tree/master/stable/mongodb#configuration) for more information | `true` diff --git a/stable/rocketchat/templates/deployment.yaml b/stable/rocketchat/templates/deployment.yaml index 87f40b9019..794546d721 100644 --- a/stable/rocketchat/templates/deployment.yaml +++ b/stable/rocketchat/templates/deployment.yaml @@ -89,3 +89,27 @@ spec: {{- else }} emptyDir: {} {{- end }} +{{- if or .Values.podAntiAffinity .Values.affinity }} + affinity: +{{- if .Values.affinity }} +{{ toYaml .Values.affinity | indent 4 }} +{{- end }} +{{- if eq .Values.podAntiAffinity "hard" }} + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - topologyKey: {{ .Values.podAntiAffinityTopologyKey }} + labelSelector: + matchLabels: + app.kubernetes.io/name: {{ include "rocketchat.name" . }} +{{- else if eq .Values.podAntiAffinity "soft" }} + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + topologyKey: {{ .Values.podAntiAffinityTopologyKey }} + labelSelector: + matchLabels: + app.kubernetes.io/name: {{ include "rocketchat.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} +{{- end }} diff --git a/stable/rocketchat/templates/poddisruptionbudget.yaml b/stable/rocketchat/templates/poddisruptionbudget.yaml new file mode 100644 index 0000000000..0f1a639d5c --- /dev/null +++ b/stable/rocketchat/templates/poddisruptionbudget.yaml @@ -0,0 +1,17 @@ +{{- if gt .Values.replicaCount 1.0 }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + labels: + app.kubernetes.io/name: {{ include "rocketchat.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + name: {{ template "rocketchat.fullname" . }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: {{ include "rocketchat.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + minAvailable: {{ .Values.minAvailable }} +{{- end }} diff --git a/stable/rocketchat/values.yaml b/stable/rocketchat/values.yaml index 43687c8fb1..2667e5b17f 100644 --- a/stable/rocketchat/values.yaml +++ b/stable/rocketchat/values.yaml @@ -11,6 +11,7 @@ image: # host: replicaCount: 1 +minAvailable: 1 smtp: enabled: false @@ -26,6 +27,32 @@ extraEnv: # | # - name: MONGO_OPLOG_URL # value: mongodb://oploguser:password@rocket-1:27017/local&replicaSet=rs0 +## Pod anti-affinity can prevent the scheduler from placing RocketChat replicas on the same node. +## The default value "soft" means that the scheduler should *prefer* to not schedule two replica pods onto the same node but no guarantee is provided. +## The value "hard" means that the scheduler is *required* to not schedule two replica pods onto the same node. +## The value "" will disable pod anti-affinity so that no anti-affinity rules will be configured. +## +podAntiAffinity: "" + +## If anti-affinity is enabled sets the topologyKey to use for anti-affinity. +## This can be changed to, for example, failure-domain.beta.kubernetes.io/zone +## +podAntiAffinityTopologyKey: kubernetes.io/hostname + +## Assign custom affinity rules to the RocketChat instance +## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ +## +affinity: {} +# nodeAffinity: +# requiredDuringSchedulingIgnoredDuringExecution: +# nodeSelectorTerms: +# - matchExpressions: +# - key: kubernetes.io/e2e-az-name +# operator: In +# values: +# - e2e-az1 +# - e2e-az2 + ## MongoDB URL if using an externally provisioned MongoDB externalMongodbUrl: # mongodb://user:password@localhost:27017/rocketchat externalMongodbOplogUrl: # mongodb://user:password@localhost:27017/local?replicaSet=rs0&authSource=admin