-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhello_env_lpv.yaml
63 lines (62 loc) · 1.65 KB
/
hello_env_lpv.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
62
63
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp-hello
namespace: itmsg
labels:
app: myapp
spec:
replicas: 3
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
environment: DEV
managedby: K8s
app: myapp
spec:
containers:
- name: logcontainer
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MY_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: MY_POD_SERVICE_ACCOUNT
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
image: busybox
command: [ "sh", "-c", "while [ true ]; do echo `date` pod_name : $POD_NAME, node_name: $NODE_NAME, Namespace : $MY_POD_NAMESPACE, Pod_IP: $MY_POD_IP, service_accout: $MY_POD_SERVICE_ACCOUNT 'Hello'; sleep 10; done | tee -a /ftlog/hello_${POD_NAME}.txt" ]
volumeMounts:
- name: local-persistent-storage
mountPath: /ftlog
subPathExpr: $(NODE_NAME)
# Primary Container
resources:
limits:
memory: 1028Mi
volumes:
- name: local-persistent-storage
persistentVolumeClaim:
claimName: local-pvc