templates/deployment.yaml を更新

This commit is contained in:
2025-11-20 07:24:49 +00:00
parent 7b212558d3
commit 9e5684b9ab

View File

@@ -30,12 +30,26 @@ spec:
securityContext: securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }} {{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers: initContainers:
- name: init-php-fpm - name: copy-phpmyadmin
image: "{{ .Values.image.phpmyadmin.registry }}/{{ .Values.image.phpmyadmin.repository }}:{{ .Values.image.phpmyadmin.tag }}" image: "{{ .Values.image.phpmyadmin.registry }}/{{ .Values.image.phpmyadmin.repository }}:{{ .Values.image.phpmyadmin.tag }}"
imagePullPolicy: {{ .Values.image.phpmyadmin.pullPolicy }} imagePullPolicy: {{ .Values.image.phpmyadmin.pullPolicy }}
command: ['sh', '-c', 'echo "PHP-FPM init container completed"'] command:
- sh
- -c
- |
echo "Copying phpMyAdmin files to shared volume..."
cp -rp /var/www/html/. /tmp/phpmyadmin/
echo "Copy completed successfully"
securityContext: securityContext:
{{- toYaml .Values.securityContext.phpmyadmin | nindent 10 }} allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
runAsUser: 82
volumeMounts:
- name: phpmyadmin-data
mountPath: /tmp/phpmyadmin
containers: containers:
- name: nginx - name: nginx
securityContext: securityContext:
@@ -79,7 +93,6 @@ spec:
mountPath: /var/run mountPath: /var/run
- name: phpmyadmin-data - name: phpmyadmin-data
mountPath: /var/www/html mountPath: /var/www/html
readOnly: true
- name: phpmyadmin - name: phpmyadmin
securityContext: securityContext:
{{- toYaml .Values.securityContext.phpmyadmin | nindent 10 }} {{- toYaml .Values.securityContext.phpmyadmin | nindent 10 }}
@@ -134,6 +147,10 @@ spec:
volumeMounts: volumeMounts:
- name: phpmyadmin-data - name: phpmyadmin-data
mountPath: /var/www/html mountPath: /var/www/html
- name: phpmyadmin-config
mountPath: /etc/phpmyadmin/config.user.inc.php
subPath: config.inc.php
readOnly: true
{{- if .Values.persistence.enabled }} {{- if .Values.persistence.enabled }}
- name: sessions - name: sessions
mountPath: /sessions mountPath: /sessions
@@ -153,6 +170,12 @@ spec:
items: items:
- key: default.conf - key: default.conf
path: default.conf path: default.conf
- name: phpmyadmin-config
configMap:
name: {{ include "phpmyadmin-nginx.fullname" . }}
items:
- key: config.inc.php
path: config.inc.php
- name: nginx-cache - name: nginx-cache
emptyDir: {} emptyDir: {}
- name: nginx-run - name: nginx-run