-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 add the admin service (to run admin scripts) (#275)
* feat: 🎸 add the admin service (to run admin scripts) * feat: 🎸 add admin service to kube * docs: ✏️ fix doc * docs: ✏️ run the scripts directly using docker or kubectl exec
- Loading branch information
Showing
37 changed files
with
2,456 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,3 +61,12 @@ splitsWorker: | |
cpu: 0.01 | ||
limits: | ||
cpu: 1 | ||
|
||
admin: | ||
replicas: 1 | ||
|
||
resources: | ||
requests: | ||
cpu: 0.01 | ||
limits: | ||
cpu: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
infra/charts/datasets-server/templates/admin/_container.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{{- define "containerAdmin" -}} | ||
- name: "{{ include "name" . }}-admin" | ||
env: | ||
- name: ASSETS_DIRECTORY | ||
value: {{ .Values.splitsWorker.assetsDirectory | quote }} | ||
- name: LOG_LEVEL | ||
value: {{ .Values.splitsWorker.logLevel | quote }} | ||
- name: MONGO_CACHE_DATABASE | ||
value: {{ .Values.mongodb.cacheDatabase | quote }} | ||
- name: MONGO_QUEUE_DATABASE | ||
value: {{ .Values.mongodb.queueDatabase | quote }} | ||
- name: MONGO_URL | ||
{{- if .Values.mongodb.enabled }} | ||
value: mongodb://{{.Release.Name}}-mongodb | ||
{{- else }} | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ .Values.secrets.mongoUrl | quote }} | ||
key: MONGO_URL | ||
optional: false | ||
{{- end }} | ||
image: "{{ .Values.admin.image.repository }}/{{ .Values.admin.image.name }}:{{ .Values.docker.tag }}" | ||
imagePullPolicy: {{ .Values.admin.image.pullPolicy }} | ||
volumeMounts: | ||
- mountPath: {{ .Values.admin.assetsDirectory | quote }} | ||
mountPropagation: None | ||
name: nfs | ||
subPath: "{{ include "assets.subpath" . }}" | ||
readOnly: false | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
# TODO: provide readiness and liveness probes | ||
# readinessProbe: | ||
# tcpSocket: | ||
# port: {{ .Values.admin.readinessPort }} | ||
# livenessProbe: | ||
# tcpSocket: | ||
# port: {{ .Values.admin.readinessPort }} | ||
resources: | ||
{{ toYaml .Values.admin.resources | nindent 4 }} | ||
{{- end -}} |
38 changes: 38 additions & 0 deletions
38
infra/charts/datasets-server/templates/admin/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
{{ include "labels.admin" . | nindent 4 }} | ||
name: "{{ include "release" . }}-admin" | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
progressDeadlineSeconds: 600 | ||
replicas: {{ .Values.admin.replicas }} | ||
revisionHistoryLimit: 10 | ||
selector: | ||
matchLabels: | ||
{{ include "labels.admin" . | nindent 6 }} | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
{{ include "labels.admin" . | nindent 8 }} | ||
spec: | ||
initContainers: | ||
{{ include "initContainerAssets" . | nindent 8 }} | ||
containers: | ||
{{ include "containerAdmin" . | nindent 8 }} | ||
nodeSelector: | ||
{{ toYaml .Values.admin.nodeSelector | nindent 8 }} | ||
tolerations: | ||
{{ toYaml .Values.admin.tolerations | nindent 8 }} | ||
volumes: | ||
- name: nfs | ||
nfs: | ||
server: {{ .Values.storage.nfs.server }} | ||
path: {{ .Values.storage.nfs.path }} | ||
securityContext: | ||
runAsUser: {{ .Values.uid }} | ||
runAsGroup: {{ .Values.gid }} | ||
runAsNonRoot: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.