RabbitMQ: permit multiple deployments within a single namespace

This PS updates the RabbitMQ chart to permit multiple deployments
within a single namespace.

Change-Id: Idd3f13448b25a88d2b42db565ddb7b6af0a9f3cd
This commit is contained in:
portdirect 2018-01-17 12:31:42 -05:00 committed by Pete Birley
parent 5f26fcd91e
commit d37ed6ffec
3 changed files with 12 additions and 12 deletions

View File

@ -20,7 +20,7 @@ limitations under the License.
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: rabbitmq-bin name: {{ printf "%s-%s" $envAll.Release.Name "rabbitmq-bin" | quote }}
data: data:
rabbitmq-liveness.sh: | rabbitmq-liveness.sh: |
{{ tuple "bin/_rabbitmq-liveness.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{ tuple "bin/_rabbitmq-liveness.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}

View File

@ -37,7 +37,7 @@ limitations under the License.
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: rabbitmq-etc name: {{ printf "%s-%s" $envAll.Release.Name "rabbitmq-etc" | quote }}
data: data:
enabled_plugins: | enabled_plugins: |
{{ tuple "etc/_enabled_plugins.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{ tuple "etc/_enabled_plugins.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}

View File

@ -18,27 +18,27 @@ limitations under the License.
{{- $envAll := . }} {{- $envAll := . }}
{{- $dependencies := .Values.dependencies.rabbitmq }} {{- $dependencies := .Values.dependencies.rabbitmq }}
{{- $serviceAccountName := "rabbitmq" }} {{- $rcControllerName := printf "%s-%s" $envAll.Release.Name "rabbitmq" }}
{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} {{ tuple $envAll $dependencies $rcControllerName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
--- ---
apiVersion: rbac.authorization.k8s.io/v1beta1 apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding kind: RoleBinding
metadata: metadata:
name: {{ $serviceAccountName }} name: {{ $rcControllerName | quote }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: Role kind: Role
name: {{ $serviceAccountName }} name: {{ $rcControllerName | quote }}
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: {{ $serviceAccountName }} name: {{ $rcControllerName | quote }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
--- ---
apiVersion: rbac.authorization.k8s.io/v1beta1 apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role kind: Role
metadata: metadata:
name: {{ $serviceAccountName }} name: {{ $rcControllerName | quote }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
rules: rules:
- apiGroups: - apiGroups:
@ -56,7 +56,7 @@ rules:
apiVersion: apps/v1beta1 apiVersion: apps/v1beta1
kind: StatefulSet kind: StatefulSet
metadata: metadata:
name: rabbitmq name: {{ $rcControllerName | quote }}
spec: spec:
serviceName: {{ tuple "oslo_messaging" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }} serviceName: {{ tuple "oslo_messaging" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
replicas: {{ .Values.pod.replicas.server }} replicas: {{ .Values.pod.replicas.server }}
@ -68,7 +68,7 @@ spec:
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
spec: spec:
serviceAccountName: {{ $serviceAccountName }} serviceAccountName: {{ $rcControllerName | quote }}
affinity: affinity:
{{ tuple $envAll "rabbitmq" "server" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} {{ tuple $envAll "rabbitmq" "server" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
nodeSelector: nodeSelector:
@ -131,10 +131,10 @@ spec:
emptyDir: {} emptyDir: {}
- name: rabbitmq-bin - name: rabbitmq-bin
configMap: configMap:
name: rabbitmq-bin name: {{ printf "%s-%s" $envAll.Release.Name "rabbitmq-bin" | quote }}
defaultMode: 0555 defaultMode: 0555
- name: rabbitmq-etc - name: rabbitmq-etc
configMap: configMap:
name: rabbitmq-etc name: {{ printf "%s-%s" $envAll.Release.Name "rabbitmq-etc" | quote }}
defaultMode: 0444 defaultMode: 0444
{{ end }} {{ end }}