-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmirror-deployment.yaml
151 lines (151 loc) · 5.03 KB
/
mirror-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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{{- if .Values.mirrors.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "github-actions-runner.fullname" . }}-mirrors
labels:
{{- include "github-actions-runner.labels" . | nindent 4 }}
app.kubernetes.io/component: mirrors
spec:
replicas: 1
selector:
matchLabels:
{{- include "github-actions-runner.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: mirrors
template:
metadata:
annotations:
checksum/config: {{ toJson .Values.mirrors.registry | sha256sum }}
prometheus.io/scrape: "true"
prometheus.io/scheme: https
prometheus.io/port: "8443"
labels:
{{- include "github-actions-runner.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: mirrors
spec:
{{- if .Values.mirrors.serviceAccount.create }}
serviceAccountName: {{ include "github-actions-runner.mirrors.serviceAccountName" . }}
automountServiceAccountToken: true
{{- else }}
automountServiceAccountToken: false
{{- end }}
enableServiceLinks: false
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsGroup: 65534
fsGroup: 65534
fsGroupChangePolicy: "OnRootMismatch"
terminationGracePeriodSeconds: 1
containers:
- name: {{ include "github-actions-runner.fullname" . }}-mirrors-registry
securityContext:
allowPrivilegeEscalation: false
seccompProfile:
type: RuntimeDefault
capabilities:
drop: ["ALL"]
image: "{{ $.Values.mirrors.image.repository }}:{{ $.Values.mirrors.image.tag }}"
imagePullPolicy: {{ $.Values.mirrors.image.pullPolicy }}
ports:
- name: https
containerPort: 8443
startupProbe:
httpGet:
path: /v2/
port: https
scheme: HTTPS
initialDelaySeconds: 5
timeoutSeconds: 3
failureThreshold: 30
periodSeconds: 5
resources:
{{- toYaml $.Values.mirrors.resources | nindent 12 }}
volumeMounts:
- name: data
mountPath: /var/lib/registry
- name: config
mountPath: /etc/zot
- name: credentials
mountPath: /etc/credentials
- name: tls
mountPath: /etc/registry-tls
- name: {{ include "github-actions-runner.fullname" . }}-redirect
securityContext:
allowPrivilegeEscalation: false
seccompProfile:
type: RuntimeDefault
capabilities:
drop: ["ALL"]
image: ghcr.io/zalando/skipper:v0.21.223
command: ['skipper']
args:
- -address=:8080
- -routes-file=/etc/skipper/mirrors.eskip
- -application-log-level=WARN
- -metrics-listener=
ports:
- name: http
containerPort: 8080
startupProbe:
httpGet:
path: /healthz
port: http
scheme: HTTP
initialDelaySeconds: 5
timeoutSeconds: 3
failureThreshold: 30
periodSeconds: 5
resources:
requests:
cpu: 50m
memory: 32Mi
volumeMounts:
- name: config
mountPath: /etc/skipper
{{- with default .Values.nodeSelector .Values.mirrors.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with default .Values.affinity .Values.mirrors.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.mirrors.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: data
{{- if not .Values.mirrors.persistence.enabled }}
emptyDir: {}
{{- else }}
ephemeral:
volumeClaimTemplate:
metadata:
{{- with .Values.mirrors.persistence.annotations }}
annotations:
{{- toYaml . | nindent 18 }}
{{- end }}
labels:
{{- include "github-actions-runner.selectorLabels" . | nindent 18 }}
app.kubernetes.io/component: mirrors
{{- include "volumeClaimTemplate.spec.render" .Values.mirrors.persistence | nindent 14 }}
{{- end }}
- name: config
configMap:
name: {{ include "github-actions-runner.fullname" . }}
items:
- key: mirrors.eskip
path: mirrors.eskip
- key: mirrors.json
path: config.json
- name: tls
secret:
secretName: {{ include "github-actions-runner.fullname" . }}-server-tls
defaultMode: 256
- name: credentials
secret:
secretName: {{ include "github-actions-runner.fullname" . }}-mirrors
defaultMode: 256
{{- end }}