-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathenv_config.yaml
38 lines (37 loc) · 1.02 KB
/
env_config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
run: nginx
name: nginx
spec:
replicas: 5
selector:
matchLabels:
run: nginx
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
run: nginx
spec:
containers:
- image: nginx:1.16
name: nginx
env: #<-- Adding Environment variables to a container
- name: VIA_SPEC
value: "From Spec" #<-- Value hardcoded in the spec
- name: VIA_CONFIGMAP
valueFrom: #<-- instead of direct value reference it
configMapKeyRef: #<-- all info to get a specific variable value
name: nginx-config
key: example.value
---
apiVersion: v1
kind: ConfigMap #<-- defining a configMap
metadata:
name: nginx-config
data:
example.value: "From Configmap" #<-- one of many possible values