-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.yaml
113 lines (106 loc) · 2.76 KB
/
deployment.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: pod-metrics-sa
namespace: default
automountServiceAccountToken: true
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: pod-metrics-role
rules:
- apiGroups: [""]
resources: ["pods", "namespaces"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: pod-metrics-binding
roleRef:
kind: ClusterRole
name: pod-metrics-role
apiGroup: "rbac.authorization.k8s.io"
subjects:
- kind: ServiceAccount
name: pod-metrics-sa
namespace: default
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: pod-metrics
namespace: default
labels:
app: pod-metrics
spec:
replicas: 1
selector:
matchLabels:
app: pod-metrics
template:
metadata:
labels:
app: pod-metrics
spec:
containers:
- name: pod-metrics
image: docker.io/juliocesarmidia/kube-pod-metrics-collector:v1.0.0
imagePullPolicy: Always # Never IfNotPresent Always
resources:
limits:
memory: 512Mi
cpu: 1000m
requests:
memory: 256Mi
cpu: 500m
envFrom:
- secretRef:
name: pod-metrics-secrets
- configMapRef:
name: pod-metrics-configmap
env:
- name: RUNNING_IN_KUBERNETES
value: '1'
- name: SCHEDULE_SECONDS_INTERVAL
value: '60'
- name: PENDING_MINS_TO_BE_CRASHED
value: '1'
- name: IGNORE_NAMESPACES
value: 'kube-public,kube-node-lease'
- name: SEND_TO_CLOUDWATCH
value: '1'
- name: CLOUDWATCH_METRIC_NAME
value: 'CrashedPods'
- name: CLOUDWATCH_METRIC_NAMESPACE
value: 'K8sMetrics'
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_SERVICE_ACCOUNT
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: HOST_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
dnsPolicy: ClusterFirst
restartPolicy: Always
serviceAccountName: pod-metrics-sa
tolerations: []