-
Notifications
You must be signed in to change notification settings - Fork 43
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 #226 from devtron-labs/helm-tls-certs
feat: Added helm-tls-certs
- Loading branch information
Showing
4 changed files
with
42 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v2 | ||
name: helm-tls-certs | ||
description: A Helm chart for generating TLS secrets | ||
type: application | ||
version: 0.1.0 | ||
appVersion: 0.1.0 |
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,10 @@ | ||
{{/* | ||
Generate a certificate pair | ||
*/}} | ||
{{- define "devtron.gen-certs" -}} | ||
{{- $ca := genCA "devtron-ca" (int .Values.certDays) -}} | ||
{{- $cn := .Values.commonName | default (printf "%s.%s" .Release.Name .Release.Namespace) -}} | ||
{{- $cert := genSignedCert $cn nil nil (int .Values.certDays) $ca -}} | ||
tls.crt: {{ $cert.Cert | b64enc }} | ||
tls.key: {{ $cert.Key | b64enc }} | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
type: kubernetes.io/tls | ||
metadata: | ||
name: {{ .Values.secretName }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
app.kubernetes.io/name: {{ .Release.Name }} | ||
helm.sh/chart: {{ .Chart.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion }} | ||
annotations: | ||
"helm.sh/hook": "pre-install" | ||
"helm.sh/hook-delete-policy": "before-hook-creation" | ||
data: | ||
{{ (include "devtron.gen-certs" . ) | indent 2 }} |
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,9 @@ | ||
# Name of the secret to be created | ||
secretName: tls-secret | ||
|
||
# Number of days for the certificate validity | ||
certDays: 2555 | ||
|
||
# Common Name for the certificate (optional) | ||
# If not set, it will use <release-name>.<release-namespace> | ||
commonName: "" |