From da07378ac6ece479907b478544c483e4c0d12114 Mon Sep 17 00:00:00 2001 From: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com> Date: Wed, 20 Nov 2024 13:52:05 +0900 Subject: [PATCH 1/2] [scalardl-auditor] Support Azure Marketplace --- charts/scalardl-audit/README.md | 4 ++ .../templates/auditor/deployment.yaml | 7 +++ charts/scalardl-audit/values.schema.json | 46 +++++++++++++++++++ charts/scalardl-audit/values.yaml | 17 +++++++ 4 files changed, 74 insertions(+) diff --git a/charts/scalardl-audit/README.md b/charts/scalardl-audit/README.md index 36c0585b..75c2c7e8 100644 --- a/charts/scalardl-audit/README.md +++ b/charts/scalardl-audit/README.md @@ -97,4 +97,8 @@ Current chart version is `3.0.0-SNAPSHOT` | envoy.service.ports.envoy.targetPort | int | `40051` | envoy k8s internal name | | envoy.service.type | string | `"ClusterIP"` | service types in kubernetes | | fullnameOverride | string | `""` | String to fully override scalardl-audit.fullname template | +| global.azure | object | `{"images":{"envoy":{"image":"scalar-envoy","registry":"scalar.azurecr.io","tag":"2.0.0-SNAPSHOT"},"scalardbCluster":{"image":"scalardl-auditor-azure-payg","registry":"scalar.azurecr.io","tag":"4.0.0-SNAPSHOT"}}}` | Azure Marketplace specific configurations. | +| global.azure.images.envoy | object | `{"image":"scalar-envoy","registry":"scalar.azurecr.io","tag":"2.0.0-SNAPSHOT"}` | Container image of Envoy for Azure Marketplace. | +| global.azure.images.scalardbCluster | object | `{"image":"scalardl-auditor-azure-payg","registry":"scalar.azurecr.io","tag":"4.0.0-SNAPSHOT"}` | Container image of ScalarDL Auditor for Azure Marketplace. | +| global.platform | string | `""` | Specify the platform that you use. This configuration is for internal use. | | nameOverride | string | `""` | String to partially override scalardl-audit.fullname template (will maintain the release name) | diff --git a/charts/scalardl-audit/templates/auditor/deployment.yaml b/charts/scalardl-audit/templates/auditor/deployment.yaml index 2323640c..5cd7308b 100644 --- a/charts/scalardl-audit/templates/auditor/deployment.yaml +++ b/charts/scalardl-audit/templates/auditor/deployment.yaml @@ -21,6 +21,9 @@ spec: checksum/config: {{ include (print $.Template.BasePath "/auditor/configmap.yaml") . | sha256sum }} labels: {{- include "scalardl-audit-auditor.selectorLabels" . | nindent 8 }} + {{- if eq .Values.global.platform "azure" }} + azure-extensions-usage-release-identifier: {{ .Release.Name }} + {{- end }} spec: restartPolicy: Always {{- if .Values.auditor.serviceAccount.serviceAccountName }} @@ -75,7 +78,11 @@ spec: - name: {{ .Chart.Name }}-auditor securityContext: {{- toYaml .Values.auditor.securityContext | nindent 12 }} + {{- if eq .Values.global.platform "azure" }} + image: "{{ .Values.global.azure.images.scalardbCluster.registry }}/{{ .Values.global.azure.images.scalardbCluster.image }}:{{ .Values.global.azure.images.scalardbCluster.tag }}" + {{- else }} image: "{{ .Values.auditor.image.repository }}:{{ .Values.auditor.image.version }}" + {{- end }} imagePullPolicy: {{ .Values.auditor.image.pullPolicy }} volumeMounts: {{- if not .Values.auditor.extraVolumeMounts }} diff --git a/charts/scalardl-audit/values.schema.json b/charts/scalardl-audit/values.schema.json index a0f33a8c..9c8c54e1 100644 --- a/charts/scalardl-audit/values.schema.json +++ b/charts/scalardl-audit/values.schema.json @@ -433,6 +433,52 @@ "fullnameOverride": { "type": "string" }, + "global": { + "type": "object", + "properties": { + "azure": { + "type": "object", + "properties": { + "images": { + "type": "object", + "properties": { + "envoy": { + "type": "object", + "properties": { + "image": { + "type": "string" + }, + "registry": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "scalardbCluster": { + "type": "object", + "properties": { + "image": { + "type": "string" + }, + "registry": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + } + } + } + }, + "platform": { + "type": "string" + } + } + }, "nameOverride": { "type": "string" } diff --git a/charts/scalardl-audit/values.yaml b/charts/scalardl-audit/values.yaml index 253b5c67..67b65744 100644 --- a/charts/scalardl-audit/values.yaml +++ b/charts/scalardl-audit/values.yaml @@ -2,6 +2,23 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. +global: + # -- Specify the platform that you use. This configuration is for internal use. + platform: "" + # -- Azure Marketplace specific configurations. + azure: + images: + # -- Container image of ScalarDL Auditor for Azure Marketplace. + scalardbCluster: + tag: "4.0.0-SNAPSHOT" + image: "scalardl-auditor-azure-payg" + registry: "scalar.azurecr.io" + # -- Container image of Envoy for Azure Marketplace. + envoy: + tag: "2.0.0-SNAPSHOT" + image: "scalar-envoy" + registry: "scalar.azurecr.io" + # -- String to partially override scalardl-audit.fullname template (will maintain the release name) nameOverride: "" From 27f7a6b4e7f8f07e153a109ca6f99569ec26e72d Mon Sep 17 00:00:00 2001 From: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:05:35 +0900 Subject: [PATCH 2/2] Fix typo --- charts/scalardl-audit/README.md | 4 ++-- charts/scalardl-audit/templates/auditor/deployment.yaml | 2 +- charts/scalardl-audit/values.schema.json | 2 +- charts/scalardl-audit/values.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/scalardl-audit/README.md b/charts/scalardl-audit/README.md index 75c2c7e8..481dbbd5 100644 --- a/charts/scalardl-audit/README.md +++ b/charts/scalardl-audit/README.md @@ -97,8 +97,8 @@ Current chart version is `3.0.0-SNAPSHOT` | envoy.service.ports.envoy.targetPort | int | `40051` | envoy k8s internal name | | envoy.service.type | string | `"ClusterIP"` | service types in kubernetes | | fullnameOverride | string | `""` | String to fully override scalardl-audit.fullname template | -| global.azure | object | `{"images":{"envoy":{"image":"scalar-envoy","registry":"scalar.azurecr.io","tag":"2.0.0-SNAPSHOT"},"scalardbCluster":{"image":"scalardl-auditor-azure-payg","registry":"scalar.azurecr.io","tag":"4.0.0-SNAPSHOT"}}}` | Azure Marketplace specific configurations. | +| global.azure | object | `{"images":{"envoy":{"image":"scalar-envoy","registry":"scalar.azurecr.io","tag":"2.0.0-SNAPSHOT"},"scalardlAuditor":{"image":"scalardl-auditor-azure-payg","registry":"scalar.azurecr.io","tag":"4.0.0-SNAPSHOT"}}}` | Azure Marketplace specific configurations. | | global.azure.images.envoy | object | `{"image":"scalar-envoy","registry":"scalar.azurecr.io","tag":"2.0.0-SNAPSHOT"}` | Container image of Envoy for Azure Marketplace. | -| global.azure.images.scalardbCluster | object | `{"image":"scalardl-auditor-azure-payg","registry":"scalar.azurecr.io","tag":"4.0.0-SNAPSHOT"}` | Container image of ScalarDL Auditor for Azure Marketplace. | +| global.azure.images.scalardlAuditor | object | `{"image":"scalardl-auditor-azure-payg","registry":"scalar.azurecr.io","tag":"4.0.0-SNAPSHOT"}` | Container image of ScalarDL Auditor for Azure Marketplace. | | global.platform | string | `""` | Specify the platform that you use. This configuration is for internal use. | | nameOverride | string | `""` | String to partially override scalardl-audit.fullname template (will maintain the release name) | diff --git a/charts/scalardl-audit/templates/auditor/deployment.yaml b/charts/scalardl-audit/templates/auditor/deployment.yaml index 5cd7308b..81bcbf60 100644 --- a/charts/scalardl-audit/templates/auditor/deployment.yaml +++ b/charts/scalardl-audit/templates/auditor/deployment.yaml @@ -79,7 +79,7 @@ spec: securityContext: {{- toYaml .Values.auditor.securityContext | nindent 12 }} {{- if eq .Values.global.platform "azure" }} - image: "{{ .Values.global.azure.images.scalardbCluster.registry }}/{{ .Values.global.azure.images.scalardbCluster.image }}:{{ .Values.global.azure.images.scalardbCluster.tag }}" + image: "{{ .Values.global.azure.images.scalardlAuditor.registry }}/{{ .Values.global.azure.images.scalardlAuditor.image }}:{{ .Values.global.azure.images.scalardlAuditor.tag }}" {{- else }} image: "{{ .Values.auditor.image.repository }}:{{ .Values.auditor.image.version }}" {{- end }} diff --git a/charts/scalardl-audit/values.schema.json b/charts/scalardl-audit/values.schema.json index 9c8c54e1..28c4f5ec 100644 --- a/charts/scalardl-audit/values.schema.json +++ b/charts/scalardl-audit/values.schema.json @@ -456,7 +456,7 @@ } } }, - "scalardbCluster": { + "scalardlAuditor": { "type": "object", "properties": { "image": { diff --git a/charts/scalardl-audit/values.yaml b/charts/scalardl-audit/values.yaml index 67b65744..cfa04845 100644 --- a/charts/scalardl-audit/values.yaml +++ b/charts/scalardl-audit/values.yaml @@ -9,7 +9,7 @@ global: azure: images: # -- Container image of ScalarDL Auditor for Azure Marketplace. - scalardbCluster: + scalardlAuditor: tag: "4.0.0-SNAPSHOT" image: "scalardl-auditor-azure-payg" registry: "scalar.azurecr.io"