Skip to content

Commit 902905f

Browse files
authored
Merge pull request teamhephy#35 from jianxiaoguo/dev
chore(chart): pretty chart format
2 parents 8684665 + f7da231 commit 902905f

File tree

6 files changed

+21
-40
lines changed

6 files changed

+21
-40
lines changed

charts/controller/templates/_helpers.tpl

+8-8
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ env:
7171
secretKeyRef:
7272
name: database-creds
7373
key: url
74-
{{- else if .Values.global.database_location "on-cluster" }}
74+
{{- else if eq .Values.global.database_location "on-cluster" }}
7575
- name: DRYCC_DATABASE_USER
7676
valueFrom:
7777
secretKeyRef:
@@ -83,13 +83,13 @@ env:
8383
name: database-creds
8484
key: password
8585
- name: DRYCC_DATABASE_URL
86-
value: "postgres://$DRYCC_DATABASE_USER:$DRYCC_DATABASE_PASSPORT@$DRYCC_DATABASE_SERVICE_HOST:$DRYCC_DATABASE_SERVICE_PORT/$DRYCC_DATABASE_USER"
87-
{{ end }}
86+
value: "postgres://$(DRYCC_DATABASE_USER):$(DRYCC_DATABASE_PASSPORT)@$(DRYCC_DATABASE_SERVICE_HOST):$(DRYCC_DATABASE_SERVICE_PORT)/$(DRYCC_DATABASE_USER)"
87+
{{- end }}
8888
- name: WORKFLOW_NAMESPACE
8989
valueFrom:
9090
fieldRef:
9191
fieldPath: metadata.namespace
92-
{{ if eq .Values.global.redis_location "on-cluster"}}
92+
{{- if eq .Values.global.redis_location "on-cluster"}}
9393
- name: DRYCC_REDIS_ADDRS
9494
value: "{{range $i := until $redisNodeCount}}drycc-redis-{{$i}}.drycc-redis.{{$.Release.Namespace}}.svc.{{$.Values.global.cluster_domain}}:6379{{if lt (add 1 $i) $redisNodeCount}},{{end}}{{end}}"
9595
{{- else if eq .Values.global.redis_location "off-cluster" }}
@@ -129,7 +129,7 @@ env:
129129
secretKeyRef:
130130
name: influxdb-creds
131131
key: token
132-
{{ if eq .Values.global.rabbitmq_location "off-cluster"}}
132+
{{- if eq .Values.global.rabbitmq_location "off-cluster"}}
133133
- name: "DRYCC_RABBITMQ_URL"
134134
valueFrom:
135135
secretKeyRef:
@@ -147,7 +147,7 @@ env:
147147
name: rabbitmq-creds
148148
key: password
149149
- name: "DRYCC_RABBITMQ_URL"
150-
value: "amqp://$DRYCC_RABBITMQ_USERNAME:$[email protected].{{$.Release.Namespace}}.svc.{{$.Values.global.cluster_domain}}:5672/drycc"
150+
value: "amqp://$(DRYCC_RABBITMQ_USERNAME):$(DRYCC_RABBITMQ_PASSWORD)@drycc-rabbitmq-0.drycc-rabbitmq.{{$.Release.Namespace}}.svc.{{$.Values.global.cluster_domain}}:5672/drycc"
151151
{{- end }}
152152
{{- range $key, $value := .Values.environment }}
153153
- name: {{ $key }}
@@ -172,7 +172,7 @@ resources:
172172

173173

174174
{{/* Generate controller deployment volumeMounts */}}
175-
{{- define "controller.volumeMounts" -}}
175+
{{- define "controller.volumeMounts" }}
176176
volumeMounts:
177177
- mountPath: /etc/slugrunner
178178
name: slugrunner-config
@@ -181,7 +181,7 @@ volumeMounts:
181181

182182

183183
{{/* Generate controller deployment volumes */}}
184-
{{- define "controller.volumes" -}}
184+
{{- define "controller.volumes" }}
185185
volumes:
186186
- name: rabbitmq-creds
187187
secret:

charts/controller/templates/controller-celery.yaml

+6-12
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,29 @@ spec:
2525
containers:
2626
- name: drycc-controller-celery-high
2727
image: {{.Values.image_registry}}/{{.Values.org}}/controller:{{.Values.image_tag}}
28+
imagePullPolicy: {{.Values.image_pull_policy}}
2829
command:
2930
- /bin/bash
3031
- -c
3132
args:
3233
- celery -A api worker -Q priority.high --autoscale=32,1 --loglevel=WARNING
33-
imagePullPolicy: {{.Values.image_pull_policy}}
3434
{{- include "controller.limits" . | indent 10 }}
3535
{{- include "controller.envs" . | indent 10 }}
36-
volumeMounts:
37-
- mountPath: /etc/slugrunner
38-
name: slugrunner-config
39-
readOnly: true
36+
{{- include "controller.volumeMounts" . | indent 10 }}
4037
- name: drycc-controller-celery-middle
4138
image: {{.Values.image_registry}}/{{.Values.org}}/controller:{{.Values.image_tag}}
39+
imagePullPolicy: {{.Values.image_pull_policy}}
4240
command:
4341
- /bin/bash
4442
- -c
4543
args:
46-
- celery -A api worker -Q priority.middle --autoscale=16,1 --loglevel=WARNING
44+
- celery -A api worker -Q priority.middle --autoscale=16,1 --loglevel=WARNING
4745
{{- include "controller.limits" . | indent 10 }}
4846
{{- include "controller.envs" . | indent 10 }}
49-
volumeMounts:
50-
- mountPath: /etc/slugrunner
51-
name: slugrunner-config
52-
readOnly: true
53-
imagePullPolicy: {{.Values.image_pull_policy}}
47+
{{- include "controller.volumeMounts" . | indent 10 }}
5448
- name: drycc-controller-celery-low
5549
image: {{.Values.image_registry}}/{{.Values.org}}/controller:{{.Values.image_tag}}
50+
imagePullPolicy: {{.Values.image_pull_policy}}
5651
command:
5752
- /bin/bash
5853
- -c
@@ -61,5 +56,4 @@ spec:
6156
{{- include "controller.limits" . | indent 10 }}
6257
{{- include "controller.envs" . | indent 10 }}
6358
{{- include "controller.volumeMounts" . | indent 10 }}
64-
imagePullPolicy: {{.Values.image_pull_policy}}
6559
{{- include "controller.volumes" . | indent 6 }}

charts/controller/templates/controller-certificate.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if .Values.global.cert_manager_enabled }}
1+
{{- if .Values.global.cert_manager_enabled }}
22
apiVersion: cert-manager.io/v1alpha2
33
kind: Certificate
44
metadata:

charts/controller/templates/controller-cronjob-daily.yaml

+4-16
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ spec:
2626
args:
2727
- python /app/manage.py load_db_state_to_k8s
2828
{{- include "controller.envs" . | indent 12 }}
29-
volumeMounts:
30-
- mountPath: /etc/slugrunner
31-
name: slugrunner-config
32-
readOnly: true
29+
{{- include "controller.volumeMounts" . | indent 12 }}
3330
- image: {{.Values.image_registry}}/{{.Values.org}}/controller:{{.Values.image_tag}}
3431
imagePullPolicy: {{.Values.pull_policy}}
3532
name: drycc-controller-measure-app
@@ -39,10 +36,7 @@ spec:
3936
args:
4037
- python -u /app/manage.py measure_app
4138
{{- include "controller.envs" . | indent 12 }}
42-
volumeMounts:
43-
- mountPath: /etc/slugrunner
44-
name: slugrunner-config
45-
readOnly: true
39+
{{- include "controller.volumeMounts" . | indent 12 }}
4640
- image: {{.Values.image_registry}}/{{.Values.org}}/controller:{{.Values.image_tag}}
4741
imagePullPolicy: {{.Values.pull_policy}}
4842
name: drycc-controller-measure-config
@@ -52,10 +46,7 @@ spec:
5246
args:
5347
- python -u /app/manage.py measure_config
5448
{{- include "controller.envs" . | indent 12 }}
55-
volumeMounts:
56-
- mountPath: /etc/slugrunner
57-
name: slugrunner-config
58-
readOnly: true
49+
{{- include "controller.volumeMounts" . | indent 12 }}
5950
- image: {{.Values.image_registry}}/{{.Values.org}}/controller:{{.Values.image_tag}}
6051
imagePullPolicy: {{.Values.pull_policy}}
6152
name: drycc-controller-measure-resources
@@ -65,10 +56,7 @@ spec:
6556
args:
6657
- python -u /app/manage.py measure_resources
6758
{{- include "controller.envs" . | indent 12 }}
68-
volumeMounts:
69-
- mountPath: /etc/slugrunner
70-
name: slugrunner-config
71-
readOnly: true
59+
{{- include "controller.volumeMounts" . | indent 12 }}
7260
- image: {{.Values.image_registry}}/{{.Values.org}}/controller:{{.Values.image_tag}}
7361
imagePullPolicy: {{.Values.pull_policy}}
7462
name: drycc-controller-measure-volumes

charts/controller/templates/controller-ingress.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ metadata:
1111
kubernetes.io/tls-acme: "true"
1212
{{- if not (eq .Values.global.ingress_class "") }}
1313
kubernetes.io/ingress.class: "{{ .Values.global.ingress_class }}"
14-
{{ end }}
14+
{{- end }}
1515
spec:
1616
rules:
1717
- host: drycc.{{ .Values.global.platform_domain }}
@@ -25,7 +25,7 @@ spec:
2525
backend:
2626
serviceName: drycc-controller
2727
servicePort: 80
28-
{{ if .Values.global.cert_manager_enabled }}
28+
{{- if .Values.global.cert_manager_enabled }}
2929
tls:
3030
- secretName: drycc-controller-certificate-auto
3131
hosts:

rootfs/api/settings/celery.py

-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@
1111
)
1212
app.autodiscover_tasks()
1313
platforms.C_FORCE_ROOT = True
14-

0 commit comments

Comments
 (0)