From 52e3a65b4f6c6e2b79a544a7c8827b16ff2f9e5a Mon Sep 17 00:00:00 2001 From: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:42:16 +0900 Subject: [PATCH] [scalardb-cluster] Support Azure Marketplace (#275) --- charts/scalardb-cluster/README.md | 4 ++ .../scalardb-cluster/deployment.yaml | 7 +++ charts/scalardb-cluster/values.schema.json | 46 +++++++++++++++++++ charts/scalardb-cluster/values.yaml | 17 +++++++ 4 files changed, 74 insertions(+) diff --git a/charts/scalardb-cluster/README.md b/charts/scalardb-cluster/README.md index 9a2e5ee8..d494ac02 100644 --- a/charts/scalardb-cluster/README.md +++ b/charts/scalardb-cluster/README.md @@ -23,6 +23,10 @@ Current chart version is `2.0.0-SNAPSHOT` | envoy.service.ports.envoy.targetPort | int | `60053` | envoy k8s internal name | | envoy.service.type | string | `"ClusterIP"` | service types in kubernetes | | fullnameOverride | string | `""` | String to fully override scalardb-cluster.fullname template | +| global.azure | object | `{"images":{"envoy":{"image":"scalar-envoy","registry":"scalar.azurecr.io","tag":"2.0.0-SNAPSHOT"},"scalardbCluster":{"image":"scalardb-cluster-node-azure-payg-premium","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":"scalardb-cluster-node-azure-payg-premium","registry":"scalar.azurecr.io","tag":"4.0.0-SNAPSHOT"}` | Container image of ScalarDB Cluster for Azure Marketplace. | +| global.platform | string | `""` | Specify the platform that you use. This configuration is for internal use. | | nameOverride | string | `""` | String to partially override scalardb-cluster.fullname template (will maintain the release name) | | scalardbCluster.affinity | object | `{}` | The affinity/anti-affinity feature, greatly expands the types of constraints you can express. | | scalardbCluster.extraVolumeMounts | list | `[]` | Defines additional volume mounts. If you want to get a heap dump of the ScalarDB Cluster node, you need to mount a volume to make the dump file persistent. | diff --git a/charts/scalardb-cluster/templates/scalardb-cluster/deployment.yaml b/charts/scalardb-cluster/templates/scalardb-cluster/deployment.yaml index b75e696f..5414c6b0 100644 --- a/charts/scalardb-cluster/templates/scalardb-cluster/deployment.yaml +++ b/charts/scalardb-cluster/templates/scalardb-cluster/deployment.yaml @@ -24,6 +24,9 @@ spec: {{- end }} labels: {{- include "scalardb-cluster.selectorLabels" . | nindent 8 }} + {{- if eq .Values.global.platform "azure" }} + azure-extensions-usage-release-identifier: {{ .Release.Name }} + {{- end }} spec: restartPolicy: Always serviceAccountName: {{ include "scalardb-cluster.serviceAccountName" . }} @@ -39,7 +42,11 @@ spec: - name: {{ .Chart.Name }}-node securityContext: {{- toYaml .Values.scalardbCluster.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.scalardbCluster.image.repository }}:{{ .Values.scalardbCluster.image.tag | default .Chart.AppVersion }}" + {{- end }} imagePullPolicy: {{ .Values.scalardbCluster.image.pullPolicy }} ports: - containerPort: 60053 diff --git a/charts/scalardb-cluster/values.schema.json b/charts/scalardb-cluster/values.schema.json index 4612bb16..2bbc6d27 100644 --- a/charts/scalardb-cluster/values.schema.json +++ b/charts/scalardb-cluster/values.schema.json @@ -62,6 +62,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/scalardb-cluster/values.yaml b/charts/scalardb-cluster/values.yaml index d7d57281..72984b0a 100644 --- a/charts/scalardb-cluster/values.yaml +++ b/charts/scalardb-cluster/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 ScalarDB Cluster for Azure Marketplace. + scalardbCluster: + tag: "4.0.0-SNAPSHOT" + image: "scalardb-cluster-node-azure-payg-premium" + 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 scalardb-cluster.fullname template (will maintain the release name) nameOverride: "" # -- String to fully override scalardb-cluster.fullname template