-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathk8s-service-broadcasting.yaml
91 lines (90 loc) · 2.03 KB
/
k8s-service-broadcasting.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
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: list-endpoints
rules:
- apiGroups: [""]
resources: ['endpoints']
verbs: ['get', 'list', 'watch']
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: default-to-list-endpoints
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: list-endpoints
subjects:
- kind: ServiceAccount
name: default
---
apiVersion: v1
kind: Service
metadata:
name: prometheus-pushgateway-ha
labels:
app: k8s-service-broadcasting
spec:
type: NodePort
ports:
- name: broadcast
port: 8080
protocol: TCP
nodePort: 30000
- name: metrics
port: 8081
protocol: TCP
nodePort: 30002
selector:
app: k8s-service-broadcasting
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: k8s-service-broadcasting
spec:
selector:
matchLabels:
app: k8s-service-broadcasting
replicas: 2
template:
metadata:
labels:
app: k8s-service-broadcasting
spec:
containers:
- name: k8s-service-broadcasting
image: fusakla/k8s-service-broadcasting-linux-amd64:latest
imagePullPolicy: Always
env:
- name: K8S_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
args:
- "--namespace=$(K8S_NAMESPACE)"
- "--service=prometheus-pushgateway"
- "--port-name=http"
- "--all-must-succeed=false"
- "--log-level=debug"
readinessProbe:
httpGet:
port: metrics
path: /-/ready
livenessProbe:
httpGet:
port: metrics
path: /-/healthy
ports:
- name: broadcast
containerPort: 8080
- name: metrics
containerPort: 8081
resources:
requests:
cpu: "50m"
memory: "50Mi"
limits:
cpu: "500m"
memory: "512Mi"