From 21797b166ef2004d1f800445cc5cac99ba93cd86 Mon Sep 17 00:00:00 2001 From: devOpsHelm <54980549+devOpsHelm@users.noreply.github.com> Date: Wed, 29 Apr 2020 21:16:25 +0300 Subject: [PATCH] Merge pull request #121 from eminn/fix-custom-volume (#22190) Signed-off-by: devOpsHelm --- stable/hazelcast-jet/Chart.yaml | 6 +- stable/hazelcast-jet/README.adoc | 57 +++++++++++++++++++ .../hazelcast-jet/templates/statefulset.yaml | 12 ++++ stable/hazelcast-jet/values.yaml | 7 ++- 4 files changed, 77 insertions(+), 5 deletions(-) diff --git a/stable/hazelcast-jet/Chart.yaml b/stable/hazelcast-jet/Chart.yaml index d0f0a04d49..dd73e98334 100644 --- a/stable/hazelcast-jet/Chart.yaml +++ b/stable/hazelcast-jet/Chart.yaml @@ -1,15 +1,15 @@ apiVersion: v1 -appVersion: "4.0" +appVersion: "4.1" tillerVersion: ">=2.7.2" kubeVersion: ">=1.9.0-0" description: Hazelcast Jet is an application embeddable, distributed computing engine built on top of Hazelcast In-Memory Data Grid (IMDG). With Hazelcast IMDG providing storage functionality, Hazelcast Jet performs parallel execution to enable data-intensive applications to operate in near real-time. name: hazelcast-jet -version: 1.5.1 +version: 1.6.0 keywords: - hazelcast - jet - streaming -home: http://jet.hazelcast.org/ +home: https://jet-start.sh icon: http://hazelcast.com/images/logos/Hazelcast-Jet-Logo-Orange_Dark_Icon_200px.png sources: - https://github.com/hazelcast/hazelcast-jet diff --git a/stable/hazelcast-jet/README.adoc b/stable/hazelcast-jet/README.adoc index c8fa1847cc..fe78ef4e56 100644 --- a/stable/hazelcast-jet/README.adoc +++ b/stable/hazelcast-jet/README.adoc @@ -216,6 +216,9 @@ service |`+8080+` |`+metrics.service.annotations+` |Annotations for the Prometheus discovery | +|`+customVolume+` |Configuration for a volume which will +be mounted as `/data/custom' (e.g. to mount a volume with custom JARs) |`+nil+` + |`+managementcenter.enabled+` |Turn on and off Hazelcast Jet Management Center application |`+true+` @@ -430,6 +433,60 @@ $ helm install --name my-jet-release \ ---- endif::[] +=== Adding custom JAR files to the classpath + +You can mount any volume which contains your JAR files +to the pods created by helm chart using `customVolume` configuration. + +When the `customVolume` set, it will mount provided volume to the pod +on `/data/custom` path. +This path also appended to the classpath of running Java process. + +For example, if you have existing host path Persistent Volume and +Persistent Volume Claims like below; + +[source,yaml] +---- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: jet-hostpathpv-volume + labels: + type: local +spec: + storageClassName: manual + capacity: + storage: 1Gi + accessModes: + - ReadWriteOnce + hostPath: + path: "/path/to/my/jars" +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: jet-pv-claim +spec: + storageClassName: manual + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +---- + +You can configure your Helm chart to use it like below in your `values.yaml` +file. +[source,yaml] +---- +customVolume: + persistentVolumeClaim: + claimName: jet-pv-claim +---- + +See https://kubernetes.io/docs/concepts/storage/[Volumes] section on the +Kubernetes documentation for other available options. + == Notable changes === 1.4.0 diff --git a/stable/hazelcast-jet/templates/statefulset.yaml b/stable/hazelcast-jet/templates/statefulset.yaml index 7012488287..38711d9963 100644 --- a/stable/hazelcast-jet/templates/statefulset.yaml +++ b/stable/hazelcast-jet/templates/statefulset.yaml @@ -98,7 +98,15 @@ spec: volumeMounts: - name: hazelcast-jet-storage mountPath: /data/hazelcast-jet + {{- if .Values.customVolume }} + - name: hazelcast-jet-custom-volume + mountPath: /data/custom + {{- end }} env: + {{- if .Values.customVolume }} + - name: CLASSPATH + value: "/data/custom:/data/custom/*" + {{- end }} {{- if .Values.metrics.enabled }} - name: PROMETHEUS_PORT value: "{{ .Values.metrics.service.port }}" @@ -126,3 +134,7 @@ spec: - name: hazelcast-jet-storage configMap: name: {{ template "hazelcast-jet.fullname" . }}-configuration + {{- if .Values.customVolume }} + - name: hazelcast-jet-custom-volume +{{ toYaml .Values.customVolume | indent 8 }} + {{- end }} diff --git a/stable/hazelcast-jet/values.yaml b/stable/hazelcast-jet/values.yaml index 8449dec4b5..40cda468f3 100644 --- a/stable/hazelcast-jet/values.yaml +++ b/stable/hazelcast-jet/values.yaml @@ -5,7 +5,7 @@ image: # repository is the Hazelcast Jet image name repository: "hazelcast/hazelcast-jet" # tag is the Hazelcast Jet image tag - tag: "4.0" + tag: "4.1" # pullPolicy is the Docker image pull policy # It's recommended to change this to 'Always' if the image tag is 'latest' # ref: http://kubernetes.io/docs/user-guide/images/#updating-images @@ -220,6 +220,9 @@ metrics: prometheus.io/path: "/metrics" prometheus.io/port: "8080" +# customVolume is the configuration for a volume will be mounted as '/data/custom/' (e.g. to mount a volume with custom JARs) +# customVolume: + # Hazelcast Jet Management Center application properties managementcenter: # enabled is a flag to enable Hazelcast Jet Management Center application @@ -231,7 +234,7 @@ managementcenter: # repository is the Hazelcast Jet Management Center image name repository: "hazelcast/hazelcast-jet-management-center" # tag is the Hazelcast Jet Management Center image tag - tag: "4.0" + tag: "4.1" # pullPolicy is the Docker image pull policy # It's recommended to change this to 'Always' if the image tag is 'latest' # ref: http://kubernetes.io/docs/user-guide/images/#updating-images