forked from ntheanh201/kodekloud-engineer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
solution.yaml
32 lines (32 loc) · 823 Bytes
/
solution.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
apiVersion: v1
kind: Pod
metadata:
name: envars
spec:
containers:
- name: fieldref-container
image: httpd:latest
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
args:
- while true; do echo -en '/n'; printenv NODE_NAME POD_NAME; printenv POD_IP POD_SERVICE_ACCOUNT; sleep 10; done;
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_SERVICE_ACCOUNT
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
restartPolicy: Never