From ae2faea66843315930f6cadfcf21a757d74268c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Mon, 1 Jun 2020 17:03:28 +0200 Subject: [PATCH] Get rid of mysql/auth.env For simplification, we move the environment variables away from the auth.env file. --- tutor/templates/apps/mysql/auth.env | 1 - tutor/templates/k8s/deployments.yml | 5 +---- tutor/templates/kustomization.yml | 2 -- tutor/templates/local/docker-compose.yml | 3 ++- 4 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 tutor/templates/apps/mysql/auth.env diff --git a/tutor/templates/apps/mysql/auth.env b/tutor/templates/apps/mysql/auth.env deleted file mode 100644 index 8d4ea4a..0000000 --- a/tutor/templates/apps/mysql/auth.env +++ /dev/null @@ -1 +0,0 @@ -MYSQL_ROOT_PASSWORD={{ MYSQL_ROOT_PASSWORD }} diff --git a/tutor/templates/k8s/deployments.yml b/tutor/templates/k8s/deployments.yml index b3730b9..df9b758 100644 --- a/tutor/templates/k8s/deployments.yml +++ b/tutor/templates/k8s/deployments.yml @@ -320,10 +320,7 @@ spec: args: ["mysqld", "--character-set-server=utf8", "--collation-server=utf8_general_ci"] env: - name: MYSQL_ROOT_PASSWORD - valueFrom: - configMapKeyRef: - name: mysql-config - key: MYSQL_ROOT_PASSWORD + value: "{{ MYSQL_ROOT_PASSWORD }}" ports: - containerPort: 3306 volumeMounts: diff --git a/tutor/templates/kustomization.yml b/tutor/templates/kustomization.yml index 5434e04..1fdb9cc 100644 --- a/tutor/templates/kustomization.yml +++ b/tutor/templates/kustomization.yml @@ -35,8 +35,6 @@ configMapGenerator: - name: nginx-config files:{% for file in "apps/nginx"|walk_templates %} - {{ file }}{% endfor %} -- name: mysql-config - env: apps/mysql/auth.env {{ patch("kustomization-configmapgenerator") }} {{ patch("kustomization") }} \ No newline at end of file diff --git a/tutor/templates/local/docker-compose.yml b/tutor/templates/local/docker-compose.yml index 1a802ea..8f9e456 100644 --- a/tutor/templates/local/docker-compose.yml +++ b/tutor/templates/local/docker-compose.yml @@ -26,7 +26,8 @@ services: restart: unless-stopped volumes: - ../../data/mysql:/var/lib/mysql - env_file: ../apps/mysql/auth.env + environment: + MYSQL_ROOT_PASSWORD: "{{ MYSQL_ROOT_PASSWORD }}" {% endif %} {% if ACTIVATE_ELASTICSEARCH %}