extracting kubernetes podname from java

Solutions on MaxInterview for extracting kubernetes podname from java by the best coders in the world

showing results for - "extracting kubernetes podname from java"
Dario
23 Nov 2017
1apiVersion: v1
2kind: Pod
3metadata:
4  name: dapi-test-pod
5spec:
6  containers:
7    - name: test-container
8      image: gcr.io/google_containers/busybox
9      command: [ "/bin/sh", "-c", "env" ]
10      env:
11        - name: MY_POD_NAME
12          valueFrom:
13            fieldRef:
14              fieldPath: metadata.name
15        - name: MY_POD_NAMESPACE
16          valueFrom:
17            fieldRef:
18              fieldPath: metadata.namespace
19        - name: MY_POD_IP
20          valueFrom:
21            fieldRef:
22              fieldPath: status.podIP
23  restartPolicy: Never
24