Skip to content

armgit / sie

Public Imported from GitHub
0

Open-source inference server and production cluster for all the models your agent needs.

1.4 KB
Raw Blame
{{- include "sie-cluster.nats.validateAuth" . }}
{{- if and (include "sie-cluster.nats.authEnabled" .) .Values.nats.install }}
{{- $auth := .Values.nats.auth | default dict }}
{{- $components := include "sie-cluster.nats.authComponents" . | fromJsonArray }}
{{- if .Values.nats.config.cluster.enabled }}
{{- $components = append $components "route" }}
{{- end }}
{{- range $component := $components }}
{{- if not (dig "existingSecrets" $component "" $auth) }}
{{- $name := include "sie-cluster.nats.authSecretName" (dict "auth" $auth "release" $.Release.Name "component" $component) }}
{{- $password := printf "%s%s" (randAlpha 1) (randAlphaNum 47) | b64enc }}
{{- with lookup "v1" "Secret" (include "sie-cluster.namespace" $) $name }}
{{- $existing := index (.data | default dict) "password" | default "" }}
{{- include "sie-cluster.nats.validateReusedPassword" (dict "name" $name "data" $existing) }}
{{- $password = $existing }}
{{- end }}
---
apiVersion: v1
kind: Secret
metadata:
  name: {{ $name }}
  namespace: {{ include "sie-cluster.namespace" $ }}
  labels:
    {{- include "sie-cluster.labels" $ | nindent 4 }}
    app.kubernetes.io/component: nats-auth
    sie.superlinked.com/nats-user: {{ include "sie-cluster.nats.authUser" $component }}
  annotations:
    helm.sh/resource-policy: keep
type: Opaque
data:
  password: {{ $password | quote }}
{{- end }}
{{- end }}
{{- end }}