-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy path13_secret_example.yml
65 lines (63 loc) · 1.59 KB
/
13_secret_example.yml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
apiVersion: v1
kind: Pod
metadata:
name: secret-example
spec:
volumes:
- name: config
configMap:
name: my-config
- name: secret
secret:
secretName: my-secret
containers:
- name: main
image: sikalabs/nginx-public
ports:
- containerPort: 80
env:
- name: MY_DEFAULT_TOKEN
value: default
- name: MY_KEY
valueFrom:
secretKeyRef:
name: my-secret
key: password
- name: MY_TOKEN
valueFrom:
secretKeyRef:
name: my-secret
key: token
- name: MY_CONFIG
valueFrom:
configMapKeyRef:
name: my-config
key: config
volumeMounts:
- name: secret
subPath: password
mountPath: /usr/share/nginx/html/password.txt
- name: secret
subPath: tokenFromString
mountPath: /usr/share/nginx/html/tokenFromString.txt
- name: config
subPath: config
mountPath: /usr/share/nginx/html/config.txt
- name: config
subPath: hello.html
mountPath: /usr/share/nginx/html/hello.html
- name: config
subPath: config.yaml
mountPath: /usr/share/nginx/html/config.yaml.txt
- name: config
mountPath: /usr/share/nginx/html/configmap
- name: secret
mountPath: /usr/share/nginx/html/secret
resources:
requests:
memory: 50Mi
cpu: 50m
limits:
memory: 100Mi
cpu: 100m