From 2cc2e0582158ce3bf076719f7c9cb78d90c75b27 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Sun, 20 Aug 2023 19:46:33 +0200 Subject: [PATCH] Added zookeeper chart --- .gitignore | 3 +++ README.md | 27 +++++++++++++++++++++++++-- helm/zookeeper/.helmignore | 27 +++++++++++++++++++++++++++ helm/zookeeper/Chart.lock | 6 ++++++ helm/zookeeper/Chart.yaml | 12 ++++++++++++ helm/zookeeper/default_values.yaml | 1 + helm/zookeeper/overwrite_values.yaml | 18 ++++++++++++++++++ helm/zookeeper/templates | 1 + 8 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 helm/zookeeper/.helmignore create mode 100644 helm/zookeeper/Chart.lock create mode 100644 helm/zookeeper/Chart.yaml create mode 120000 helm/zookeeper/default_values.yaml create mode 100644 helm/zookeeper/overwrite_values.yaml create mode 120000 helm/zookeeper/templates diff --git a/.gitignore b/.gitignore index 4e8be69..8fecb7c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ *.retry **/private.yaml vault_password +# Helm Charts +values.yaml +charts/ diff --git a/README.md b/README.md index 83f3b91..64e37d4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,26 @@ -# Ansible set up playbooks +# Cloud configuration -Contains ansible playbooks and step-by-step instructions for cloud setup. \ No newline at end of file +Contains ansible playbooks, step-by-step instructions for cloud setup, +and helm charts. + +## Helm charts + +The helm charts use symlinks to utilise a central collection of templates +that is used for every chart. The values.yaml is symlinked into the +directory of each chart as default_values.yaml. Each chart has +an overwrite_values.yaml file which specifies the values for that +particular chart and overwrites the values from default_values.yaml. + +Before the chart can be installed locally for testing or is built +for publishing, the actual values.yaml for Helm needs to be created +(paths are specified from root of repository): + +```shell +cd helm/chart/ +yq '. *= load("overwrite_values.yaml")' default_values.yaml > values.yaml +``` + +Furthermore, each chart has an environments directory which contains +a values file with the name of the environment (e.g. production.yaml). +These values are not bundled into the chart on construction but rather +supplied when installing the chart. diff --git a/helm/zookeeper/.helmignore b/helm/zookeeper/.helmignore new file mode 100644 index 0000000..8bd27ef --- /dev/null +++ b/helm/zookeeper/.helmignore @@ -0,0 +1,27 @@ +# 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/ +# environment values +environments/ +default_values.yaml +overwrite_values.yaml diff --git a/helm/zookeeper/Chart.lock b/helm/zookeeper/Chart.lock new file mode 100644 index 0000000..3752f9e --- /dev/null +++ b/helm/zookeeper/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: template + repository: file://../template + version: 0.1.4 +digest: sha256:279dbe36571da1eee759185be5f2993c19ec9288c8b00ff6ab5ca75316888584 +generated: "2023-08-20T19:41:30.542963+02:00" diff --git a/helm/zookeeper/Chart.yaml b/helm/zookeeper/Chart.yaml new file mode 100644 index 0000000..b1c740f --- /dev/null +++ b/helm/zookeeper/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +name: zookeeper +version: 0.1.2 +type: application +description: Simple Zookeeper chart to get started +maintainers: + - name: Jim Martens + url: https://2martens.de +dependencies: + - name: template + version: 0.1.4 + repository: file://../template diff --git a/helm/zookeeper/default_values.yaml b/helm/zookeeper/default_values.yaml new file mode 120000 index 0000000..00d0a7d --- /dev/null +++ b/helm/zookeeper/default_values.yaml @@ -0,0 +1 @@ +../template/_values.yaml \ No newline at end of file diff --git a/helm/zookeeper/overwrite_values.yaml b/helm/zookeeper/overwrite_values.yaml new file mode 100644 index 0000000..ebd63aa --- /dev/null +++ b/helm/zookeeper/overwrite_values.yaml @@ -0,0 +1,18 @@ +image: + repository: confluentinc/cp-zookeeper + tag: latest +application: + port: 2181 + isSpring: false + tickTime: 2000 +service: + port: 2181 +livenessProbe: + enabled: false +readinessProbe: + enabled: false +environment: + - name: ZOOKEEPER_CLIENT_PORT + value: "{{ .Values.application.port }}" + - name: ZOOKEEPER_TICK_TIME + value: "{{ .Values.application.tickTime }}" diff --git a/helm/zookeeper/templates b/helm/zookeeper/templates new file mode 120000 index 0000000..baefb49 --- /dev/null +++ b/helm/zookeeper/templates @@ -0,0 +1 @@ +../template/_templates \ No newline at end of file