Add dev/stg/prod environments with per-env values, configmaps and secrets
- Move env-specific config into environments/<env>/{values,configmap,secret}.yaml
for both nginx-chart and mysql-chart (dev, stg, prod)
- Make templates env-agnostic: resource names come from values
(configMap.name, secret.name)
- nginx deployment mounts env ConfigMap and loads env Secret via envFrom
- mysql statefulset reads DB config from ConfigMap, passwords from Secret
- Remove mysql-chart/templates/secret.yaml (secrets are now per-env manifests)
- Add README with layout and deploy commands
This commit is contained in:
+25
-6
@@ -1,12 +1,31 @@
|
||||
namespace: prod
|
||||
# Base (default) values for mysql-chart.
|
||||
#
|
||||
# Environment-specific overrides live in environments/<env>/values.yaml and are
|
||||
# merged on top of this file at deploy time:
|
||||
#
|
||||
# helm upgrade --install mysql ./mysql-chart -n <namespace> --create-namespace \
|
||||
# -f mysql-chart/environments/<env>/values.yaml
|
||||
#
|
||||
# Available environments: dev, stg, prod
|
||||
#
|
||||
# NOTE: database credentials are NOT stored here. They live in the environment
|
||||
# secret (environments/<env>/secret.yaml) and the non-secret config lives in
|
||||
# the environment ConfigMap (environments/<env>/configmap.yaml).
|
||||
|
||||
namespace: dev
|
||||
|
||||
image:
|
||||
repository: mysql
|
||||
tag: "8.4"
|
||||
mysql:
|
||||
database: demo
|
||||
username: demo
|
||||
password: demo123
|
||||
rootPassword: root123
|
||||
|
||||
storage:
|
||||
storageClass: nfs-client
|
||||
size: 1Gi
|
||||
|
||||
# Names of the ConfigMap / Secret created by environments/<env>/configmap.yaml
|
||||
# and environments/<env>/secret.yaml
|
||||
configMap:
|
||||
name: mysql-config-dev
|
||||
|
||||
secret:
|
||||
name: mysql-secret-dev
|
||||
|
||||
Reference in New Issue
Block a user