Skip to content

Commit f085f8f

Browse files
author
lijianguo
committed
chore(helmbroker): modify charts
1 parent ff6606a commit f085f8f

8 files changed

Lines changed: 28 additions & 18 deletions

File tree

charts/helmbroker/templates/_helpers.tpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{{/* Generate helmbroker deployment envs */}}
2-
{{- define "helmbroker.envs" -}}
2+
{{- define "helmbroker.envs" }}
33
env:
4+
- name: "TZ"
5+
value: {{ .Values.time_zone | default "UTC" | quote }}
46
{{- range $key, $value := .Values.environment }}
57
- name: {{ $key }}
68
value: {{ $value | quote }}
@@ -44,7 +46,7 @@ volumes:
4446
- name: helmbroker-data
4547
persistentVolumeClaim:
4648
claimName: drycc-helmbroker
47-
{{- else}}
49+
{{- else }}
4850
- name: helmbroker-data
4951
emptyDir: {}
5052
{{- end }}

charts/helmbroker/templates/helmbroker-cm.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
annotations:
99
component.drycc.cc/version: {{ .Values.image_tag }}
1010
data:
11-
repositories:
11+
repositories: |
1212
{{- range .Values.repositories }}
1313
- name: {{ .name }}
1414
url: {{ .url }}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ spec:
2121
- image: {{.Values.image_registry}}/{{.Values.image_org}}/helmbroker:{{.Values.image_tag}}
2222
imagePullPolicy: {{.Values.image_pull_policy}}
2323
name: drycc-helmbroker-cleaner
24-
command: ['python', '-m', 'helmbroker.cleaner']
24+
command:
25+
- /bin/bash
26+
- -c
27+
args:
28+
- python -m helmbroker.cleaner
2529
{{- include "helmbroker.envs" . | indent 12 }}
2630
{{- include "helmbroker.volumeMounts" . | indent 12 }}
2731
{{- include "helmbroker.volumes" . | indent 10 }}

charts/helmbroker/templates/helmbroker-deployment.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: drycc-helmbroker-cm
4+
name: drycc-helmbroker
55
labels:
66
heritage: drycc
77
annotations:
@@ -23,10 +23,14 @@ spec:
2323
spec:
2424
serviceAccount: drycc-helmbroker
2525
initContainers:
26-
- name: loader
27-
image: {{.Values.image_registry}}/{{.Values.image_org}}/helmbroker:{{.Values.image_tag}}
28-
imagePullPolicy: {{.Values.image_pull_policy}}
29-
command: ['python', '-m', 'helmbroker.loader']
26+
- name: loader
27+
image: {{.Values.image_registry}}/{{.Values.image_org}}/helmbroker:{{.Values.image_tag}}
28+
imagePullPolicy: {{.Values.image_pull_policy}}
29+
command:
30+
- /bin/bash
31+
- -c
32+
args:
33+
- python -m helmbroker.loader
3034
{{- include "helmbroker.envs" . | indent 10 }}
3135
{{- include "helmbroker.volumeMounts" . | indent 10 }}
3236
containers:
@@ -36,18 +40,18 @@ spec:
3640
livenessProbe:
3741
httpGet:
3842
path: /healthz
39-
port: 5000
43+
port: 8000
4044
initialDelaySeconds: 30
4145
timeoutSeconds: 10
4246
readinessProbe:
4347
httpGet:
4448
path: /readiness
45-
port: 5000
49+
port: 8000
4650
initialDelaySeconds: 30
4751
timeoutSeconds: 10
4852
periodSeconds: 5
4953
ports:
50-
- containerPort: 5000
54+
- containerPort: 8000
5155
name: http
5256
{{- include "helmbroker.limits" . | indent 10 }}
5357
{{- include "helmbroker.envs" . | indent 10 }}

charts/helmbroker/templates/helmbroker-service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ spec:
88
ports:
99
- name: http
1010
port: 80
11-
targetPort: 5000
11+
targetPort: 8000
1212
selector:
1313
app: drycc-helmbroker

rootfs/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ RUN apk add --update --virtual .build-deps \
3131
&& /app/bin/install
3232

3333
CMD ["/app/bin/boot"]
34-
EXPOSE 5000
34+
EXPOSE 8000

rootfs/Dockerfile.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ RUN apk add --update --virtual .build-deps \
3434
COPY . /app
3535

3636
CMD ["/app/bin/boot"]
37-
EXPOSE 5000
37+
EXPOSE 8000

rootfs/helmbroker/loader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,6 @@ def load_addons(repository):
109109

110110

111111
if __name__ == '__main__':
112-
with open(CONFIG_PATH, 'r') as f:
113-
repository = yaml.load(f.read(), Loader=yaml.Loader)
114-
load_addons(repository['repositories'][0])
112+
with open(f'{CONFIG_PATH}/repositories', 'r') as f:
113+
repositories = yaml.load(f.read(), Loader=yaml.Loader)
114+
load_addons(repositories[0])

0 commit comments

Comments
 (0)