From 7a6d1f40978a60e77607a238d454ab1b3c6ce001 Mon Sep 17 00:00:00 2001 From: Matteo Palladino Date: Wed, 1 Apr 2020 19:00:11 +0200 Subject: [PATCH] Create Secret chart with sample values.yaml --- charts/secrets/.helmignore | 23 +++++++++++++++++++++++ charts/secrets/Chart.yaml | 21 +++++++++++++++++++++ charts/secrets/secrets.yaml | 11 +++++++++++ charts/secrets/templates/secrets.yaml | 14 ++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 charts/secrets/.helmignore create mode 100644 charts/secrets/Chart.yaml create mode 100644 charts/secrets/secrets.yaml create mode 100644 charts/secrets/templates/secrets.yaml diff --git a/charts/secrets/.helmignore b/charts/secrets/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/secrets/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/secrets/Chart.yaml b/charts/secrets/Chart.yaml new file mode 100644 index 00000000..43187302 --- /dev/null +++ b/charts/secrets/Chart.yaml @@ -0,0 +1,21 @@ +apiVersion: v2 +name: secrets +description: Chart for templating secrets + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +appVersion: 1.16.0 diff --git a/charts/secrets/secrets.yaml b/charts/secrets/secrets.yaml new file mode 100644 index 00000000..e8247587 --- /dev/null +++ b/charts/secrets/secrets.yaml @@ -0,0 +1,11 @@ +secrets: + - name: mongodb + namespace: default + secrets: + MONGO_USER: test + MONGO_PASSWORD: letmein + - name: postgresql + namespace: default + secrets: + POSTGRES_ROOT_PASSWORD: letmein + POSTGRES_ROOT_USERNAME: test \ No newline at end of file diff --git a/charts/secrets/templates/secrets.yaml b/charts/secrets/templates/secrets.yaml new file mode 100644 index 00000000..e4d4096f --- /dev/null +++ b/charts/secrets/templates/secrets.yaml @@ -0,0 +1,14 @@ +{{- range .Values.secrets -}} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ .name }} + namespace: {{ .namespace }} +data: +{{- range $key, $val := .secrets }} + {{$key}}: {{$val|b32enc}} +{{ end -}} +type: Opaque +{{ end }} +