Skip to content

Commit

Permalink
chore(controller): add rabbitmq env
Browse files Browse the repository at this point in the history
  • Loading branch information
段洪义 authored and 段洪义 committed Jan 15, 2021
1 parent 83a9bd7 commit 3859f16
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 24 deletions.
33 changes: 33 additions & 0 deletions charts/controller/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,26 @@ env:
secretKeyRef:
name: influxdb-creds
key: token
{{ if eq .Values.global.rabbitmq_location "off-cluster"}}
- name: "DRYCC_RABBITMQ_URL"
valueFrom:
secretKeyRef:
name: rabbitmq-creds
key: url
{{- else if eq .Values.global.rabbitmq_location "on-cluster" }}
- name: "DRYCC_RABBITMQ_USERNAME"
valueFrom:
secretKeyRef:
name: rabbitmq-creds
key: username
- name: "DRYCC_RABBITMQ_PASSWORD"
valueFrom:
secretKeyRef:
name: rabbitmq-creds
key: password
- name: "DRYCC_RABBITMQ_URL"
value: "amqp://$DRYCC_RABBITMQ_USERNAME:[email protected].{{$.Release.Namespace}}.svc.{{$.Values.global.cluster_domain}}:5672/drycc"
{{- end }}
{{- range $key, $value := .Values.environment }}
- name: {{ $key }}
value: {{ $value | quote }}
Expand All @@ -157,10 +177,23 @@ resources:
{{- end }}




{{/* Generate controller deployment volumeMounts */}}
{{- define "controller.volumeMounts" -}}
volumeMounts:
- mountPath: /etc/slugrunner
name: slugrunner-config
readOnly: true
{{- end }}

{{/* Generate controller deployment volumes */}}
{{- define "controller.volumes" -}}
volumes:
- name: rabbitmq-creds
secret:
secretName: rabbitmq-creds
- name: slugrunner-config
configMap:
name: slugrunner-config
{{- end }}
10 changes: 2 additions & 8 deletions charts/controller/templates/controller-celery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ spec:
- celery -A api worker -Q priority.low --autoscale=8,1 --loglevel=WARNING
{{- include "controller.limits" . | indent 10 }}
{{- include "controller.envs" . | indent 10 }}
volumeMounts:
- mountPath: /etc/slugrunner
name: slugrunner-config
readOnly: true
{{- include "controller.volumeMounts" . | indent 10 }}
imagePullPolicy: {{.Values.image_pull_policy}}
volumes:
- name: slugrunner-config
configMap:
name: slugrunner-config
{{- include "controller.volumes" . | indent 6 }}
10 changes: 2 additions & 8 deletions charts/controller/templates/controller-cronjob-daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ spec:
args:
- python -u /app/manage.py measure_volumes
{{- include "controller.envs" . | indent 12 }}
volumeMounts:
- mountPath: /etc/slugrunner
name: slugrunner-config
readOnly: true
volumes:
- name: slugrunner-config
configMap:
name: slugrunner-config
{{- include "controller.volumeMounts" . | indent 12 }}
{{- include "controller.volumes" . | indent 10 }}

10 changes: 2 additions & 8 deletions charts/controller/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,5 @@ spec:
name: http
{{- include "controller.limits" . | indent 10 }}
{{- include "controller.envs" . | indent 10 }}
volumeMounts:
- mountPath: /etc/slugrunner
name: slugrunner-config
readOnly: true
volumes:
- name: slugrunner-config
configMap:
name: slugrunner-config
{{- include "controller.volumeMounts" . | indent 10 }}
{{- include "controller.volumes" . | indent 6 }}

0 comments on commit 3859f16

Please sign in to comment.