From c5c56e22baf3c594844daabc74e1c74acfd9ff70 Mon Sep 17 00:00:00 2001 From: ycz008 Date: Tue, 2 Apr 2024 15:42:37 +0800 Subject: [PATCH] prod init dir --- prod-upgrade/mysql/mysql-0.yaml | 31 +++++++++++++++++-------------- prod-upgrade/mysql/mysql-1.yaml | 5 ++++- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/prod-upgrade/mysql/mysql-0.yaml b/prod-upgrade/mysql/mysql-0.yaml index 54350a4..7f48900 100644 --- a/prod-upgrade/mysql/mysql-0.yaml +++ b/prod-upgrade/mysql/mysql-0.yaml @@ -56,20 +56,23 @@ spec: app: mysql-m spec: initContainers: - - name: init - image: busybox - imagePullPolicy: IfNotPresent - command: - - sh - - -c - - | - sysctl -w net.ipv4.tcp_keepalive_time=300 - sysctl -w net.ipv4.tcp_keepalive_intvl=10 - sysctl -w net.ipv4.tcp_keepalive_probes=3 - mkdir -p /var/lib/mysql/{logs,data} - chown -R 999:999 /var/lib/mysql - securityContext: - privileged: true + - name: init + image: busybox + imagePullPolicy: IfNotPresent + command: + - sh + - -c + - | + sysctl -w net.ipv4.tcp_keepalive_time=300 + sysctl -w net.ipv4.tcp_keepalive_intvl=10 + sysctl -w net.ipv4.tcp_keepalive_probes=3 + mkdir -p /var/lib/mysql/{logs,data} + chown -R 999:999 /var/lib/mysql + securityContext: + privileged: true + volumeMounts: + - name: mysql-m + mountPath: /var/lib/mysql containers: - name: mysql image: mysql:8.0.33 diff --git a/prod-upgrade/mysql/mysql-1.yaml b/prod-upgrade/mysql/mysql-1.yaml index ddc744a..aa4cefc 100644 --- a/prod-upgrade/mysql/mysql-1.yaml +++ b/prod-upgrade/mysql/mysql-1.yaml @@ -67,9 +67,12 @@ spec: sysctl -w net.ipv4.tcp_keepalive_intvl=10 sysctl -w net.ipv4.tcp_keepalive_probes=3 mkdir -p /var/lib/mysql/{logs,data} - chown -R mysql.mysql /var/lib/mysql + chown -R 999:999 /var/lib/mysql securityContext: privileged: true + volumeMounts: + - name: mysql-m + mountPath: /var/lib/mysql containers: - name: mysql image: mysql:8.0.33