Skip to content

Commit f27f706

Browse files
Merge pull request #323 from joshuacox/generate_ldap-secret.yaml
Generate ldap secret.yaml
2 parents 71f0ff8 + ccfae06 commit f27f706

File tree

8 files changed

+35
-11
lines changed

8 files changed

+35
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ldap-secret.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
ldap-secret.yaml: example
2+
$(eval PWD := $(shell pwd -P))
3+
$(eval ENV_DIR := $(shell echo ${PWD}/environment))
4+
ENV_YAML=$(shell ${ENV_DIR}/file-to-base64.sh ${ENV_DIR}/my-env.yaml) \
5+
ENV_STARTUP_YAML=$(shell ${ENV_DIR}/file-to-base64.sh ${ENV_DIR}/my-env.startup.yaml) \
6+
envsubst < ldap-secret.tpl > ldap-secret.yaml
7+
8+
example: environment/my-env.startup.yaml environment/my-env.yaml
9+
10+
environment/my-env.startup.yaml:
11+
cd environment ; cp my-env.startup.yaml.example my-env.startup.yaml
12+
13+
environment/my-env.yaml:
14+
cd environment ; cp my-env.yaml.example my-env.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Generating ldap-secret.yaml
2+
3+
`make example`
4+
5+
Then edit the yaml files in the environment directory to have the desired paraneters, and then make the secret file:
6+
7+
`make ldap-secret.yaml`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
my-env.startup.yaml
2+
my-env.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: "v1"
2+
kind: "List"
3+
items:
4+
- kind: "Secret"
5+
apiVersion: "v1"
6+
metadata:
7+
name: "ldap-secret"
8+
data:
9+
# files in environment/* converted into base64 with file-to-base64.sh
10+
env.yaml: "$ENV_YAML"
11+
env.startup.yaml: "$ENV_STARTUP_YAML"

β€Žexample/kubernetes/using-secrets/ldap-secret.yaml

-11
This file was deleted.

0 commit comments

Comments
Β (0)