From a9b218ee602d0a9b8eb92ce1cbd96a87f544eb09 Mon Sep 17 00:00:00 2001 From: infra Date: Thu, 7 Dec 2023 15:54:45 -0500 Subject: [PATCH 1/2] Add service account for queue --- charts/langsmith/templates/_helpers.tpl | 7 +++++++ charts/langsmith/templates/queue/deployment.yaml | 1 + .../templates/queue/service-account.yaml | 16 ++++++++++++++++ charts/langsmith/values.yaml | 5 +++++ 4 files changed, 29 insertions(+) create mode 100644 charts/langsmith/templates/queue/service-account.yaml diff --git a/charts/langsmith/templates/_helpers.tpl b/charts/langsmith/templates/_helpers.tpl index 440349f..2690f2a 100644 --- a/charts/langsmith/templates/_helpers.tpl +++ b/charts/langsmith/templates/_helpers.tpl @@ -150,3 +150,10 @@ Template containing common environment variables that are used by several servic key: api_key_salt {{- end }} +{{- define "queue.serviceAccountName" -}} +{{- if .Values.queue.serviceAccount.create -}} + {{ default (printf "%s-%s" (include "langsmith.fullname" .) .Values.queue.name) .Values.queue.serviceAccount.name | trunc 63 | trimSuffix "-" }} +{{- else -}} + {{ default "default" .Values.queue.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/charts/langsmith/templates/queue/deployment.yaml b/charts/langsmith/templates/queue/deployment.yaml index 03f4c6c..38fca5a 100644 --- a/charts/langsmith/templates/queue/deployment.yaml +++ b/charts/langsmith/templates/queue/deployment.yaml @@ -39,6 +39,7 @@ spec: {{- end }} securityContext: {{- toYaml .Values.queue.deployment.podSecurityContext | nindent 8 }} + serviceAccountName: {{ include "queue.serviceAccountName" . }} containers: - name: {{ .Values.queue.name }} command: diff --git a/charts/langsmith/templates/queue/service-account.yaml b/charts/langsmith/templates/queue/service-account.yaml new file mode 100644 index 0000000..1645f5b --- /dev/null +++ b/charts/langsmith/templates/queue/service-account.yaml @@ -0,0 +1,16 @@ +{{- if .Values.queue.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "queue.serviceAccountName" . }} + labels: + {{- include "langsmith.labels" . | nindent 4 }} + {{- with.Values.playground.deployment.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + annotations: + {{- include "langsmith.annotations" . | nindent 4 }} + {{- with.Values.queue.serviceAccount.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/langsmith/values.yaml b/charts/langsmith/values.yaml index dd9d8d2..3ecbd45 100644 --- a/charts/langsmith/values.yaml +++ b/charts/langsmith/values.yaml @@ -263,6 +263,11 @@ queue: minReplicas: 1 maxReplicas: 5 targetCPUUtilizationPercentage: 80 + serviceAccount: + create: true + name: "" + labels: {} + annotations: {} redis: name: "redis" From f061f7f5db5dfdd4011edfd47dcc6d75a3c34c6a Mon Sep 17 00:00:00 2001 From: infra Date: Thu, 7 Dec 2023 15:55:00 -0500 Subject: [PATCH 2/2] bump chart --- charts/langsmith/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/langsmith/Chart.yaml b/charts/langsmith/Chart.yaml index 8c06d5c..ef90585 100644 --- a/charts/langsmith/Chart.yaml +++ b/charts/langsmith/Chart.yaml @@ -5,5 +5,5 @@ maintainers: email: ankush@langchain.dev description: Helm chart to deploy the langsmith application and all services it depends on. type: application -version: 0.1.6 +version: 0.1.7 appVersion: "0.1.0"