Skip to content

Commit 2c8aa05

Browse files
author
isma90
committed
update configuration order
1 parent 6ff6e08 commit 2c8aa05

31 files changed

+139
-43
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
name: kube-state-metrics
5+
roleRef:
6+
apiGroup: rbac.authorization.k8s.io
7+
kind: ClusterRole
8+
name: kube-state-metrics
9+
subjects:
10+
- kind: ServiceAccount
11+
name: kube-state-metrics
12+
namespace: kube-system
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
# kubernetes versions before 1.8.0 should use rbac.authorization.k8s.io/v1beta1
3+
kind: ClusterRole
4+
metadata:
5+
name: kube-state-metrics
6+
rules:
7+
- apiGroups: [""]
8+
resources:
9+
- configmaps
10+
- secrets
11+
- nodes
12+
- pods
13+
- services
14+
- resourcequotas
15+
- replicationcontrollers
16+
- limitranges
17+
- persistentvolumeclaims
18+
- persistentvolumes
19+
- namespaces
20+
- endpoints
21+
verbs: ["list", "watch"]
22+
- apiGroups: ["extensions"]
23+
resources:
24+
- daemonsets
25+
- deployments
26+
- replicasets
27+
- ingresses
28+
verbs: ["list", "watch"]
29+
- apiGroups: ["apps"]
30+
resources:
31+
- daemonsets
32+
- deployments
33+
- replicasets
34+
- statefulsets
35+
verbs: ["list", "watch"]
36+
- apiGroups: ["batch"]
37+
resources:
38+
- cronjobs
39+
- jobs
40+
verbs: ["list", "watch"]
41+
- apiGroups: ["autoscaling"]
42+
resources:
43+
- horizontalpodautoscalers
44+
verbs: ["list", "watch"]
45+
- apiGroups: ["policy"]
46+
resources:
47+
- poddisruptionbudgets
48+
verbs: ["list", "watch"]
49+
- apiGroups: ["certificates.k8s.io"]
50+
resources:
51+
- certificatesigningrequests
52+
verbs: ["list", "watch"]
53+
- apiGroups: ["storage.k8s.io"]
54+
resources:
55+
- storageclasses
56+
verbs: ["list", "watch"]
57+
- apiGroups: ["autoscaling.k8s.io"]
58+
resources:
59+
- verticalpodautoscalers
60+
verbs: ["list", "watch"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
labels:
5+
k8s-app: kube-state-metrics
6+
name: kube-state-metrics
7+
namespace: kube-system
8+
spec:
9+
selector:
10+
matchLabels:
11+
k8s-app: kube-state-metrics
12+
replicas: 1
13+
template:
14+
metadata:
15+
labels:
16+
k8s-app: kube-state-metrics
17+
spec:
18+
serviceAccountName: kube-state-metrics
19+
containers:
20+
- name: kube-state-metrics
21+
image: quay.io/coreos/kube-state-metrics:v1.6.0
22+
ports:
23+
- name: http-metrics
24+
containerPort: 8080
25+
- name: telemetry
26+
containerPort: 8081
27+
readinessProbe:
28+
httpGet:
29+
path: /healthz
30+
port: 8080
31+
initialDelaySeconds: 5
32+
timeoutSeconds: 5

prometheus/kube-state-metrics-service-account.yaml 0_dependencies/kube-state-metrics/kube-state-metrics-service-account.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: v1
22
kind: ServiceAccount
33
metadata:
44
name: kube-state-metrics
5-
namespace: monitoring
5+
namespace: kube-system
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: kube-state-metrics
5+
namespace: kube-system
6+
labels:
7+
k8s-app: kube-state-metrics
8+
annotations:
9+
prometheus.io/scrape: 'true'
10+
spec:
11+
ports:
12+
- name: http-metrics
13+
port: 8080
14+
targetPort: http-metrics
15+
protocol: TCP
16+
- name: telemetry
17+
port: 8081
18+
targetPort: telemetry
19+
protocol: TCP
20+
selector:
21+
k8s-app: kube-state-metrics
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

README.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# Configurations you need to start a kubernetes cluster
22

3+
### Dependencies
4+
5+
`kubectl apply -f 0_dependencies`
6+
37
### Load Balancer
4-
`kubectl apply -f load-balancer`
8+
`kubectl apply -f 1_load-balancer`
59
### Ingress service
6-
`kubectl apply -f ingress-service`
10+
`kubectl apply -f 2_ingress-service`
711
### Heapster Monitoriong
812
Needed to use Horizontal Pod Autoscaler.
9-
`kubectl apply -f heapster`
13+
`kubectl apply -f 3_heapster`
1014
### Prometheus and Graphana
11-
`kubectl apply -f prometheus`
15+
`kubectl apply -f 4_prometheus`
1216

1317

1418
## Automation

deploy.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/env bash
22

3-
kubectl apply -f load-balancer
4-
kubectl apply -f ingress-service
5-
kubectl apply -f heapster
6-
kubectl apply -f prometheus
3+
kubectl apply -f 0_dependencies
4+
kubectl apply -f 1_load-balancer
5+
kubectl apply -f 2_ingress-service
6+
kubectl apply -f 3_heapster
7+
kubectl apply -f 4_prometheus
78

89
echo "Enjoy your cluster! :D"

prometheus/kube-state-metrics-service.yaml

-16
This file was deleted.

prometheus/kube-state-metrics.yaml

-18
This file was deleted.

0 commit comments

Comments
 (0)