Skip to content

Commit 69e789f

Browse files
authored
Merge pull request #100 from metacpan/leo/add-kube-state
Add kube-state-metrics - wanted for #14
2 parents 744cde9 + b2c0087 commit 69e789f

File tree

6 files changed

+231
-0
lines changed

6 files changed

+231
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ progress document, more details will be added to the document as required.
2121
Need to remember that secrets are signed to the cluster not globally. You can copy the signer from one cluster to another if needed.
2222

2323
```
24+
cd platform/
2425
kubectl apply -k sealdedsecreats/do
2526
kubectl apply -k cert-manager/do
2627
kubectl apply -k ingress-nginx
2728
kubectl apply -k postgres
2829
kubectl apply -k nfs-provisioner/volatile
2930
kubectl apply -k argocd/do
31+
kubectl create -f kube-state-metrics/
3032
```
3133

3234
(might need `kubectl kustomization --enable-helm | kubectl apply -f` for any helm based ones above )
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
labels:
5+
app.kubernetes.io/component: exporter
6+
app.kubernetes.io/name: kube-state-metrics
7+
app.kubernetes.io/version: 2.12.0
8+
name: kube-state-metrics
9+
roleRef:
10+
apiGroup: rbac.authorization.k8s.io
11+
kind: ClusterRole
12+
name: kube-state-metrics
13+
subjects:
14+
- kind: ServiceAccount
15+
name: kube-state-metrics
16+
namespace: kube-system
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
labels:
5+
app.kubernetes.io/component: exporter
6+
app.kubernetes.io/name: kube-state-metrics
7+
app.kubernetes.io/version: 2.12.0
8+
name: kube-state-metrics
9+
rules:
10+
- apiGroups:
11+
- ""
12+
resources:
13+
- configmaps
14+
- secrets
15+
- nodes
16+
- pods
17+
- services
18+
- serviceaccounts
19+
- resourcequotas
20+
- replicationcontrollers
21+
- limitranges
22+
- persistentvolumeclaims
23+
- persistentvolumes
24+
- namespaces
25+
- endpoints
26+
verbs:
27+
- list
28+
- watch
29+
- apiGroups:
30+
- apps
31+
resources:
32+
- statefulsets
33+
- daemonsets
34+
- deployments
35+
- replicasets
36+
verbs:
37+
- list
38+
- watch
39+
- apiGroups:
40+
- batch
41+
resources:
42+
- cronjobs
43+
- jobs
44+
verbs:
45+
- list
46+
- watch
47+
- apiGroups:
48+
- autoscaling
49+
resources:
50+
- horizontalpodautoscalers
51+
verbs:
52+
- list
53+
- watch
54+
- apiGroups:
55+
- authentication.k8s.io
56+
resources:
57+
- tokenreviews
58+
verbs:
59+
- create
60+
- apiGroups:
61+
- authorization.k8s.io
62+
resources:
63+
- subjectaccessreviews
64+
verbs:
65+
- create
66+
- apiGroups:
67+
- policy
68+
resources:
69+
- poddisruptionbudgets
70+
verbs:
71+
- list
72+
- watch
73+
- apiGroups:
74+
- certificates.k8s.io
75+
resources:
76+
- certificatesigningrequests
77+
verbs:
78+
- list
79+
- watch
80+
- apiGroups:
81+
- discovery.k8s.io
82+
resources:
83+
- endpointslices
84+
verbs:
85+
- list
86+
- watch
87+
- apiGroups:
88+
- storage.k8s.io
89+
resources:
90+
- storageclasses
91+
- volumeattachments
92+
verbs:
93+
- list
94+
- watch
95+
- apiGroups:
96+
- admissionregistration.k8s.io
97+
resources:
98+
- mutatingwebhookconfigurations
99+
- validatingwebhookconfigurations
100+
verbs:
101+
- list
102+
- watch
103+
- apiGroups:
104+
- networking.k8s.io
105+
resources:
106+
- networkpolicies
107+
- ingressclasses
108+
- ingresses
109+
verbs:
110+
- list
111+
- watch
112+
- apiGroups:
113+
- coordination.k8s.io
114+
resources:
115+
- leases
116+
verbs:
117+
- list
118+
- watch
119+
- apiGroups:
120+
- rbac.authorization.k8s.io
121+
resources:
122+
- clusterrolebindings
123+
- clusterroles
124+
- rolebindings
125+
- roles
126+
verbs:
127+
- list
128+
- watch
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
labels:
5+
app.kubernetes.io/component: exporter
6+
app.kubernetes.io/name: kube-state-metrics
7+
app.kubernetes.io/version: 2.12.0
8+
name: kube-state-metrics
9+
namespace: kube-system
10+
spec:
11+
replicas: 1
12+
selector:
13+
matchLabels:
14+
app.kubernetes.io/name: kube-state-metrics
15+
template:
16+
metadata:
17+
labels:
18+
app.kubernetes.io/component: exporter
19+
app.kubernetes.io/name: kube-state-metrics
20+
app.kubernetes.io/version: 2.12.0
21+
spec:
22+
automountServiceAccountToken: true
23+
containers:
24+
- image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.12.0
25+
livenessProbe:
26+
httpGet:
27+
path: /healthz
28+
port: 8080
29+
initialDelaySeconds: 5
30+
timeoutSeconds: 5
31+
name: kube-state-metrics
32+
ports:
33+
- containerPort: 8080
34+
name: http-metrics
35+
- containerPort: 8081
36+
name: telemetry
37+
readinessProbe:
38+
httpGet:
39+
path: /
40+
port: 8081
41+
initialDelaySeconds: 5
42+
timeoutSeconds: 5
43+
securityContext:
44+
allowPrivilegeEscalation: false
45+
capabilities:
46+
drop:
47+
- ALL
48+
readOnlyRootFilesystem: true
49+
runAsNonRoot: true
50+
runAsUser: 65534
51+
seccompProfile:
52+
type: RuntimeDefault
53+
nodeSelector:
54+
kubernetes.io/os: linux
55+
serviceAccountName: kube-state-metrics
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
automountServiceAccountToken: false
3+
kind: ServiceAccount
4+
metadata:
5+
labels:
6+
app.kubernetes.io/component: exporter
7+
app.kubernetes.io/name: kube-state-metrics
8+
app.kubernetes.io/version: 2.12.0
9+
name: kube-state-metrics
10+
namespace: kube-system
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
labels:
5+
app.kubernetes.io/component: exporter
6+
app.kubernetes.io/name: kube-state-metrics
7+
app.kubernetes.io/version: 2.12.0
8+
name: kube-state-metrics
9+
namespace: kube-system
10+
spec:
11+
clusterIP: None
12+
ports:
13+
- name: http-metrics
14+
port: 8080
15+
targetPort: http-metrics
16+
- name: telemetry
17+
port: 8081
18+
targetPort: telemetry
19+
selector:
20+
app.kubernetes.io/name: kube-state-metrics

0 commit comments

Comments
 (0)