add postgres helm chart

This commit is contained in:
Maidul Islam
2024-01-27 12:40:37 +05:30
committed by Akhil Mohan
parent fb271726fe
commit 07679d9318
9 changed files with 376 additions and 0 deletions
@@ -0,0 +1,42 @@
##
-- Infisical Helm Chart --
██╗███╗ ██╗███████╗██╗███████╗██╗ ██████╗ █████╗ ██╗
██║████╗ ██║██╔════╝██║██╔════╝██║██╔════╝██╔══██╗██║
██║██╔██╗ ██║█████╗ ██║███████╗██║██║ ███████║██║
██║██║╚██╗██║██╔══╝ ██║╚════██║██║██║ ██╔══██║██║
██║██║ ╚████║██║ ██║███████║██║╚██████╗██║ ██║███████╗
╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝
{{ .Chart.Name }} ({{ .Chart.Version }})
╭―― Thank you for installing Infisical! 👋 ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――┤
│
│ Infisical / All-in-one open-source SecretOps solution to manage your secrets across your infra! 🔒🔑
│
│ Visit < https://infisical.com/docs/self-hosting/overview > for further documentation about self-hosting!
│
│ Current installation (infisical) :
│ • infisical : {{ .Values.infisical.enabled }}
| • nginx : {{ .Values.ingress.nginx.enabled }}
│
╰―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――┤
――― Here's a list of helpful commands to get you started 📝 ―――――――――――――――――――――――――――――――――――――――――┤
→ Get all the Infisical resources (excluding secrets/pvcs)
$ kubectl get all -n {{ .Release.Namespace }}
→ Get your release status
$ helm status -n {{ .Release.Namespace }} {{ .Release.Name }}
→ Get your release resources
$ helm get all -n {{ .Release.Namespace }} {{ .Release.Name }}
→ Uninstall your release
$ helm uninstall -n {{ .Release.Namespace }} {{ .Release.Name }}
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――┤
##
@@ -0,0 +1,59 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "infisical.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "infisical.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create unified labels for infisical components
*/}}
{{- define "infisical.common.matchLabels" -}}
app: {{ template "infisical.name" . }}
release: {{ .Release.Name }}
{{- end -}}
{{- define "infisical.common.metaLabels" -}}
chart: {{ template "infisical.chart" . }}
heritage: {{ .Release.Service }}
{{- end -}}
{{- define "infisical.common.labels" -}}
{{ include "infisical.common.matchLabels" . }}
{{ include "infisical.common.metaLabels" . }}
{{- end -}}
{{- define "infisical.labels" -}}
{{ include "infisical.matchLabels" . }}
{{ include "infisical.common.metaLabels" . }}
{{- end -}}
{{- define "infisical.matchLabels" -}}
component: {{ .Values.infisical.name | quote }}
{{ include "infisical.common.matchLabels" . }}
{{- end -}}
{{/*
Create a fully qualified backend name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "infisical.fullname" -}}
{{- if .Values.infisical.fullnameOverride -}}
{{- .Values.infisical.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- printf "%s-%s" .Release.Name .Values.infisical.name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.infisical.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
@@ -0,0 +1,72 @@
{{- $infisicalValues := .Values.infisical }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "infisical.fullname" . }}
annotations:
updatedAt: {{ now | date "2006-01-01 MST 15:04:05" | quote }}
{{- with $infisicalValues.deploymentAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "infisical.labels" . | nindent 4 }}
spec:
replicas: {{ $infisicalValues.replicaCount }}
selector:
matchLabels:
{{- include "infisical.matchLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "infisical.matchLabels" . | nindent 8 }}
annotations:
updatedAt: {{ now | date "2006-01-01 MST 15:04:05" | quote }}
{{- with $infisicalValues.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with $infisicalValues.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ template "infisical.name" . }}-{{ $infisicalValues.name }}
image: "{{ $infisicalValues.image.repository }}:{{ $infisicalValues.image.tag | default "latest" }}"
imagePullPolicy: {{ $infisicalValues.image.pullPolicy }}
readinessProbe:
httpGet:
path: /api/status
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
ports:
- containerPort: 8080
envFrom:
- secretRef:
name: {{ $infisicalValues.kubeSecretRef | default (include "infisical.fullname" .) }}
{{- if $infisicalValues.resources }}
resources: {{- toYaml $infisicalValues.resources | nindent 12 }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "infisical.fullname" . }}
labels:
{{- include "infisical.labels" . | nindent 4 }}
{{- with $infisicalValues.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ $infisicalValues.service.type }}
selector:
{{- include "infisical.matchLabels" . | nindent 8 }}
ports:
- protocol: TCP
port: 8080
targetPort: 8080 # container port
{{- if eq $infisicalValues.service.type "NodePort" }}
nodePort: {{ $infisicalValues.service.nodePort }}
{{- end }}
@@ -0,0 +1,50 @@
{{ if .Values.ingress.enabled }}
{{- $ingress := .Values.ingress }}
{{- if and $ingress.ingressClassName (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey $ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set $ingress.annotations "kubernetes.io/ingress.class" $ingress.ingressClassName}}
{{- end }}
{{- end }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: infisical-ingress
{{- with $ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and $ingress.ingressClassName (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ $ingress.ingressClassName | default "nginx" }}
{{- end }}
{{- if $ingress.tls }}
tls:
{{- range $ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ include "infisical.fullname" . }}
port:
number: 8080
- path: /ss-webhook
pathType: Exact
backend:
service:
name: {{ include "infisical.fullname" . }}
port:
number: 8080
{{- if $ingress.hostName }}
host: {{ $ingress.hostName }}
{{- end }}
{{ end }}