From 8a41f4645d9675d61c6dc74ff0cbbabecbde1d03 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 3 Sep 2024 16:20:25 -0400 Subject: [PATCH] move zarf vars out of chart/values.yaml --- .../api/chart/templates/api/deployment.yaml | 8 ++++---- packages/api/chart/templates/api/service.yaml | 4 ++-- packages/api/chart/templates/uds-package.yaml | 2 +- packages/api/chart/values.yaml | 19 +++++++++++++------ packages/api/values/registry1-values.yaml | 4 ++++ packages/api/values/upstream-values.yaml | 4 ++++ 6 files changed, 28 insertions(+), 13 deletions(-) diff --git a/packages/api/chart/templates/api/deployment.yaml b/packages/api/chart/templates/api/deployment.yaml index 95b5a9a36..64e7dbccf 100644 --- a/packages/api/chart/templates/api/deployment.yaml +++ b/packages/api/chart/templates/api/deployment.yaml @@ -53,7 +53,7 @@ spec: - name: DEFAULT_EMBEDDINGS_MODEL value: "{{ .Values.api.env.defaultEmbeddingsModel }}" - name: PORT - value: "{{ .Values.api.env.port }}" + value: "{{ .Values.api.port }}" - name: SUPABASE_URL value: "{{ .Values.supabase.env.url }}" - name: SUPABASE_ANON_KEY @@ -63,17 +63,17 @@ spec: key: anon-key optional: true ports: - - containerPort: {{ .Values.api.env.port }} + - containerPort: {{ .Values.api.port }} livenessProbe: httpGet: path: /healthz - port: {{ .Values.api.env.port }} + port: {{ .Values.api.port }} initialDelaySeconds: 10 periodSeconds: 10 readinessProbe: httpGet: path: /healthz - port: {{ .Values.api.env.port }} + port: {{ .Values.api.port }} initialDelaySeconds: 10 periodSeconds: 10 securityContext: diff --git a/packages/api/chart/templates/api/service.yaml b/packages/api/chart/templates/api/service.yaml index 8dc6e2fac..33ea860f6 100644 --- a/packages/api/chart/templates/api/service.yaml +++ b/packages/api/chart/templates/api/service.yaml @@ -15,6 +15,6 @@ spec: ports: - name: http protocol: TCP - port: {{ .Values.api.env.port }} - targetPort: {{ .Values.api.env.port }} + port: {{ .Values.api.port }} + targetPort: {{ .Values.api.port }} type: ClusterIP diff --git a/packages/api/chart/templates/uds-package.yaml b/packages/api/chart/templates/uds-package.yaml index 21e2bc69e..e10dccc89 100644 --- a/packages/api/chart/templates/uds-package.yaml +++ b/packages/api/chart/templates/uds-package.yaml @@ -14,7 +14,7 @@ spec: {{- include "chart.selectorLabels" . | nindent 10 }} host: {{ include "chart.fullname" . }} gateway: tenant - port: {{ .Values.api.env.port }} + port: {{ .Values.api.port }} allow: - direction: Ingress diff --git a/packages/api/chart/values.yaml b/packages/api/chart/values.yaml index 60ec41317..8e1e5ac20 100644 --- a/packages/api/chart/values.yaml +++ b/packages/api/chart/values.yaml @@ -9,18 +9,23 @@ api: tag: 0.11.0 # x-release-please-end imagePullPolicy: Always + replicas: 1 + securityContext: runAsUser: 65532 runAsGroup: 65532 runAsNonRoot: true capabilities: drop: - - ALL + - ALL + + port: 8080 + env: - port: 8080 - exposeAPI: "###ZARF_VAR_EXPOSE_API###" - defaultEmbeddingsModel: "###ZARF_VAR_DEFAULT_EMBEDDINGS_MODEL###" + exposeAPI: "true" + defaultEmbeddingsModel: "text-embeddings" + serviceAccount: name: leapfrogai-api create: true @@ -38,7 +43,8 @@ api: runAsNonRoot: true capabilities: drop: - - ALL + - ALL + env: serviceName: "supabase-postgresql" servicePort: 5432 @@ -52,10 +58,11 @@ kiwigrid: repository: kiwigrid/k8s-sidecar tag: 1.23.3 imagePullPolicy: Always + securityContext: runAsUser: 65532 runAsGroup: 65532 runAsNonRoot: true capabilities: drop: - - ALL + - ALL diff --git a/packages/api/values/registry1-values.yaml b/packages/api/values/registry1-values.yaml index 56d7e6e4e..70e3bcad2 100644 --- a/packages/api/values/registry1-values.yaml +++ b/packages/api/values/registry1-values.yaml @@ -5,6 +5,10 @@ api: tag: v0.11.0 # x-release-please-end + env: + exposeAPI: "###ZARF_VAR_EXPOSE_API###" + defaultEmbeddingsModel: "###ZARF_VAR_DEFAULT_EMBEDDINGS_MODEL###" + migration: image: # TODO: replace with Ironbank image once hardened: registry1.dso.mil/ironbank/opensource/defenseunicorns/leapfrogai/api/migrations diff --git a/packages/api/values/upstream-values.yaml b/packages/api/values/upstream-values.yaml index 844e51c26..655d18b4f 100644 --- a/packages/api/values/upstream-values.yaml +++ b/packages/api/values/upstream-values.yaml @@ -3,6 +3,10 @@ api: repository: ghcr.io/defenseunicorns/leapfrogai/leapfrogai-api tag: ###ZARF_CONST_IMAGE_VERSION### + env: + exposeAPI: "###ZARF_VAR_EXPOSE_API###" + defaultEmbeddingsModel: "###ZARF_VAR_DEFAULT_EMBEDDINGS_MODEL###" + migration: image: repository: ghcr.io/defenseunicorns/leapfrogai/api-migrations