-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdownward_api_pod_env.yaml
63 lines (61 loc) · 1.7 KB
/
downward_api_pod_env.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
apiVersion: v1
kind: Pod
metadata:
name: downside
labels:
run: app
annotations:
running-kubernetes.io/pod: downward
example.io/pod: revision-1
spec:
containers:
- image: nginx:1.7.9
name: downward
workingDir: /root/
resources:
requests:
cpu: 1
memory: '500Mi' # 500Mi --> 500 MebiBytes
limits:
cpu: 2
memory: '1Gi'
env:
- name: "NODE_NAME"
valueFrom: # fieldRef is for Pod Specification
fieldRef:
fieldPath: spec.nodeName
# - name: POD_LABEL
# valueFrom:
# fieldRef:
# fieldPath: metadata.labels
# - name: POD_ANNOTATION
# valueFrom:
# fieldRef: # EnvVar not supported Annotations and Labels.
# fieldPath: metadata.annotations
- name: "POD_NAME"
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: "POD_NAMESPACE"
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: "SERVICE_ACCOUNT"
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
- name: "POD_IP"
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: "CONTAINER_MEMORY"
valueFrom:
resourceFieldRef:
resource: requests.memory
containerName: downward
- name: "CONTAINER_MEMORY"
valueFrom:
resourceFieldRef:
resource: limits.memory
containerName: downward
# divisor: 1ki # 1 KibiByte