From d4397dd9f014ace64a4cace0846ef1a560e49727 Mon Sep 17 00:00:00 2001 From: Frederic Leger Date: Tue, 2 Apr 2024 16:56:57 +0200 Subject: [PATCH] fix(helm): multiples fixes in deployment mode --- helm/chart/.gitignore | 1 + helm/chart/.helmignore | 1 + helm/chart/Chart.yaml | 2 +- helm/chart/ci/autoscaling-values.yaml | 8 ++++++++ helm/chart/ci/deployment-values.yaml | 2 ++ helm/chart/templates/configmap.yaml | 2 ++ helm/chart/templates/deployment.yaml | 8 ++++---- helm/chart/templates/secret.yaml | 4 ++-- helm/chart/values.yaml | 8 +++++--- 9 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 helm/chart/.gitignore create mode 100644 helm/chart/ci/autoscaling-values.yaml create mode 100644 helm/chart/ci/deployment-values.yaml diff --git a/helm/chart/.gitignore b/helm/chart/.gitignore new file mode 100644 index 0000000..a921f60 --- /dev/null +++ b/helm/chart/.gitignore @@ -0,0 +1 @@ +*-local-values.yaml diff --git a/helm/chart/.helmignore b/helm/chart/.helmignore index 0e8a0eb..58ab341 100644 --- a/helm/chart/.helmignore +++ b/helm/chart/.helmignore @@ -21,3 +21,4 @@ .idea/ *.tmproj .vscode/ +*-local-values.yaml diff --git a/helm/chart/Chart.yaml b/helm/chart/Chart.yaml index 1296dfa..e5a09a3 100644 --- a/helm/chart/Chart.yaml +++ b/helm/chart/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -name: chart +name: ovh-snapshoter description: A Helm chart for ovh-snapshoter # A chart can be either an 'application' or a 'library' chart. diff --git a/helm/chart/ci/autoscaling-values.yaml b/helm/chart/ci/autoscaling-values.yaml new file mode 100644 index 0000000..a50179a --- /dev/null +++ b/helm/chart/ci/autoscaling-values.yaml @@ -0,0 +1,8 @@ +deployment: + enabled: true +autoscaling: + enabled: true + minReplicas: 1 + maxReplicas: 3 + targetCPUUtilizationPercentage: 50 + targetMemoryUtilizationPercentage: 50 diff --git a/helm/chart/ci/deployment-values.yaml b/helm/chart/ci/deployment-values.yaml new file mode 100644 index 0000000..4eb784e --- /dev/null +++ b/helm/chart/ci/deployment-values.yaml @@ -0,0 +1,2 @@ +deployment: + enabled: true diff --git a/helm/chart/templates/configmap.yaml b/helm/chart/templates/configmap.yaml index 9f87e69..927b7c1 100644 --- a/helm/chart/templates/configmap.yaml +++ b/helm/chart/templates/configmap.yaml @@ -4,6 +4,8 @@ metadata: name: {{ include "chart.fullname" . }} data: {{- with .Values.config }} + CLEANUP: {{ .cleanup | default "false" | quote }} + DRY_RUN: {{ .dryRun | default "false" | quote }} OS_AUTH_URL: {{ .osAuthUrl | quote }} OS_IDENTITY_API_VERSION: {{ .osIdentityApiVersion | quote }} OS_PROJECT_DOMAIN_NAME: {{ .osProjectDomainName | quote }} diff --git a/helm/chart/templates/deployment.yaml b/helm/chart/templates/deployment.yaml index 11c596c..0d67bdb 100644 --- a/helm/chart/templates/deployment.yaml +++ b/helm/chart/templates/deployment.yaml @@ -35,10 +35,10 @@ spec: image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} envFrom: - configMapRef: - name: {{ include "chart.fullname" . }} - secretRef: - name: {{ include "chart.fullname" . }} + - configMapRef: + name: {{ include "chart.fullname" . }} + - secretRef: + name: {{ include "chart.fullname" . }} command: - tail - -f diff --git a/helm/chart/templates/secret.yaml b/helm/chart/templates/secret.yaml index ba5e143..c2cc0ad 100644 --- a/helm/chart/templates/secret.yaml +++ b/helm/chart/templates/secret.yaml @@ -4,5 +4,5 @@ metadata: name: {{ include "chart.fullname" . }} type: Opaque data: - OS_PASSWORD: {{ .Values.osPassword | default "password" | b64enc }} - OS_USERNAME: {{ .Values.osUsername | default "user" | b64enc }} + OS_PASSWORD: {{ .Values.config.osPassword | default "password" | b64enc }} + OS_USERNAME: {{ .Values.config.osUsername | default "user" | b64enc }} diff --git a/helm/chart/values.yaml b/helm/chart/values.yaml index b5c8615..1742a2b 100644 --- a/helm/chart/values.yaml +++ b/helm/chart/values.yaml @@ -6,7 +6,7 @@ replicaCount: 1 image: registry: harbor.hoverkraft.cloud - repository: ovh-snapshoter + repository: ovh-snapshoter/app pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" @@ -16,6 +16,8 @@ nameOverride: "" fullnameOverride: "" config: + cleanup: "true" + dryRun: "false" osAuthUrl: https://auth.cloud.ovh.net/v3 osIdentityApiVersion: 3 osPassword: "" @@ -93,8 +95,8 @@ resources: {} # cpu: 100m # memory: 128Mi -# autoscaling: -# enabled: false +autoscaling: + enabled: false # minReplicas: 1 # maxReplicas: 100 # targetCPUUtilizationPercentage: 80