From b5373ccd964827e955ae41eca3ba9383004ae579 Mon Sep 17 00:00:00 2001 From: David Rochow Date: Thu, 21 Nov 2024 10:11:58 +0100 Subject: [PATCH] ci: keppel deployment preperation (#400) * ci: prepare deployment * Automatic application of license header --------- Co-authored-by: License Bot --- .../keppel-scanner/templates/_helpers.tpl | 13 +-------- .../templates/config/_scanner_config.yaml.tpl | 2 -- .../keppel-scanner/templates/configmap.yaml | 10 ------- .../keppel-scanner/templates/cronjob.yaml | 18 +++++++++++++ .../keppel-scanner/templates/secrets.yaml | 4 ++- .../templates/serviceaccount.yaml | 16 ----------- .../keppel/chart/keppel-scanner/values.yaml | 27 ++++++++----------- 7 files changed, 33 insertions(+), 57 deletions(-) delete mode 100644 scanner/keppel/chart/keppel-scanner/templates/config/_scanner_config.yaml.tpl delete mode 100644 scanner/keppel/chart/keppel-scanner/templates/configmap.yaml delete mode 100644 scanner/keppel/chart/keppel-scanner/templates/serviceaccount.yaml diff --git a/scanner/keppel/chart/keppel-scanner/templates/_helpers.tpl b/scanner/keppel/chart/keppel-scanner/templates/_helpers.tpl index 7a240c9d..fd51b97c 100644 --- a/scanner/keppel/chart/keppel-scanner/templates/_helpers.tpl +++ b/scanner/keppel/chart/keppel-scanner/templates/_helpers.tpl @@ -48,15 +48,4 @@ Selector labels {{- define "keppel-scanner.selectorLabels" -}} app.kubernetes.io/name: {{ include "keppel-scanner.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "keppel-scanner.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "keppel-scanner.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} +{{- end }} \ No newline at end of file diff --git a/scanner/keppel/chart/keppel-scanner/templates/config/_scanner_config.yaml.tpl b/scanner/keppel/chart/keppel-scanner/templates/config/_scanner_config.yaml.tpl deleted file mode 100644 index 54049517..00000000 --- a/scanner/keppel/chart/keppel-scanner/templates/config/_scanner_config.yaml.tpl +++ /dev/null @@ -1,2 +0,0 @@ -config: - some_key: some_value \ No newline at end of file diff --git a/scanner/keppel/chart/keppel-scanner/templates/configmap.yaml b/scanner/keppel/chart/keppel-scanner/templates/configmap.yaml deleted file mode 100644 index 27f9d2f9..00000000 --- a/scanner/keppel/chart/keppel-scanner/templates/configmap.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Release.Name }}-configmap -data: - config.yaml: | -{{ include (print .Template.BasePath "/config/_scanner_config.yaml.tpl") . | indent 4 }} diff --git a/scanner/keppel/chart/keppel-scanner/templates/cronjob.yaml b/scanner/keppel/chart/keppel-scanner/templates/cronjob.yaml index dbd2a00f..e56b02bc 100644 --- a/scanner/keppel/chart/keppel-scanner/templates/cronjob.yaml +++ b/scanner/keppel/chart/keppel-scanner/templates/cronjob.yaml @@ -24,6 +24,24 @@ spec: mountPath: "{{ .Values.scanner.config_mount_path }}" readOnly: true env: + - name: KEPPEL_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-secret + key: keppel_password + - name: KEPPEL_USERNAME + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-secret + key: keppel_username + - name: KEPPEL_FQDN + value: {{ .Values.scanner.keppel.fqdn }} + - name: IDENTITY_ENDPOINT + value: {{ .Values.scanner.identity_endpoint }} + - name: KEPPEL_DOMAIN + value: {{ .Values.scanner.keppel.domain }} + - name: KEPPEL_PROJECT + value: {{ .Values.scanner.keppel.project }} - name: HEUREKA_API_TOKEN valueFrom: secretKeyRef: diff --git a/scanner/keppel/chart/keppel-scanner/templates/secrets.yaml b/scanner/keppel/chart/keppel-scanner/templates/secrets.yaml index 683efe59..a23055a8 100644 --- a/scanner/keppel/chart/keppel-scanner/templates/secrets.yaml +++ b/scanner/keppel/chart/keppel-scanner/templates/secrets.yaml @@ -7,4 +7,6 @@ metadata: name: {{ .Release.Name }}-secret type: Opaque data: - api_token: {{ .Values.scanner.api_token | b64enc }} \ No newline at end of file + api_token: {{ .Values.scanner.heureka.api_token | b64enc }} + keppel_username: {{ .Values.scanner.keppel.username | b64enc }} + keppel_password: {{ .Values.scanner.keppel.password | b64enc }} \ No newline at end of file diff --git a/scanner/keppel/chart/keppel-scanner/templates/serviceaccount.yaml b/scanner/keppel/chart/keppel-scanner/templates/serviceaccount.yaml deleted file mode 100644 index ce57a7c7..00000000 --- a/scanner/keppel/chart/keppel-scanner/templates/serviceaccount.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -# SPDX-License-Identifier: Apache-2.0 - -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "keppel-scanner.serviceAccountName" . }} - labels: - {{- include "keppel-scanner.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -automountServiceAccountToken: {{ .Values.serviceAccount.automount }} -{{- end }} diff --git a/scanner/keppel/chart/keppel-scanner/values.yaml b/scanner/keppel/chart/keppel-scanner/values.yaml index 53095b6c..71da78d4 100644 --- a/scanner/keppel/chart/keppel-scanner/values.yaml +++ b/scanner/keppel/chart/keppel-scanner/values.yaml @@ -4,26 +4,21 @@ # Default values for keppel-scanner. # This is a YAML-formatted file. # Declare variables to be passed into your templates. - scanner: - api_token: "my_token" - heureka_url: "api.heureka.greenhouse-qa.eu-nl-1.cloud.sap" - config_mount_path: "/etc/heureka/config/keppel-scanner" + api_token: "" + heureka_url: "" schedule: "0 * * * *" + keppel: + username: "" + password: "" + fqdn: "" + domain: "" + project: "" + identity_endpoint: "" + image: repository: ghcr.io/cloudoperators/heureka-scanner-keppel pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. - tag: "main" - -serviceAccount: - # Specifies whether a service account should be created - create: false - # Automatically mount a ServiceAccount's API credentials? - automount: true - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" + tag: "" \ No newline at end of file