From 2be0e136cd9429c0bfdf85bcb36e42c798739288 Mon Sep 17 00:00:00 2001 From: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com> Date: Wed, 25 Sep 2024 21:06:03 +0900 Subject: [PATCH 1/4] [scalardb-cluster] Support Azure Marketplace --- charts/scalardb-cluster/README.md | 7 +++ .../scalardb-cluster/deployment.yaml | 7 +++ charts/scalardb-cluster/values.schema.json | 46 +++++++++++++++++++ charts/scalardb-cluster/values.yaml | 16 +++++++ 4 files changed, 76 insertions(+) diff --git a/charts/scalardb-cluster/README.md b/charts/scalardb-cluster/README.md index 9a2e5ee8..1350767a 100644 --- a/charts/scalardb-cluster/README.md +++ b/charts/scalardb-cluster/README.md @@ -23,6 +23,13 @@ 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.images.envoy.image | string | `"scalar-envoy"` | | +| global.azure.images.envoy.registry | string | `"ghcr.io/scalar-labs"` | | +| global.azure.images.envoy.tag | string | `"2.0.0-SNAPSHOT"` | | +| global.azure.images.scalardbCluster.image | string | `"scalardb-cluster-node-azure-payg-premium"` | | +| global.azure.images.scalardbCluster.registry | string | `"scalar.azurecr.io"` | | +| global.azure.images.scalardbCluster.tag | string | `"4.0.0-SNAPSHOT"` | | +| global.platform | string | `""` | | | 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..78453d3c 100644 --- a/charts/scalardb-cluster/values.yaml +++ b/charts/scalardb-cluster/values.yaml @@ -2,6 +2,21 @@ # 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: + scalardbCluster: + tag: "4.0.0-SNAPSHOT" + image: "scalardb-cluster-node-azure-payg-premium" + registry: "scalar.azurecr.io" + envoy: + tag: "2.0.0-SNAPSHOT" + image: "scalar-envoy" + registry: "ghcr.io/scalar-labs" + # -- String to partially override scalardb-cluster.fullname template (will maintain the release name) nameOverride: "" # -- String to fully override scalardb-cluster.fullname template @@ -317,3 +332,4 @@ scalardbCluster: - localhost # -- Issuer references of cert-manager. issuerRef: {} + From 94cf1d291eb26b402f592a4560d8b0f14eb74600 Mon Sep 17 00:00:00 2001 From: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com> Date: Wed, 25 Sep 2024 21:47:02 +0900 Subject: [PATCH 2/4] Fix image registry of Envoy --- charts/scalardb-cluster/README.md | 2 +- charts/scalardb-cluster/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/scalardb-cluster/README.md b/charts/scalardb-cluster/README.md index 1350767a..98bfc4cc 100644 --- a/charts/scalardb-cluster/README.md +++ b/charts/scalardb-cluster/README.md @@ -24,7 +24,7 @@ Current chart version is `2.0.0-SNAPSHOT` | envoy.service.type | string | `"ClusterIP"` | service types in kubernetes | | fullnameOverride | string | `""` | String to fully override scalardb-cluster.fullname template | | global.azure.images.envoy.image | string | `"scalar-envoy"` | | -| global.azure.images.envoy.registry | string | `"ghcr.io/scalar-labs"` | | +| global.azure.images.envoy.registry | string | `"scalar.azurecr.io"` | | | global.azure.images.envoy.tag | string | `"2.0.0-SNAPSHOT"` | | | global.azure.images.scalardbCluster.image | string | `"scalardb-cluster-node-azure-payg-premium"` | | | global.azure.images.scalardbCluster.registry | string | `"scalar.azurecr.io"` | | diff --git a/charts/scalardb-cluster/values.yaml b/charts/scalardb-cluster/values.yaml index 78453d3c..0e6863f2 100644 --- a/charts/scalardb-cluster/values.yaml +++ b/charts/scalardb-cluster/values.yaml @@ -15,7 +15,7 @@ global: envoy: tag: "2.0.0-SNAPSHOT" image: "scalar-envoy" - registry: "ghcr.io/scalar-labs" + registry: "scalar.azurecr.io" # -- String to partially override scalardb-cluster.fullname template (will maintain the release name) nameOverride: "" From 24742c648f65b01354b7fd4c30aa349918d2f3a7 Mon Sep 17 00:00:00 2001 From: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com> Date: Thu, 26 Sep 2024 10:46:37 +0900 Subject: [PATCH 3/4] Update values.yaml --- charts/scalardb-cluster/values.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/scalardb-cluster/values.yaml b/charts/scalardb-cluster/values.yaml index 0e6863f2..55ccdfa6 100644 --- a/charts/scalardb-cluster/values.yaml +++ b/charts/scalardb-cluster/values.yaml @@ -332,4 +332,3 @@ scalardbCluster: - localhost # -- Issuer references of cert-manager. issuerRef: {} - From e620b18bd6311a365050342e82d91819b3e58664 Mon Sep 17 00:00:00 2001 From: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:24:20 +0900 Subject: [PATCH 4/4] Update description of values.yaml --- charts/scalardb-cluster/README.md | 11 ++++------- charts/scalardb-cluster/values.yaml | 6 ++++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/charts/scalardb-cluster/README.md b/charts/scalardb-cluster/README.md index 98bfc4cc..d494ac02 100644 --- a/charts/scalardb-cluster/README.md +++ b/charts/scalardb-cluster/README.md @@ -23,13 +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.images.envoy.image | string | `"scalar-envoy"` | | -| global.azure.images.envoy.registry | string | `"scalar.azurecr.io"` | | -| global.azure.images.envoy.tag | string | `"2.0.0-SNAPSHOT"` | | -| global.azure.images.scalardbCluster.image | string | `"scalardb-cluster-node-azure-payg-premium"` | | -| global.azure.images.scalardbCluster.registry | string | `"scalar.azurecr.io"` | | -| global.azure.images.scalardbCluster.tag | string | `"4.0.0-SNAPSHOT"` | | -| global.platform | string | `""` | | +| 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/values.yaml b/charts/scalardb-cluster/values.yaml index 55ccdfa6..72984b0a 100644 --- a/charts/scalardb-cluster/values.yaml +++ b/charts/scalardb-cluster/values.yaml @@ -3,15 +3,17 @@ # Declare variables to be passed into your templates. global: - # Specify the platform that you use. This configuration is for internal use. + # -- Specify the platform that you use. This configuration is for internal use. platform: "" - # Azure Marketplace specific configurations. + # -- 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"