-
Notifications
You must be signed in to change notification settings - Fork 988
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #183 from jon4hz/helm
Helm updates
- Loading branch information
Showing
7 changed files
with
233 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
{{/* | ||
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.backend.labels" -}} | ||
{{ include "infisical.backend.matchLabels" . }} | ||
{{ include "infisical.common.metaLabels" . }} | ||
{{- end -}} | ||
|
||
{{- define "infisical.backend.matchLabels" -}} | ||
component: {{ .Values.backend.name | quote }} | ||
{{ include "infisical.common.matchLabels" . }} | ||
{{- end -}} | ||
|
||
{{- define "infisical.frontend.labels" -}} | ||
{{ include "infisical.frontend.matchLabels" . }} | ||
{{ include "infisical.common.metaLabels" . }} | ||
{{- end -}} | ||
|
||
{{- define "infisical.frontend.matchLabels" -}} | ||
component: {{ .Values.frontend.name | quote }} | ||
{{ include "infisical.common.matchLabels" . }} | ||
{{- end -}} | ||
|
||
{{- define "infisical.mongodb.labels" -}} | ||
{{ include "infisical.mongodb.matchLabels" . }} | ||
{{ include "infisical.common.metaLabels" . }} | ||
{{- end -}} | ||
|
||
{{- define "infisical.mongodb.matchLabels" -}} | ||
component: {{ .Values.mongodb.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.backend.fullname" -}} | ||
{{- if .Values.backend.fullnameOverride -}} | ||
{{- .Values.backend.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- printf "%s-%s" .Release.Name .Values.backend.name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s-%s" .Release.Name $name .Values.backend.name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a fully qualified frontend name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "infisical.frontend.fullname" -}} | ||
{{- if .Values.frontend.fullnameOverride -}} | ||
{{- .Values.frontend.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- printf "%s-%s" .Release.Name .Values.frontend.name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s-%s" .Release.Name $name .Values.frontend.name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a fully qualified mongodb name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "infisical.mongodb.fullname" -}} | ||
{{- if .Values.mongodb.fullnameOverride -}} | ||
{{- .Values.mongodb.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- printf "%s-%s" .Release.Name .Values.mongodb.name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s-%s" .Release.Name $name .Values.mongodb.name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create the mongodb connection string. | ||
*/}} | ||
{{- define "infisical.mongodb.connectionString" -}} | ||
{{- $host := include "infisical.mongodb.fullname" . -}} | ||
{{- $port := 27017 -}} | ||
{{- $user := "root" -}} | ||
{{- $pass := "root" -}} | ||
{{- $connectionString := printf "mongodb://%s:%s@%s:%d/" $user $pass $host $port -}} | ||
{{- if .Values.mongodbConnection.standardConnectionStringFormat -}} | ||
{{- $connectionString = .Values.mongodbConnection.standardConnectionStringFormat -}} | ||
{{- end -}} | ||
{{- if .Values.mongodbConnection.dnsSeedListConnectionFormat -}} | ||
{{- $connectionString = .Values.mongodbConnection.dnsSeedListConnectionFormat -}} | ||
{{- end -}} | ||
{{- printf "%s" $connectionString -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.