mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
fix(chart): shorten names with variables + improved secrets support
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
{{- $backend := .Values.backend }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -9,7 +10,7 @@ metadata:
|
||||
labels:
|
||||
{{- include "infisical.backend.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.backend.replicaCount }}
|
||||
replicas: {{ $backend.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "infisical.backend.matchLabels" . | nindent 6 }}
|
||||
@@ -17,15 +18,15 @@ spec:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "infisical.backend.matchLabels" . | nindent 8 }}
|
||||
{{- with .Values.backend.podAnnotations }}
|
||||
{{- with $backend.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ template "infisical.name" . }}-{{ .Values.backend.name }}
|
||||
image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.backend.image.pullPolicy }}
|
||||
- name: {{ template "infisical.name" . }}-{{ $backend.name }}
|
||||
image: "{{ $backend.image.repository }}:{{ $backend.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ $backend.image.pullPolicy }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /api/status
|
||||
@@ -34,32 +35,24 @@ spec:
|
||||
periodSeconds: 10
|
||||
ports:
|
||||
- containerPort: 4000
|
||||
{{- if .Values.backend.kubeSecretRef }}
|
||||
{{- if $backend.kubeSecretRef }}
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: {{ .Values.backend.kubeSecretRef }}
|
||||
name: {{ $backend.kubeSecretRef }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: MONGO_URL
|
||||
value: {{ include "infisical.mongodb.connectionString" . | quote }}
|
||||
{{- if .Values.backendEnvironmentVariables }}
|
||||
{{- range $key, $value := .Values.backendEnvironmentVariables }}
|
||||
{{- if $value | quote | eq "MUST_REPLACE" }}
|
||||
{{ fail "Environment variables are not set. Please set all environment variables to continue." }}
|
||||
{{ end }}
|
||||
- name: {{ $key }}
|
||||
value: {{ quote $value }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "infisical.backend.fullname" . }}
|
||||
labels:
|
||||
{{- include "infisical.backend.labels" . | nindent 4 }}
|
||||
{{- with .Values.backend.service.annotations }}
|
||||
{{- with $backend.service.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -74,3 +67,15 @@ spec:
|
||||
{{- if eq .Values.backend.service.type "NodePort" }}
|
||||
nodePort: {{ .Values.backend.service.nodePort }}
|
||||
{{- end }}
|
||||
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ $backend.kubeSecretRef | default "infisical-backend" }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{- range $key, $value := $backend.secrets }}
|
||||
{{ $key }}: {{ $value | b64enc }}
|
||||
{{- end }}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{{- $frontend := .Values.frontend }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -9,7 +10,7 @@ metadata:
|
||||
labels:
|
||||
{{- include "infisical.frontend.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.frontend.replicaCount }}
|
||||
replicas: {{ $frontend.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "infisical.frontend.matchLabels" . | nindent 6 }}
|
||||
@@ -17,26 +18,27 @@ spec:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "infisical.frontend.matchLabels" . | nindent 8 }}
|
||||
{{- with .Values.frontend.podAnnotations }}
|
||||
{{- with $frontend.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ template "infisical.name" . }}-{{ .Values.frontend.name }}
|
||||
image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
|
||||
- name: {{ template "infisical.name" . }}-{{ $frontend.name }}
|
||||
image: "{{ $frontend.image.repository }}:{{ $frontend.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ $frontend.image.pullPolicy }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 3000
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
{{- if .Values.frontend.kubeSecretRef }}
|
||||
{{- if $frontend.kubeSecretRef }}
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: {{ .Values.frontend.kubeSecretRef }}
|
||||
name: {{ $frontend.kubeSecretRef }}
|
||||
{{- end }}
|
||||
# Below variables should be defined available through the above secretRef secret
|
||||
{{- if .Values.frontendEnvironmentVariables }}
|
||||
env:
|
||||
{{- range $key, $value := .Values.frontendEnvironmentVariables }}
|
||||
@@ -49,25 +51,39 @@ spec:
|
||||
{{- end }}
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "infisical.frontend.fullname" . }}
|
||||
labels:
|
||||
{{- include "infisical.frontend.labels" . | nindent 4 }}
|
||||
{{- with .Values.frontend.service.annotations }}
|
||||
{{- with $frontend.service.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.frontend.service.type }}
|
||||
type: {{ $frontend.service.type }}
|
||||
selector:
|
||||
{{- include "infisical.frontend.matchLabels" . | nindent 8 }}
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 3000 # service
|
||||
targetPort: 3000 # container port
|
||||
{{- if eq .Values.frontend.service.type "NodePort" }}
|
||||
nodePort: {{ .Values.frontend.service.nodePort }}
|
||||
{{- end }}
|
||||
{{- if eq $frontend.service.type "NodePort" }}
|
||||
nodePort: {{ $frontend.service.nodePort }}
|
||||
{{- end }}
|
||||
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ $frontend.kubeSecretRef | default "infisical-frontend" }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{- range $key, $value := $frontend.secrets }}
|
||||
{{ $key }}: {{ $value | b64enc }}
|
||||
{{- end }}
|
||||
@@ -1,3 +1,4 @@
|
||||
{{- $ctrlManager := .Values.controllerManager }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
@@ -19,7 +20,7 @@ metadata:
|
||||
control-plane: controller-manager
|
||||
{{- include "secrets-operator.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.controllerManager.replicas }}
|
||||
replicas: {{ $ctrlManager.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
control-plane: controller-manager
|
||||
@@ -57,14 +58,14 @@ spec:
|
||||
env:
|
||||
- name: KUBERNETES_CLUSTER_DOMAIN
|
||||
value: {{ .Values.kubernetesClusterDomain }}
|
||||
image: {{ .Values.controllerManager.kubeRbacProxy.image.repository }}:{{ .Values.controllerManager.kubeRbacProxy.image.tag
|
||||
image: {{ $ctrlManager.kubeRbacProxy.image.repository }}:{{ $ctrlManager.kubeRbacProxy.image.tag
|
||||
| default .Chart.AppVersion }}
|
||||
name: kube-rbac-proxy
|
||||
ports:
|
||||
- containerPort: 8443
|
||||
name: https
|
||||
protocol: TCP
|
||||
resources: {{- toYaml .Values.controllerManager.kubeRbacProxy.resources | nindent
|
||||
resources: {{- toYaml $ctrlManager.kubeRbacProxy.resources | nindent
|
||||
10 }}
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
@@ -80,7 +81,7 @@ spec:
|
||||
env:
|
||||
- name: KUBERNETES_CLUSTER_DOMAIN
|
||||
value: {{ .Values.kubernetesClusterDomain }}
|
||||
image: {{ .Values.controllerManager.manager.image.repository }}:{{ .Values.controllerManager.manager.image.tag
|
||||
image: {{ $ctrlManager.manager.image.repository }}:{{ $ctrlManager.manager.image.tag
|
||||
| default .Chart.AppVersion }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
@@ -95,7 +96,7 @@ spec:
|
||||
port: 8081
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
resources: {{- toYaml .Values.controllerManager.manager.resources | nindent 10
|
||||
resources: {{- toYaml $ctrlManager.manager.resources | nindent 10
|
||||
}}
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
|
||||
Reference in New Issue
Block a user