From d8a86edcec3e5d6263efc88aa8533210269b55ce Mon Sep 17 00:00:00 2001 From: Adriano Pezzuto <2222461+bsctl@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:24:56 +0200 Subject: [PATCH] feat(helm): add default datastore name in the helm chart (#536) --- charts/kamaji/Chart.lock | 4 ++-- charts/kamaji/Chart.yaml | 2 +- charts/kamaji/README.md | 10 +++++----- charts/kamaji/templates/controller.yaml | 7 ++----- charts/kamaji/values.yaml | 16 +++++++--------- docs/content/guides/alternative-datastore.md | 2 +- 6 files changed, 18 insertions(+), 23 deletions(-) diff --git a/charts/kamaji/Chart.lock b/charts/kamaji/Chart.lock index f60ef4f..158db84 100644 --- a/charts/kamaji/Chart.lock +++ b/charts/kamaji/Chart.lock @@ -2,5 +2,5 @@ dependencies: - name: kamaji-etcd repository: https://clastix.github.io/charts version: 0.7.0 -digest: sha256:f04e6647b87e590b69b986df93d7060f866670d83ff2988fcdb896f440d1ab72 -generated: "2024-08-10T18:12:21.800380631+02:00" +digest: sha256:2e23a11b06da2aa3a935a56a93d56876c6c8ef0a7800ee44070f9a269dfbca71 +generated: "2024-08-10T23:03:35.382486587+02:00" diff --git a/charts/kamaji/Chart.yaml b/charts/kamaji/Chart.yaml index e93e585..5519b8f 100644 --- a/charts/kamaji/Chart.yaml +++ b/charts/kamaji/Chart.yaml @@ -21,7 +21,7 @@ version: 2.0.0 dependencies: - name: kamaji-etcd repository: https://clastix.github.io/charts - version: 0.7.0 + version: ">=0.7.0" condition: kamaji-etcd.deploy annotations: catalog.cattle.io/certified: partner diff --git a/charts/kamaji/README.md b/charts/kamaji/README.md index d8d1fa1..a98bb0e 100644 --- a/charts/kamaji/README.md +++ b/charts/kamaji/README.md @@ -22,7 +22,7 @@ Kubernetes: `>=1.21.0-0` | Repository | Name | Version | |------------|------|---------| -| https://clastix.github.io/charts | kamaji-etcd | 0.7.0 | +| https://clastix.github.io/charts | kamaji-etcd | >=0.7.0 | [Kamaji](https://github.com/clastix/kamaji) requires a [multi-tenant `etcd`](https://github.com/clastix/kamaji-internal/blob/master/deploy/getting-started-with-kamaji.md#setup-internal-multi-tenant-etcd) cluster. This Helm Chart starting from v0.1.1 provides the installation of an internal `etcd` in order to streamline the local test. If you'd like to use an externally managed etcd instance, you can specify the overrides and by setting the value `etcd.deploy=false`. @@ -70,8 +70,7 @@ Here the values you can override: | Key | Type | Default | Description | |-----|------|---------|-------------| | affinity | object | `{}` | Kubernetes affinity rules to apply to Kamaji controller pods | -| etcd.datastoreName | string | `"kamaji-etcd"` | (string) If the creation of an etcd instance is disabled, specify the default DataStore name for the Kamaji instance. | -| etcd.deploy | bool | `true` | (bool) Enable the creation of a local etcd instance as a default Datastore using the kamaji-etcd chart by CLASTIX. (default=true) | +| defaultDatastoreName | string | `"default"` | Specify the default DataStore name for the Kamaji instance. | | extraArgs | list | `[]` | A list of extra arguments to add to the kamaji controller default ones | | fullnameOverride | string | `""` | | | healthProbeBindAddress | string | `":8081"` | The address the probe endpoint binds to. (default ":8081") | @@ -81,10 +80,11 @@ Here the values you can override: | imagePullSecrets | list | `[]` | | | kamaji-etcd.datastore.enabled | bool | `true` | | | kamaji-etcd.datastore.name | string | `"default"` | | +| kamaji-etcd.deploy | bool | `true` | | | kamaji-etcd.fullnameOverride | string | `"kamaji-etcd"` | | | livenessProbe | object | `{"httpGet":{"path":"/healthz","port":"healthcheck"},"initialDelaySeconds":15,"periodSeconds":20}` | The livenessProbe for the controller container | -| loggingDevel.enable | bool | `false` | (string) Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) (default false) | -| metricsBindAddress | string | `":8080"` | (string) The address the metric endpoint binds to. (default ":8080") | +| loggingDevel.enable | bool | `false` | Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) (default false) | +| metricsBindAddress | string | `":8080"` | The address the metric endpoint binds to. (default ":8080") | | nameOverride | string | `""` | | | nodeSelector | object | `{}` | Kubernetes node selector rules to schedule Kamaji controller | | podAnnotations | object | `{}` | The annotations to apply to the Kamaji controller pods. | diff --git a/charts/kamaji/templates/controller.yaml b/charts/kamaji/templates/controller.yaml index 6b77801..e16f641 100644 --- a/charts/kamaji/templates/controller.yaml +++ b/charts/kamaji/templates/controller.yaml @@ -33,11 +33,8 @@ spec: - --leader-elect - --metrics-bind-address={{ .Values.metricsBindAddress }} - --tmp-directory={{ .Values.temporaryDirectoryPath }} - {{- if .Values.etcd.deploy }} - - --datastore={{ (index .Values "kamaji-etcd" "datastore").name }} - {{- else }} - - --datastore={{ required ".Values.etcd.datastoreName is required when etcd sub-chart is enabled!" .Values.etcd.datastoreName }} - {{- end }} + {{- $datastoreName := .Values.defaultDatastoreName | required ".Values.defaultDatastoreName is required!" }} + - --datastore={{ $datastoreName }} {{- if .Values.telemetry.disabled }} - --disable-telemetry {{- end }} diff --git a/charts/kamaji/values.yaml b/charts/kamaji/values.yaml index cf36946..21b529e 100644 --- a/charts/kamaji/values.yaml +++ b/charts/kamaji/values.yaml @@ -38,7 +38,7 @@ readinessProbe: initialDelaySeconds: 5 periodSeconds: 10 -# -- (string) The address the metric endpoint binds to. (default ":8080") +# -- The address the metric endpoint binds to. (default ":8080") metricsBindAddress: ":8080" imagePullSecrets: [] @@ -92,22 +92,20 @@ affinity: {} temporaryDirectoryPath: "/tmp/kamaji" loggingDevel: - # -- (string) Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) (default false) + # -- Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) (default false) enable: false -etcd: - # -- (bool) Enable the creation of a local etcd instance as a default Datastore using the kamaji-etcd chart by CLASTIX. (default=true) - deploy: true - # -- (string) If the creation of an etcd instance is disabled, specify the default DataStore name for the Kamaji instance. - datastoreName: kamaji-etcd +# -- Specify the default DataStore name for the Kamaji instance. +defaultDatastoreName: default kamaji-etcd: + deploy: true fullnameOverride: kamaji-etcd datastore: enabled: true - name: "default" + name: default # -- Disable the analytics traces collection telemetry: - disabled: false + disabled: false \ No newline at end of file diff --git a/docs/content/guides/alternative-datastore.md b/docs/content/guides/alternative-datastore.md index 928d091..cdda878 100644 --- a/docs/content/guides/alternative-datastore.md +++ b/docs/content/guides/alternative-datastore.md @@ -26,7 +26,7 @@ For example, with a PostgreSQL datastore installed: ```bash helm install kamaji charts/kamaji -n kamaji-system --create-namespace \ - --set etcd.deploy=false \ + --set kamaji-etcd.deploy=false \ --set datastore.driver=PostgreSQL \ --set datastore.endpoints[0]=postgres-default-rw.kamaji-system.svc:5432 \ --set datastore.basicAuth.usernameSecret.name=postgres-default-superuser \