Skip to content

Commit

Permalink
Refactor/add-init-repo-and-resources (#78)
Browse files Browse the repository at this point in the history
* refactor: add init container based on persistent enabled and add resources

* chore: add default values
  • Loading branch information
lemzoo authored May 29, 2024
1 parent 1a52acc commit 55a8fb0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
20 changes: 17 additions & 3 deletions charts/doccano/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,29 @@ spec:
name: {{ .Values.service.targetPort }}{{ .Values.service.protocol | lower }}
protocol: {{ .Values.service.protocol }}
volumeMounts:
{{- if .Values.persistence.enabled }}
- mountPath: {{ .Values.persistence.mountPath }}
name: {{ .Values.persistence.volumeName }}
{{- end }}
- mountPath: /config
name: bootstrap
{{- if .Values.persistence.enabled }}
initContainers:
- args:
- chown
- "1000:1000"
- {{ .Values.persistence.mountPath }}
image: busybox
imagePullPolicy: IfNotPresent
name: chmod
image: "{{ .Values.init.image.repository }}:{{ .Values.init.image.tag }}"
imagePullPolicy: {{ .Values.init.image.pullPolicy }}
name: init
volumeMounts:
- mountPath: {{ .Values.persistence.mountPath }}
name: {{ .Values.persistence.volumeName }}
{{- with .Values.init.resources }}
resources:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
volumes:
- configMap:
defaultMode: 0777
Expand All @@ -78,10 +86,16 @@ spec:
name: {{ .Release.Name }}-conf
optional: false
name: bootstrap
{{- if .Values.persistence.enabled }}
- name: {{ .Values.persistence.volumeName }}
persistentVolumeClaim:
claimName: "{{ .Release.Name }}-{{ .Values.persistence.volumeName }}"
{{- end }}
{{- if .Values.image.deployRegistry }}
imagePullSecrets:
- name: "{{ .Values.image.name }}-{{ .Values.image.imagePullSecrets }}"
{{- end }}
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 8 }}
{{- end }}
24 changes: 24 additions & 0 deletions charts/doccano/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,30 @@ env:
ADMIN_EMAIL: admin@localhost
ADMIN_USERNAME: admin

init:
image:
repository: busybox
tag: latest
pullPolicy: IfNotPresent
resources:
requests:
cpu: 50m
memory: 32M
limits:
cpu: 100m
memory: 64M

extraEnv:
DEBUG: false

resources:
requests:
cpu: 100m
memory: 1G
limits:
cpu: 500m
memory: 2G

deploySecret: true
ADMIN_PASSWORD: password

Expand Down

0 comments on commit 55a8fb0

Please sign in to comment.