Skip to content

Commit f698885

Browse files
Dev/consolidate services (#358)
## πŸ“ Description When running services using skaffold dev, consolidate different microservices into singular deployment renderedtext/project-tasks#2417 ## βœ… Checklist - [ ] I have tested this change - [ ] This change requires documentation update
1 parent 30db0ff commit f698885

38 files changed

+1309
-4
lines changed

β€Ž.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*/out/*
22
*/*/out/*
3+
**/_wildcard*

β€Žartifacthub/helm/templates/dpl-bucketcleaner-scheduler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if not .Values.global.development.minimalDeployment }}
12
apiVersion: apps/v1
23
kind: Deployment
34
metadata:
@@ -85,3 +86,4 @@ spec:
8586
drop:
8687
- ALL
8788
{{- end }}
89+
{{- end }}

β€Žartifacthub/helm/templates/dpl-bucketcleaner-worker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if not .Values.global.development.minimalDeployment }}
12
apiVersion: apps/v1
23
kind: Deployment
34
metadata:
@@ -84,3 +85,4 @@ spec:
8485
drop:
8586
- ALL
8687
{{- end }}
88+
{{- end }}

β€Žartifacthub/helm/templates/dpl-internal-api.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if not .Values.global.development.minimalDeployment }}
12
apiVersion: v1
23
kind: Service
34
metadata:
@@ -112,3 +113,4 @@ spec:
112113
drop:
113114
- ALL
114115
{{- end }}
116+
{{- end }}

β€Žartifacthub/helm/templates/dpl-public-api.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if not .Values.global.development.minimalDeployment }}
12
apiVersion: v1
23
kind: Service
34
metadata:
@@ -106,3 +107,4 @@ spec:
106107
drop:
107108
- ALL
108109
{{- end }}
110+
{{- end }}
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
{{- if .Values.global.development.minimalDeployment }}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: "{{ .Chart.Name }}-public-grpc-api"
6+
spec:
7+
type: ClusterIP
8+
clusterIP: None
9+
selector:
10+
app: "{{ .Chart.Name }}"
11+
ports:
12+
- name: public-grpc-api
13+
port: 50052
14+
targetPort: 50052
15+
protocol: TCP
16+
---
17+
apiVersion: v1
18+
kind: Service
19+
metadata:
20+
name: "{{ .Chart.Name }}-internal-grpc-api"
21+
spec:
22+
type: ClusterIP
23+
clusterIP: None
24+
selector:
25+
app: "{{ .Chart.Name }}"
26+
ports:
27+
- name: public-grpc-api
28+
port: 50051
29+
targetPort: 50051
30+
protocol: TCP
31+
---
32+
apiVersion: apps/v1
33+
kind: Deployment
34+
metadata:
35+
name: "{{ .Chart.Name }}"
36+
spec:
37+
selector:
38+
matchLabels:
39+
app: "{{ .Chart.Name }}"
40+
replicas: 1
41+
template:
42+
metadata:
43+
name: "{{ .Chart.Name }}"
44+
labels:
45+
app: "{{ .Chart.Name }}"
46+
product: semaphoreci
47+
spec:
48+
{{- if .Values.imagePullSecrets }}
49+
imagePullSecrets:
50+
{{- range .Values.imagePullSecrets }}
51+
- name: {{ . }}
52+
{{- end }}
53+
{{- end }}
54+
automountServiceAccountToken: false
55+
initContainers:
56+
{{ include "initContainers.all" . | indent 8 }}
57+
containers:
58+
- name: "{{ .Chart.Name }}"
59+
image: "{{ .Values.global.image.registry }}/{{ .Values.image }}:{{ .Values.imageTag }}"
60+
securityContext:
61+
privileged: false
62+
allowPrivilegeEscalation: false
63+
readOnlyRootFilesystem: true
64+
capabilities:
65+
drop:
66+
- ALL
67+
ports:
68+
- name: grpc-port
69+
containerPort: 50052
70+
envFrom:
71+
- secretRef:
72+
name: {{ .Values.global.artifacts.secretName }}
73+
env:
74+
{{- include "env.db.go" . | indent 12 }}
75+
- name: START_PUBLIC_API
76+
value: "yes"
77+
- name: START_INTERNAL_API
78+
value: "yes"
79+
- name: LOG_LEVEL
80+
value: "INFO"
81+
- name: START_BUCKETCLEANER_WORKER
82+
value: "yes"
83+
- name: BUCKETCLEANER_WORKER_NUMBER_OF_PAGES_TO_PROCESS_IN_ONE_GO
84+
value: "10"
85+
- name: START_BUCKETCLEANER_SCHEDULER
86+
value: "yes"
87+
- name: BUCKETCLEANER_SCHEDULER_NAPTIME
88+
value: "60"
89+
- name: BUCKETCLEANER_SCHEDULER_BATCHSIZE
90+
value: "100"
91+
- name: OIB_OTHER_MIMES
92+
value: ".md:text/plain,.txt:text/plain; charset=utf-8"
93+
- name: OPEN_IN_BROWSER
94+
value: "image/jpeg,image/png,text/html; charset=utf-8,image/svg+xml"
95+
- name: CORS_ORIGINS
96+
valueFrom:
97+
configMapKeyRef:
98+
name: {{ .Values.global.domain.configMapName }}
99+
key: CORS_ORIGINS
100+
- name: POSTGRES_DB_SSL
101+
value: {{ .Values.global.database.ssl | quote }}
102+
- name: DB_NAME
103+
value: {{ .Values.db.name | quote }}
104+
- name: APPLICATION_NAME
105+
value: "{{ .Chart.Name }}"
106+
- name: AMQP_URL
107+
valueFrom:
108+
secretKeyRef:
109+
name: {{ .Values.global.rabbitmq.secretName }}
110+
key: amqp-url
111+
- name: JWT_HMAC_SECRET
112+
valueFrom:
113+
secretKeyRef:
114+
name: {{ include "secrets.jwt.name" . }}
115+
key: artifacts
116+
{{- if .Values.global.statsd.enabled }}
117+
- name: METRICS_NAMESPACE
118+
value: {{ .Values.global.statsd.metricsNamespace }}
119+
{{- end }}
120+
121+
{{- if .Values.publicApi.resources }}
122+
resources:
123+
{{ toYaml .Values.publicApi.resources | indent 13 }}
124+
{{- end }}
125+
126+
{{- if .Values.global.statsd.enabled }}
127+
- name: {{ .Chart.Name }}-statsd
128+
image: "{{ .Values.global.image.registry }}/{{ .Values.global.statsd.image }}:{{ .Values.global.statsd.imageTag }}"
129+
env:
130+
- name: FLUSH_INTERVAL
131+
value: "60000"
132+
- name: GRAPHITE_HOST
133+
value: {{ .Values.global.statsd.graphiteHost }}
134+
{{- if .Values.statsd.resources }}
135+
resources:
136+
{{ toYaml .Values.statsd.resources | indent 13 }}
137+
{{- end }}
138+
securityContext:
139+
privileged: false
140+
allowPrivilegeEscalation: false
141+
readOnlyRootFilesystem: true
142+
capabilities:
143+
drop:
144+
- ALL
145+
{{- end }}
146+
{{- end }}

β€Žgithub_notifier/helm/templates/api.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if not .Values.global.development.minimalDeployment }}
12
apiVersion: v1
23
kind: Service
34
metadata:
@@ -91,3 +92,4 @@ spec:
9192
drop:
9293
- ALL
9394
{{- end }}
95+
{{- end }}

β€Žgithub_notifier/helm/templates/consumer.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if not .Values.global.development.minimalDeployment }}
12
apiVersion: apps/v1
23
kind: Deployment
34
metadata:
@@ -93,3 +94,4 @@ spec:
9394
drop:
9495
- ALL
9596
{{- end }}
97+
{{- end }}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{{- if .Values.global.development.minimalDeployment }}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: "{{ .Chart.Name }}"
6+
namespace: {{ .Release.Namespace }}
7+
spec:
8+
type: NodePort
9+
selector:
10+
app: "{{ .Chart.Name }}"
11+
ports:
12+
- name: grpc
13+
port: 50051
14+
targetPort: 50051
15+
protocol: TCP
16+
---
17+
apiVersion: apps/v1
18+
kind: Deployment
19+
metadata:
20+
name: "{{ .Chart.Name }}"
21+
namespace: {{ .Release.Namespace }}
22+
spec:
23+
selector:
24+
matchLabels:
25+
app: "{{ .Chart.Name }}"
26+
replicas: {{ .Values.api.replicas }}
27+
template:
28+
metadata:
29+
name: "{{ .Chart.Name }}"
30+
labels:
31+
app: "{{ .Chart.Name }}"
32+
product: semaphoreci
33+
spec:
34+
automountServiceAccountToken: false
35+
initContainers:
36+
{{ include "initContainers.waitForRabbitMQ" . | indent 8 }}
37+
containers:
38+
- name: "{{ .Chart.Name }}"
39+
image: "{{ .Values.global.image.registry }}/{{ .Values.image }}:{{ .Values.imageTag }}"
40+
securityContext:
41+
privileged: false
42+
allowPrivilegeEscalation: false
43+
readOnlyRootFilesystem: true
44+
capabilities:
45+
drop:
46+
- ALL
47+
envFrom:
48+
- configMapRef:
49+
name: {{ .Values.global.internalApi.configMapName }}
50+
env:
51+
- name: START_CONSUMERS
52+
value: "true"
53+
- name: START_API
54+
value: "true"
55+
- name: BASE_DOMAIN
56+
valueFrom:
57+
configMapKeyRef:
58+
name: {{ .Values.global.domain.configMapName }}
59+
key: BASE_DOMAIN
60+
{{- if .Values.global.statsd.enabled }}
61+
- name: METRICS_NAMESPACE
62+
value: {{ .Values.global.statsd.metricsNamespace }}
63+
{{- end }}
64+
- name: AMQP_URL
65+
valueFrom:
66+
secretKeyRef:
67+
name: {{ .Values.global.rabbitmq.secretName }}
68+
key: amqp-url
69+
70+
{{- if .Values.api.resources }}
71+
resources:
72+
{{ toYaml .Values.api.resources | indent 12 }}
73+
{{- end }}
74+
75+
{{- if .Values.global.statsd.enabled }}
76+
- name: {{ .Chart.Name }}-statsd
77+
image: "{{ .Values.global.image.registry }}/{{ .Values.global.statsd.image }}:{{ .Values.global.statsd.imageTag }}"
78+
env:
79+
- name: FLUSH_INTERVAL
80+
value: "60000"
81+
- name: GRAPHITE_HOST
82+
value: {{ .Values.global.statsd.graphiteHost }}
83+
{{- if .Values.statsd.resources }}
84+
resources:
85+
{{ toYaml .Values.statsd.resources | indent 13 }}
86+
{{- end }}
87+
securityContext:
88+
privileged: false
89+
allowPrivilegeEscalation: false
90+
readOnlyRootFilesystem: true
91+
capabilities:
92+
drop:
93+
- ALL
94+
{{- end }}
95+
{{- end }}

β€Žguard/helm/templates/dpl-api.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if not .Values.global.development.minimalDeployment }}
12
apiVersion: apps/v1
23
kind: Deployment
34
metadata:
@@ -168,3 +169,4 @@ spec:
168169
{{ toYaml .Values.statsd.resources | indent 13 }}
169170
{{- end }}
170171
{{- end }}
172+
{{- end }}

0 commit comments

Comments
Β (0)