-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.yaml
105 lines (105 loc) · 2.41 KB
/
deploy.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
---
apiVersion: v1
kind: Namespace
metadata:
name: image-availability-exporter
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: image-availability-exporter
namespace: image-availability-exporter
labels:
app: image-availability-exporter
spec:
replicas: 1
selector:
matchLabels:
app: image-availability-exporter
template:
metadata:
name: image-availability-exporter
labels:
app: image-availability-exporter
spec:
volumes:
- name: docker-pull-secret
secret:
secretName: docker-pull-secret
items:
- key: .dockerconfigjson
path: config.json
imagePullSecrets:
- name: docker-pull-secret
serviceAccountName: image-availability-exporter
containers:
- name: image-availability-exporter
image: ghcr.io/riskident/image-availability-exporter:v0.1.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
protocol: TCP
volumeMounts:
- mountPath: /root/.docker/
readOnly: true
name: docker-pull-secret
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: image-availability-exporter
namespace: image-availability-exporter
labels:
app: image-availability-exporter
spec:
selector:
app: image-availability-exporter
ports:
- protocol: TCP
port: 80
targetPort: 8080
name: metrics
type: NodePort
---
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: image-availability-exporter
name: image-availability-exporter
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: image-availability-exporter
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: image-availability-exporter
namespace: image-availability-exporter
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: image-availability-exporter
rules:
- apiGroups: [ "" ]
resources: [ "pod" ]
verbs: [ "get", "list" ]
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: image-availability-exporter
namespace: image-availability-exporter
spec:
selector:
matchLabels:
app: image-availability-exporter
endpoints:
- port: metrics
path: /metrics
interval: 30s