-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcoresvc_registry.yaml
84 lines (84 loc) · 3.2 KB
/
coresvc_registry.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
{{- if .Values.services.core.registry.enabled }}
{{- $serviceValues := .Values.services.core.registry }}
{{- $globalValues := .Values.global }}
{{- $imgName := printf "%s/%s:%s" (include "spacefx.servicePrefixCalc" (dict "globalValues" $globalValues)) $serviceValues.repository (include "spacefx.serviceVersionCalc" (dict "globalValues" $globalValues "serviceValues" $serviceValues)) }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ $serviceValues.appName | quote }}
namespace: {{ $serviceValues.serviceNamespace }}
spec:
type: NodePort
ports:
- name: {{printf "%s-registry" $serviceValues.repository }}
port: {{ $serviceValues.repositoryTargetPort }}
targetPort: {{ $serviceValues.repositoryTargetPort }}
- name: {{printf "%s-pypiserver" $serviceValues.repository }}
port: {{ $serviceValues.pypiServerTargetPort }}
targetPort: {{ $serviceValues.pypiServerTargetPort }}
selector:
app: {{ $serviceValues.appName | quote }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $serviceValues.appName | quote }}
namespace: {{ $serviceValues.serviceNamespace | quote }}
labels:
app: {{ $serviceValues.appName | quote }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ $serviceValues.appName | quote }}
template:
metadata:
labels:
app: {{ $serviceValues.appName | quote }}
spec:
containers:
- name: {{ $serviceValues.appName | quote }}
ports:
- containerPort: {{ $serviceValues.repositoryTargetPort }}
- containerPort: {{ $serviceValues.pypiServerTargetPort }}
image: {{ $imgName | quote }}
imagePullPolicy: Never
{{- include "spacefx.resourceLimits" (dict "globalValues" $globalValues "serviceValues" $serviceValues) | indent 8 }}
command:
{{- range $serviceValues.containerCommand }}
- {{ . }}
{{- end }}
env:
- name: REGISTRY_HTTP_TLS_CERTIFICATE
value: {{ $serviceValues.tlsCertificate }}
- name: REGISTRY_HTTP_TLS_KEY
value: {{ $serviceValues.tlsKey }}
- name: REGISTRY_ENABLED
value: {{ $serviceValues.services.registryEnabled | ternary "true" "false" | quote }}
- name: PYPISERVER_ENABLED
value: {{ $serviceValues.services.pypiServerEnabled | ternary "true" "false" | quote }}
volumeMounts:
- name: registry-data-mount
mountPath: /var/lib/registry
- name: registry-cert-mount
mountPath: /certs
- name: pypiserver-packages-mount
mountPath: /data/packages
volumes:
- name: pypiserver-packages-mount
hostPath:
path: {{ $globalValues.spacefxDirectories.base }}/registry/pypiserver/packages
type: DirectoryOrCreate
- name: registry-data-mount
hostPath:
path: {{ $globalValues.spacefxDirectories.base }}/registry/data
type: DirectoryOrCreate
- name: registry-cert-mount
hostPath:
path: {{ $globalValues.spacefxDirectories.base }}/certs/registry
type: DirectoryOrCreate
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: true
# core-registry generation end
{{- end }}