diff --git a/README.md b/README.md index c2bd39c..d9935d5 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,15 @@ Set the value web.livenessProbe.path and web.readinessProbe.path to change the U ## Run commands -This helm chart will set a "role" environment variable to web, worker, or beat. It's up to your Docker image to read this variable and run the correct command. +This helm chart will set a "role" environment variable to web, worker, or beat. Your Docker image could read this variable and run the correct command. + +Alternatively, set the service.command. For example: + +``` +web: + command: + - run_it +``` # Usage diff --git a/templates/beat/deployment.yaml b/templates/beat/deployment.yaml index 4112037..44e958a 100644 --- a/templates/beat/deployment.yaml +++ b/templates/beat/deployment.yaml @@ -30,6 +30,12 @@ spec: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} + {{- if .Values.beat.command }} + command: {{ .Values.beat.command }} + {{- end }} + {{- if .Values.beat.args }} + args: {{ .Values.beat.args }} + {{- end }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/templates/web/deployment.yaml b/templates/web/deployment.yaml index 591032f..80d8173 100644 --- a/templates/web/deployment.yaml +++ b/templates/web/deployment.yaml @@ -32,6 +32,12 @@ spec: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} + {{- if .Values.web.command }} + command: {{ .Values.web.command }} + {{- end }} + {{- if .Values.web.args }} + args: {{ .Values.web.args }} + {{- end }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" diff --git a/templates/worker/deployment.yaml b/templates/worker/deployment.yaml index f37a890..78c83d5 100644 --- a/templates/worker/deployment.yaml +++ b/templates/worker/deployment.yaml @@ -30,6 +30,12 @@ spec: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} + {{- if .Values.worker.command }} + command: {{ .Values.worker.command }} + {{- end }} + {{- if .Values.worker.args }} + args: {{ .Values.worker.args }} + {{- end }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"