Browse Source

Templating out the secret yaml

Josh Cox 6 years ago
parent
commit
b86f539959

+ 14 - 0
example/kubernetes/using-secrets/Makefile

@@ -0,0 +1,14 @@
+ldap-secret.yaml: example
+	$(eval PWD := $(shell pwd -P))
+	$(eval ENV_DIR := $(shell echo ${PWD}/environment))
+	ENV_YAML=$(shell ${ENV_DIR}/file-to-base64.sh ${ENV_DIR}/my-env.yaml) \
+	ENV_STARTUP_YAML=$(shell ${ENV_DIR}/file-to-base64.sh ${ENV_DIR}/my-env.startup.yaml) \
+	envsubst < ldap-secret.tpl > ldap-secret.yaml
+
+example: environment/my-env.startup.yaml environment/my-env.yaml
+
+environment/my-env.startup.yaml:
+	cd environment ; cp my-env.startup.yaml.example my-env.startup.yaml
+
+environment/my-env.yaml:
+	cd environment ; cp my-env.yaml.example my-env.yaml

+ 0 - 0
example/kubernetes/using-secrets/environment/my-env.startup.yaml → example/kubernetes/using-secrets/environment/my-env.startup.yaml.example


+ 0 - 0
example/kubernetes/using-secrets/environment/my-env.yaml → example/kubernetes/using-secrets/environment/my-env.yaml.example


+ 11 - 0
example/kubernetes/using-secrets/ldap-secret.tpl

@@ -0,0 +1,11 @@
+apiVersion: "v1"
+kind: "List"
+items:
+  - kind: "Secret"
+    apiVersion: "v1"
+    metadata:
+      name: "ldap-secret"
+    data:
+      # files in environment/* converted into base64 with file-to-base64.sh
+      env.yaml: "$ENV_YAML"
+      env.startup.yaml: "$ENV_STARTUP_YAML"

File diff suppressed because it is too large
+ 0 - 10
example/kubernetes/using-secrets/ldap-secret.yaml


Some files were not shown because too many files changed in this diff