temporalio / helm-charts

Temporal Helm charts
MIT License
282 stars 316 forks source link

[Feature Request] add ability to run CLI admin commands from helm chart #303

Open shmykyta opened 2 years ago

shmykyta commented 2 years ago

Is your feature request related to a problem? Please describe.

Currently need to run tctl commands after deployment manually what contradict cloud native and automation way to manage application and infrastructure.

https://github.com/temporalio/helm-charts#running-temporal-cli-from-the-admin-tools-container

Describe the solution you'd like

Use ability to add admin CLI commands to postStart lifecycle hook: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks

      containers:
        - name: admin-tools
          image: "{{ .Values.admintools.image.repository }}:{{ .Values.admintools.image.tag }}"
          imagePullPolicy: {{ .Values.admintools.image.pullPolicy }}
          {{- if .Values.cliCommand }}
          lifecycle:
            postStart:
             exec:
                command: ["/bin/sh", "-c", {{ .Values.cliCommand | quote }}]
          {{- end }}
          ports:
            - name: http
              containerPort: 22
              protocol: TCP
          env:
            - name: TEMPORAL_CLI_ADDRESS
              value: {{ include "temporal.fullname" . }}-frontend:{{ include "temporal.frontend.grpcPort" . }}
          livenessProbe:
              exec:
                command:
                - ls
                - /
robholland commented 1 month ago

Do you have an example of a command you need to run? This doesn't feel in-scope for the chart to provide.