Skip to content

Commit

Permalink
feat(helm): 添加 helm hook
Browse files Browse the repository at this point in the history
  • Loading branch information
alvin5840 committed Apr 19, 2023
1 parent 424800c commit 4c900e0
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spec:
template:
spec:
restartPolicy: OnFailure
terminationGracePeriodSeconds: 60
terminationGracePeriodSeconds: 30
containers:
- name: flyway
image: "{{ .Values.global.imageRegistry }}/hummerrisk/hmr-flyway:{{ .Values.hummerrisk.image.tag }}"
Expand Down
2 changes: 2 additions & 0 deletions charts/hummerrisk/templates/mysql/configmap-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ kind: ConfigMap
metadata:
name: hummerrisk-mysql-init
namespace: {{ .Release.Namespace | quote }}
annotations:
"helm.sh/hook": pre-install
labels:
app.kubernetes.io/name: mysql
data:
Expand Down
2 changes: 2 additions & 0 deletions charts/hummerrisk/templates/mysql/configmap-mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ kind: ConfigMap
metadata:
name: hummerrisk-mysql-config
namespace: {{ .Release.Namespace | quote }}
annotations:
"helm.sh/hook": pre-install
labels:
app.kubernetes.io/name: mysql
data:
Expand Down
2 changes: 2 additions & 0 deletions charts/hummerrisk/templates/mysql/mysql-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ kind: Service
metadata:
name: {{ $fullName }}-mysql
namespace: {{ .Release.Namespace | quote }}
annotations:
"helm.sh/hook": pre-install
labels:
app.kubernetes.io/name: mysql
spec:
Expand Down
2 changes: 2 additions & 0 deletions charts/hummerrisk/templates/mysql/pvc-mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ apiVersion: v1
metadata:
name: {{ $pvcFullName }}-mysql
namespace: {{ .Release.Namespace | quote }}
annotations:
"helm.sh/hook": pre-install
annotations:
volume.beta.kubernetes.io/storage-class: {{ .Values.global.storageClass | quote }}
spec:
Expand Down
2 changes: 2 additions & 0 deletions charts/hummerrisk/templates/mysql/secret-mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ kind: Secret
metadata:
name: hummerrisk-mysql-password
namespace: {{ .Release.Namespace | quote }}
annotations:
"helm.sh/hook": pre-install
labels:
app.kubernetes.io/name: mysql
type: Opaque
Expand Down
2 changes: 2 additions & 0 deletions charts/hummerrisk/templates/redis/redis-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ kind: ConfigMap
metadata:
name: hummerrisk-redis-config
namespace: {{ .Release.Namespace | quote }}
annotations:
"helm.sh/hook": pre-install
labels:
app.kubernetes.io/name: mysql
data:
Expand Down
2 changes: 2 additions & 0 deletions charts/hummerrisk/templates/redis/redis-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ kind: Service
metadata:
name: {{ $fullName }}-redis
namespace: {{ .Release.Namespace | quote }}
annotations:
"helm.sh/hook": pre-install
labels:
app.kubernetes.io/name: redis
spec:
Expand Down
1 change: 1 addition & 0 deletions charts/hummerrisk/templates/redis/redis-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
namespace: {{ .Release.Namespace | quote }}
annotations:
volume.beta.kubernetes.io/storage-class: {{ .Values.global.storageClass |quote }}
"helm.sh/hook": pre-install
spec:
storageClassName: {{ .Values.global.storageClass |quote }}
accessModes:
Expand Down
2 changes: 2 additions & 0 deletions charts/hummerrisk/templates/redis/redis-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ kind: Secret
metadata:
name: hummerrisk-redis-password
namespace: {{ .Release.Namespace | quote }}
annotations:
"helm.sh/hook": pre-install
labels:
app.kubernetes.io/name: redis
type: Opaque
Expand Down
7 changes: 1 addition & 6 deletions charts/hummerrisk/templates/web/deployment-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,10 @@ spec:
volumeMounts:
- name: config-volume
mountPath: /etc/nginx/conf.d/
- name: log-volume
mountPath: /var/log/nginx/
ports:
- containerPort: 80
volumes:
- name: config-volume
configMap:
defaultMode: 420
name: hummerrisk-web-config
- name: log-volume
persistentVolumeClaim:
claimName: {{ $pvcFullName }}-logs
name: hummerrisk-web-config

0 comments on commit 4c900e0

Please sign in to comment.