Skip to content

Commit

Permalink
Solution:3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cth-usq committed May 9, 2024
1 parent c584c8a commit d4d3f34
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ metadata:
namespace: {{ .Values.global.namespace }}
type: Opaque
data:
{{- range $k, $v := .Values.mysql.secret }}
{{- range $k, $v := .Values.mysql.secrets }}
{{ $k | upper }}: {{ $v | b64enc | quote }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
selector:
matchLabels:
app: {{ .Chart.Name }}
replicas: {{ .Values.mysql.statefulSet }}
replicas: {{ .Values.mysql.statefulSet.replicas }}
serviceName: {{ .Chart.Name }}
template:
metadata:
Expand All @@ -18,14 +18,16 @@ spec:
- name: {{ .Values.mysql.statefulSet.name }}
image: {{ .Values.mysql.statefulSet.repository }}:{{ .Values.mysql.statefulSet.version }}
env:
{{- range $k := .Values.mysql.secret }}
- name: {{ $k }}
{{- range $k := .Values.mysql.secrets }}
- name: {{ $k | upper }}
valueFrom:
secretKeyRef:
name: mysql-secrets
key: {{ $k }}
key: {{ $k | upper }}
{{- end }}
value: app_db
resources:
requests:
{{ .Values.mysql.statefulSet.resources.requests }}
ports:
- name: mysql
containerPort: 3306
Expand All @@ -35,9 +37,6 @@ spec:
subPath: mysql
- name: config-map
mountPath: /docker-entrypoint-initdb.d
resources:
requests:
{{ .Values.mysql.statefulSet.resources.requests }}
livenessProbe:
{{ .Values.mysql.statefulSet.livenessProbe }}
readinessProbe:
Expand All @@ -47,7 +46,12 @@ spec:
configMap:
name: mysql
tolerations:
{{ .Values.mysql.statefulSet.tolerations }}
{{- range .Values.mysql.statefulSet.tolerations }}
- key: "{{ .key }}"
operator: "{{ .operator }}"
value: "{{ .value }}"
effect: "{{ .effect }}"
{{- end }}
volumeClaimTemplates:
- metadata:
name: data
Expand Down
4 changes: 2 additions & 2 deletions .infrastructure/helm-chart/todoapp/charts/mysql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mysql:
port: 3306
clusterIP: None

secret:
secrets:
MYSQL_ROOT_PASSWORD: "1234"
MYSQL_USER: "app_user"
MYSQL_PASSWORD: "1234"
Expand All @@ -19,8 +19,8 @@ mysql:

resources:
requests:
cpu: 500m
memory: 1Gi
cpu: 500m

livenessProbe:
exec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
- name: {{ $k | upper }}
valueFrom:
secretKeyRef:
name: todoapp-secret
name: todoapp-secrets
key: {{ $k | upper }}
{{- end }}
ports:
Expand Down

0 comments on commit d4d3f34

Please sign in to comment.