Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#8550]The init.sh is configurable in values.yaml and monitor configmap.yaml changes (#8643)

Danhua Wang6c6c8961bb69
diff --git a/dev/charts/gravitino-iceberg-rest-server/resources/init.sh b/dev/charts/gravitino-iceberg-rest-server/resources/init.sh
deleted file mode 100644
index a1d009f338..0000000000
--- a/dev/charts/gravitino-iceberg-rest-server/resources/init.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-echo "Override config."
-cp /tmp/conf/* ${GRAVITINO_HOME}/conf
-cp /tmp/conf/log4j2.properties ${GRAVITINO_HOME}/conf
-
-echo "Start the Gravitino Iceberg Rest Catalog Server"
-/bin/bash ${GRAVITINO_HOME}/bin/gravitino-iceberg-rest-server.sh run
diff --git a/dev/charts/gravitino-iceberg-rest-server/templates/configmap.yaml b/dev/charts/gravitino-iceberg-rest-server/templates/configmap.yaml
index 77231b2244..004030a520 100644
--- a/dev/charts/gravitino-iceberg-rest-server/templates/configmap.yaml
+++ b/dev/charts/gravitino-iceberg-rest-server/templates/configmap.yaml
@@ -25,6 +25,8 @@ metadata:
labels:
{{- include "gravitino-iceberg-rest-server.labels" . | nindent 4 }}
data:
+ init.sh: |-
+ {{- tpl .Values.initScript . | nindent 4 }}
{{ $root := . }}
{{ range $path, $bytes := .Files.Glob "resources/*" }}
{{ base $path | indent 2 }}: |-
diff --git a/dev/charts/gravitino-iceberg-rest-server/templates/deployment.yaml b/dev/charts/gravitino-iceberg-rest-server/templates/deployment.yaml
index 2bb2c14a1d..d838c331d8 100644
--- a/dev/charts/gravitino-iceberg-rest-server/templates/deployment.yaml
+++ b/dev/charts/gravitino-iceberg-rest-server/templates/deployment.yaml
@@ -39,9 +39,11 @@ spec:
template:
metadata:
+
+ annotations:
+ checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
# Pod annotations (if configured)
{{- with .Values.podAnnotations }}
- annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
diff --git a/dev/charts/gravitino-iceberg-rest-server/values.yaml b/dev/charts/gravitino-iceberg-rest-server/values.yaml
index b359128b7c..9af4c9315b 100644
--- a/dev/charts/gravitino-iceberg-rest-server/values.yaml
+++ b/dev/charts/gravitino-iceberg-rest-server/values.yaml
@@ -274,6 +274,12 @@ service:
portName: http
nodePort: ""
+initScript: |
+ echo "Override config."
+ cp /tmp/conf/* ${GRAVITINO_HOME}/conf
+ echo "Start the Gravitino Iceberg Rest Catalog Server"
+ /bin/bash ${GRAVITINO_HOME}/bin/gravitino-iceberg-rest-server.sh run
+
## Readiness probe for the Gravitino deployment
##
readinessProbe:
diff --git a/dev/charts/gravitino/resources/config/init.sh b/dev/charts/gravitino/resources/config/init.sh
deleted file mode 100644
index a91f20cacb..0000000000
--- a/dev/charts/gravitino/resources/config/init.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-cp /tmp/conf/* ${GRAVITINO_HOME}/conf
-cp /tmp/conf/log4j2.properties ${GRAVITINO_HOME}/conf
-
-echo "Start the Gravitino Server"
-/bin/bash ${GRAVITINO_HOME}/bin/gravitino.sh run
diff --git a/dev/charts/gravitino/templates/configmap.yaml b/dev/charts/gravitino/templates/configmap.yaml
index a76f65fb35..c497b8e07b 100644
--- a/dev/charts/gravitino/templates/configmap.yaml
+++ b/dev/charts/gravitino/templates/configmap.yaml
@@ -26,7 +26,7 @@ metadata:
{{- include "gravitino.labels" . | nindent 4 }}
data:
init.sh: |-
- {{- tpl (.Files.Get "resources/config/init.sh") . | nindent 4 }}
+ {{- tpl .Values.initScript . | nindent 4 }}
gravitino.conf: |
{{- tpl (.Files.Get "resources/config/gravitino.conf") . | nindent 4 }}
log4j2.properties: |-
diff --git a/dev/charts/gravitino/templates/deployment.yaml b/dev/charts/gravitino/templates/deployment.yaml
index 59c25f5c88..700df9463b 100644
--- a/dev/charts/gravitino/templates/deployment.yaml
+++ b/dev/charts/gravitino/templates/deployment.yaml
@@ -42,6 +42,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
+ checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
diff --git a/dev/charts/gravitino/values.yaml b/dev/charts/gravitino/values.yaml
index b163778605..cfa7df7904 100644
--- a/dev/charts/gravitino/values.yaml
+++ b/dev/charts/gravitino/values.yaml
@@ -383,6 +383,11 @@ additionalLog4j2Properties:
appender.console.layout.pattern: "%d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L - %m%n"
rootLogger.appenderRef.console.ref: consoleLogger
+initScript: |
+ cp /tmp/conf/* ${GRAVITINO_HOME}/conf
+ echo "Start the Gravitino Server"
+ /bin/bash ${GRAVITINO_HOME}/bin/gravitino.sh run
+
## Expose the gravitino service to be accessed from outside the cluster (LoadBalancer service).
## or access it from within the cluster (ClusterIP service). Set the service type and the port to serve it.
## ref: http://kubernetes.io/docs/user-guide/services/