diff --git a/stable/hazelcast-jet/Chart.yaml b/stable/hazelcast-jet/Chart.yaml index 22a2be55d0..9808fde4b1 100644 --- a/stable/hazelcast-jet/Chart.yaml +++ b/stable/hazelcast-jet/Chart.yaml @@ -1,8 +1,10 @@ apiVersion: v1 -name: hazelcast-jet -version: 1.2.0 -appVersion: "3.1" +appVersion: "3.2" +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.3.0 keywords: - hazelcast - jet @@ -14,10 +16,4 @@ sources: maintainers: - name: emin email: emin@hazelcast.com -- name: leszko - email: rafal@hazelcast.com -- name: googlielmo - email: guglielmo@hazelcast.com -- name: mesutcelik - email: mesut@hazelcast.com engine: gotpl diff --git a/stable/hazelcast-jet/README.adoc b/stable/hazelcast-jet/README.adoc new file mode 100644 index 0000000000..26a44419bc --- /dev/null +++ b/stable/hazelcast-jet/README.adoc @@ -0,0 +1,363 @@ +:repo: helm/charts + +== Hazelcast Jet + +http://jet.hazelcast.org[Hazelcast Jet] is a distributed computing platform +built for high-performance stream processing and fast batch processing. It +embeds Hazelcast In-Memory Data Grid (IMDG) to provide a lightweight, +simple-to-deploy package that includes scalable in-memory storage. + +Visit http://jet.hazelcast.org[jet.hazelcast.org] to learn more about the +architecture and use cases. + +=== Quick Start + + +ifeval::["{repo}"=="hazelcast/charts"] +[source,bash] +---- +$ helm repo add hazelcast https://hazelcast.github.io/charts/ +$ helm repo update +$ helm install hazelcast/hazelcast-jet +---- +endif::[] + + +ifeval::["{repo}"=="helm/charts"] +[source,bash] +---- +$ helm install stable/hazelcast-jet +---- +endif::[] + +=== Introduction + +This chart bootstraps a +https://github.com/hazelcast/hazelcast-jet-docker[Hazelcast Jet] and +https://github.com/hazelcast/hazelcast-jet-management-center-docker[Hazelcast +Jet Management Center] deployments on a http://kubernetes.io[Kubernetes] cluster +using the https://helm.sh[Helm] package manager. + +=== Prerequisites + +* Kubernetes 1.9+ + +=== Installing the Chart + +To install the chart with the release name `+my-release+`: + +ifeval::["{repo}"=="hazelcast/charts"] +[source,bash] +---- +$ helm install --name my-release hazelcast/hazelcast-jet +---- +endif::[] + +ifeval::["{repo}"=="helm/charts"] +[source,bash] +---- +$ helm install --name my-release stable/hazelcast-jet +---- +endif::[] + +The command deploys Hazelcast Jet on the Kubernetes cluster in the default +configuration. The link:#configuration[configuration] section lists the +parameters that can be configured during installation. + +____ +*Tip*: List all releases using `+helm list+` +____ + +=== Uninstalling the Chart + +To uninstall/delete the `+my-release+` deployment: + +[source,bash] +---- +$ helm delete my-release +---- + +The command removes all the Kubernetes components associated with the chart and +deletes the release. + +=== Configuration + +The following table lists the configurable parameters of the Hazelcast chart and +their default values. + +[width="100%",cols="22%,53%,25%",options="header",] +|=== +|Parameter |Description |Default +|`+image.repository+` |Hazelcast Jet Image name |`+hazelcast/hazelcast-jet+` + +|`+image.tag+` |Hazelcast Jet Image tag |`+{VERSION}+` + +|`+image.pullPolicy+` |Image pull policy |`+IfNotPresent+` + +|`+image.pullSecrets+` |Specify docker-registry secret names as an array +|`+nil+` + +|`+cluster.memberCount+` |Number of Hazelcast Jet members |2 + +|`+jet.rest+` |Enable REST endpoints for Hazelcast Jet member |`+true+` + +|`+jet.javaOpts+` |Additional JAVA_OPTS properties for Hazelcast Jet member +|`+nil+` + +|`+jet.yaml.hazelcast-jet+` and `+jet.yaml.hazelcast+` |Hazelcast Jet and IMDG +YAML configurations (`+hazelcast-jet.yaml+` and `+hazelcast.yaml+` embedded into +`+values.yaml+`) |`+{DEFAULT_JET_YAML}+` and `+{DEFAULT_HAZELCAST_YAML}+` + +|`+jet.configurationFiles+` |Hazelcast configuration files |`+nil+` + +|`+nodeSelector+` |Hazelcast Node labels for pod assignment |`+nil+` + +|`+gracefulShutdown.enabled+` |Turn on and off Graceful Shutdown |`+true+` + +|`+gracefulShutdown.maxWaitSeconds+` |Maximum time to wait for the Hazelcast Jet +POD to shut down |`+600+` + +|`+livenessProbe.enabled+` |Turn on and off liveness probe |`+true+` + +|`+livenessProbe.initialDelaySeconds+` |Delay before liveness probe is initiated +|`+30+` + +|`+livenessProbe.periodSeconds+` |How often to perform the probe |`+10+` + +|`+livenessProbe.timeoutSeconds+` |When the probe times out |`+5+` + +|`+livenessProbe.successThreshold+` |Minimum consecutive successes for the probe +to be considered successful after having failed |`+1+` + +|`+livenessProbe.failureThreshold+` |Minimum consecutive failures for the probe +to be considered failed after having succeeded. |`+3+` + +|`+readinessProbe.enabled+` |Turn on and off readiness probe |`+true+` + +|`+readinessProbe.initialDelaySeconds+` |Delay before readiness probe is +initiated |`+30+` + +|`+readinessProbe.periodSeconds+` |How often to perform the probe |`+10+` + +|`+readinessProbe.timeoutSeconds+` |When the probe times out |`+1+` + +|`+readinessProbe.successThreshold+` |Minimum consecutive successes for the +probe to be considered successful after having failed |`+1+` + +|`+readinessProbe.failureThreshold+` |Minimum consecutive failures for the probe +to be considered failed after having succeeded. |`+3+` + +|`+resources+` |CPU/Memory resource requests/limits |`+nil+` + +|`+service.type+` |Kubernetes service type (`ClusterIP', `LoadBalancer', or +`NodePort') |`+ClusterIP+` + +|`+service.port+` |Kubernetes service port |`+5701+` + +|`+rbac.create+` |Enable installing RBAC Role authorization |`+true+` + +|`+serviceAccount.create+` |Enable installing Service Account |`+true+` + +|`+serviceAccount.name+` |Name of Service Account, if not set, the name is +generated using the fullname template |`+nil+` + +|`+securityContext.enabled+` |Enables Security Context for Hazelcast Jet and +Hazelcast Jet Management Center |`+true+` + +|`+securityContext.runAsUser+` |User ID used to run the Hazelcast Jet and +Hazelcast Jet Management Center containers |`+1001+` + +|`+securityContext.fsGroup+` |Group ID associated with the Hazelcast Jet and +Hazelcast Jet Management Center container |`+1001+` + +|`+metrics.enabled+` |Turn on and off JMX Prometheus metrics available at +`+/metrics+` |`+false+` + +|`+metrics.service.type+` |Type of the metrics service |`+ClusterIP+` + +|`+metrics.service.port+` |Port of the `+/metrics+` endpoint and the metrics +service |`+8080+` + +|`+metrics.service.annotations+` |Annotations for the Prometheus discovery | + +|`+managementcenter.enabled+` |Turn on and off Hazelcast Jet Management Center +application |`+true+` + +|`+managementcenter.image.repository+` |Hazelcast Jet Management Center Image +name |`+hazelcast/hazelcast-jet-management-center+` + +|`+managementcenter.image.tag+` |Hazelcast Jet Management Center Image tag +(NOTE: must be the same or one minor release greater than Hazelcast image +version) |`+{VERSION}+` + +|`+managementcenter.image.pullPolicy+` |Image pull policy |`+IfNotPresent+` + +|`+managementcenter.image.pullSecrets+` |Specify docker-registry secret names as +an array |`+nil+` + +|`+managementcenter.javaOpts+` |Additional JAVA_OPTS properties for Hazelcast +Jet Management Center |`+nil+` + +|`+managementcenter.licenseKey+` |License Key for Hazelcast Jet Management +Center |`+nil+` + +|`+managementcenter.licenseKeySecretName+` |Kubernetes Secret Name, where Jet +Management Center License Key is stored (can be used instead of licenseKey) +|`+nil+` + +|`+managementcenter.nodeSelector+` |Hazelcast Jet Management Center node labels +for pod assignment |`+nil+` + +|`+managementcenter.resources+` |CPU/Memory resource requests/limits |`+nil+` + +|`+managementcenter.service.type+` |Kubernetes service type (`ClusterIP', +`LoadBalancer', or `NodePort') |`+ClusterIP+` + +|`+managementcenter.service.port+` |Kubernetes service port |`+8081+` + +|`+managementcenter.livenessProbe.enabled+` |Turn on and off liveness probe +|`+true+` + +|`+managementcenter.livenessProbe.initialDelaySeconds+` |Delay before liveness +probe is initiated |`+30+` + +|`+managementcenter.livenessProbe.periodSeconds+` |How often to perform the +probe |`+10+` + +|`+managementcenter.livenessProbe.timeoutSeconds+` |When the probe times out +|`+5+` + +|`+managementcenter.livenessProbe.successThreshold+` |Minimum consecutive +successes for the probe to be considered successful after having failed |`+1+` + +|`+managementcenter.livenessProbe.failureThreshold+` |Minimum consecutive +failures for the probe to be considered failed after having succeeded. |`+3+` + +|`+managementcenter.readinessProbe.enabled+` |Turn on and off readiness probe +|`+true+` + +|`+managementcenter.readinessProbe.initialDelaySeconds+` |Delay before readiness +probe is initiated |`+30+` + +|`+managementcenter.readinessProbe.periodSeconds+` |How often to perform the +probe |`+10+` + +|`+managementcenter.readinessProbe.timeoutSeconds+` |When the probe times out +|`+1+` + +|`+managementcenter.readinessProbe.successThreshold+` |Minimum consecutive +successes for the probe to be considered successful after having failed |`+1+` + +|`+managementcenter.readinessProbe.failureThreshold+` |Minimum consecutive +failures for the probe to be considered failed after having succeeded. |`+3+` +|=== + +Specify each parameter using the `+--set key=value[,key=value]+` argument to +`+helm install+`. For example, + + +ifeval::["{repo}"=="hazelcast/charts"] +[source,bash] +---- +$ helm install --name my-release \ + --set cluster.memberCount=3,serviceAccount.create=false \ + hazelcast/hazelcast-jet +---- +endif::[] + +ifeval::["{repo}"=="helm/charts"] +[source,bash] +---- +$ helm install --name my-release \ + --set cluster.memberCount=3,serviceAccount.create=false \ + stable/hazelcast-jet +---- +endif::[] + + +The above command sets number of Hazelcast Jet members to 3 and disables REST +endpoints. + +Alternatively, a YAML file that specifies the values for the parameters can be +provided while installing the chart. For example, + +ifeval::["{repo}"=="hazelcast/charts"] +[source,bash] +---- +$ helm install --name my-release -f values.yaml hazelcast/hazelcast-jet +---- +endif::[] + +ifeval::["{repo}"=="helm/charts"] +[source,bash] +---- +$ helm install --name my-release -f values.yaml stable/hazelcast-jet +---- +endif::[] + + +____ +*Tip*: You can use the default values.yaml +____ + +=== Custom Hazelcast IMDG and Jet configuration + +Custom Hazelcast IMDG and Hazelcast Jet configuration can be specified inside +`+values.yaml+`, as the `+jet.yaml.hazelcast+` and `+jet.yaml.hazelcast-jet+` +properties. + +[source,yaml] +---- +jet: + yaml: + hazelcast: + network: + join: + multicast: + enabled: false + kubernetes: + enabled: true + service-name: ${serviceName} + namespace: ${namespace} + resolve-not-ready-addresses: true + management-center: + enabled: ${hazelcast.mancenter.enabled} + url: ${hazelcast.mancenter.url} + hazelcast-jet: + instance: + flow-control-period: 100 + backup-count: 1 + scale-up-delay-millis: 10000 + lossless-restart-enabled: false + edge-defaults: + queue-size: 1024 + packet-size-limit: 16384 + receive-window-multiplier: 3 + metrics: + enabled: true + jmx-enabled: true + retention-seconds: 120 + collection-interval-seconds: 5 + metrics-for-data-structures: false +---- + +Alternatively, above parameters can be modified directly via `+helm+` commands. +For example, + +ifeval::["{repo}"=="hazelcast/charts"] +[source,bash] +---- +$ helm install --name my-jet-release \ + --set jet.yaml.hazelcast-jet.instance.backup-count=2,jet.yaml.hazelcast.network.kubernetes.service-name=jet-service \ + hazelcast/hazelcast-jet +---- +endif::[] + +ifeval::["{repo}"=="helm/charts"] +[source,bash] +---- +$ helm install --name my-jet-release \ + --set jet.yaml.hazelcast-jet.instance.backup-count=2,jet.yaml.hazelcast.network.kubernetes.service-name=jet-service \ + stable/hazelcast-jet +---- +endif::[] diff --git a/stable/hazelcast-jet/README.md b/stable/hazelcast-jet/README.md deleted file mode 100644 index 01ae3b618f..0000000000 --- a/stable/hazelcast-jet/README.md +++ /dev/null @@ -1,177 +0,0 @@ -# Hazelcast Jet - -[Hazelcast Jet](http://jet.hazelcast.org) is a distributed computing -platform built for high-performance stream processing and fast batch -processing. It embeds Hazelcast In-Memory Data Grid (IMDG) to provide -a lightweight, simple-to-deploy package that includes scalable -in-memory storage. - -Visit [jet.hazelcast.org](http://jet.hazelcast.org) to learn more -about the architecture and use cases. - -## Quick Start - -```bash -$ helm install stable/hazelcast-jet -``` - -## Introduction - -This chart bootstraps a [Hazelcast Jet](https://github.com/hazelcast/hazelcast-jet-docker) deployments on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. - -## Prerequisites - -- Kubernetes 1.9+ - -## Installing the Chart - -To install the chart with the release name `my-release`: - -```bash -$ helm install --name my-release stable/hazelcast-jet -``` - -The command deploys Hazelcast Jet on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. - -> **Tip**: List all releases using `helm list` - -## Uninstalling the Chart - -To uninstall/delete the `my-release` deployment: - -```bash -$ helm delete my-release -``` - -The command removes all the Kubernetes components associated with the chart and deletes the release. - -## Configuration - -The following table lists the configurable parameters of the Hazelcast chart and their default values. - -| Parameter | Description | Default | -|--------------------------------------------|----------------------------------------------------------------------------------------------------------------|------------------------------------------------------| -| `image.repository` | Hazelcast Jet Image name | `hazelcast/hazelcast-jet` | -| `image.tag` | Hazelcast Jet Image tag | `{VERSION}` | -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | -| `cluster.memberCount` | Number of Hazelcast Jet members | 2 | -| `jet.rest` | Enable REST endpoints for Hazelcast Jet member | `true` | -| `jet.javaOpts` | Additional JAVA_OPTS properties for Hazelcast Jet member | `nil` | -| `jet.configurationFiles` | Hazelcast configuration files | `{DEFAULT_HAZELCAST_XML}` | -| `nodeSelector` | Hazelcast Node labels for pod assignment | `nil` | -| `gracefulShutdown.enabled` | Turn on and off Graceful Shutdown | `true` | -| `gracefulShutdown.maxWaitSeconds` | Maximum time to wait for the Hazelcast Jet POD to shut down | `600` | -| `livenessProbe.enabled` | Turn on and off liveness probe | `true` | -| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `30` | -| `livenessProbe.periodSeconds` | How often to perform the probe | `10` | -| `livenessProbe.timeoutSeconds` | When the probe times out | `5` | -| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | `1` | -| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `3` | -| `readinessProbe.enabled` | Turn on and off readiness probe | `true` | -| `readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `30` | -| `readinessProbe.periodSeconds` | How often to perform the probe | `10` | -| `readinessProbe.timeoutSeconds` | When the probe times out | `1` | -| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | `1` | -| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `3` | -| `resources` | CPU/Memory resource requests/limits | `nil` | -| `service.type` | Kubernetes service type ('ClusterIP', 'LoadBalancer', or 'NodePort') | `ClusterIP` | -| `service.port` | Kubernetes service port | `5701` | -| `rbac.create` | Enable installing RBAC Role authorization | `true` | -| `serviceAccount.create` | Enable installing Service Account | `true` | -| `serviceAccount.name` | Name of Service Account, if not set, the name is generated using the fullname template | `nil` | -| `securityContext.enabled` | Enables Security Context for Hazelcast Jet | `true` | -| `securityContext.runAsUser` | User ID used to run the Hazelcast Jet containers | `1001` | -| `securityContext.fsGroup` | Group ID associated with the Hazelcast Jet container | `1001` | -| `metrics.enabled` | Turn on and off JMX Prometheus metrics available at `/metrics` | `false` | -| `metrics.service.type` | Type of the metrics service | `ClusterIP` | -| `metrics.service.port` | Port of the `/metrics` endpoint and the metrics service | `8080` | -| `metrics.service.annotations` | Annotations for the Prometheus discovery | | -Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, - -```bash -$ helm install --name my-release \ - --set cluster.memberCount=3,serviceAccount.create=false \ - stable/hazelcast-jet -``` - -The above command sets number of Hazelcast Jet members to 3 and disables REST endpoints. - -Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, - -```bash -$ helm install --name my-release -f values.yaml stable/hazelcast-jet -``` - -> **Tip**: You can use the default [values.yaml](values.yaml) - -## Custom Hazelcast IMDG and Jet configuration - -Custom Hazelcast IMDG and Hazelcast Jet configuration can be specified inside `values.yaml`, as the `jet.configurationFiles.hazelcast.xml` and `jet.configurationFiles.hazelcast-jet.xml` properties. - -```yaml -jet: - configurationFiles: - hazelcast.xml: |- - - - - - true - - - - - - - - - ${serviceName} - ${namespace} - - - - - - - - hazelcast-jet.xml: |- - - - - - 8 - - 100 - - 1 - - - - custom property - - - - 1024 - - 16384 - - 3 - - - - - 120 - - 5 - - false - - -``` diff --git a/stable/hazelcast-jet/templates/NOTES.txt b/stable/hazelcast-jet/templates/NOTES.txt index 503046981a..f0c94d3963 100644 --- a/stable/hazelcast-jet/templates/NOTES.txt +++ b/stable/hazelcast-jet/templates/NOTES.txt @@ -58,4 +58,28 @@ To access Hazelcast Jet from outside the Kubernetes cluster: *) Get health info: $ curl http://$NODE_IP:$NODE_PORT/hazelcast/health {{- end }} -{{- end }} \ No newline at end of file +{{- end }} + +{{- if .Values.managementcenter.enabled }} + +------------------------------------------------------------------------------- + +To access Hazelcast Jet Management Center: + + +{{- if contains "LoadBalancer" .Values.managementcenter.service.type }} + *) Check Management Center external IP: + $ export MANAGEMENT_CENTER_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "hazelcast-jet-management-center.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + *) Open Browser at: http://$MANAGEMENT_CENTER_IP:{{ .Values.managementcenter.service.port }}/ +{{- else if contains "ClusterIP" .Values.managementcenter.service.type }} + *) Forward port from POD: + $ export POD=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "hazelcast-jet.name" . }},role=hazelcast-jet-management-center" -o jsonpath="{.items[0].metadata.name}") + $ kubectl port-forward --namespace {{ .Release.Namespace }} $POD 8081:8081 + *) Open Browser at: http://127.0.0.1:8081 +{{- else if contains "NodePort" .Values.managementcenter.service.type }} + *) Check Node IP and Port: + $ export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + $ export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "hazelcast-jet-management-center.fullname" . }}) + *) Open Browser at: http://$NODE_IP:$NODE_PORT/ +{{- end }} +{{- end }} diff --git a/stable/hazelcast-jet/templates/_helpers.tpl b/stable/hazelcast-jet/templates/_helpers.tpl index 90fee52cdd..d8c89921db 100644 --- a/stable/hazelcast-jet/templates/_helpers.tpl +++ b/stable/hazelcast-jet/templates/_helpers.tpl @@ -41,3 +41,13 @@ Create the name of the service account to use {{ default "default" .Values.serviceAccount.name }} {{- end -}} {{- end -}} + + +{{/* +Create a default fully qualified Hazelcast Jet Management Center app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "hazelcast-jet-management-center.fullname" -}} +{{ (include "hazelcast-jet.fullname" .) | trunc 45 | }}-management-center +{{- end -}} diff --git a/stable/hazelcast-jet/templates/config.yaml b/stable/hazelcast-jet/templates/config.yaml index 62c2710fca..7c18029d09 100644 --- a/stable/hazelcast-jet/templates/config.yaml +++ b/stable/hazelcast-jet/templates/config.yaml @@ -1,4 +1,4 @@ -{{- if .Values.jet.configurationFiles }} +{{- if or .Values.jet.configurationFiles .Values.jet.yaml }} apiVersion: v1 kind: ConfigMap metadata: @@ -13,4 +13,11 @@ data: {{ $key }}: |- {{ $val | indent 4}} {{- end }} + hazelcast.yaml: |- + hazelcast: +{{ toYaml .Values.jet.yaml.hazelcast | indent 5 }} +{{ $jetYaml := index .Values "jet" "yaml" "hazelcast-jet"}} + hazelcast-jet.yaml: |- + hazelcast-jet: +{{ toYaml $jetYaml | indent 5 }} {{- end -}} diff --git a/stable/hazelcast-jet/templates/management-center-config.yaml b/stable/hazelcast-jet/templates/management-center-config.yaml new file mode 100644 index 0000000000..30f74e9cb4 --- /dev/null +++ b/stable/hazelcast-jet/templates/management-center-config.yaml @@ -0,0 +1,18 @@ +{{- if or .Values.managementcenter.configurationFiles .Values.managementcenter.yaml}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "hazelcast-jet-management-center.fullname" . }}-configuration + labels: + app.kubernetes.io/name: {{ template "hazelcast-jet.name" . }} + helm.sh/chart: {{ template "hazelcast-jet.chart" . }} + app.kubernetes.io/instance: "{{ .Release.Name }}" + app.kubernetes.io/managed-by: "{{ .Release.Service }}" +data: +{{- range $key, $val := .Values.managementcenter.configurationFiles }} + {{ $key }}: |- +{{ $val | indent 4}} +{{- end }} + hazelcast-client.yaml: |- +{{ toYaml .Values.managementcenter.yaml | indent 4 }} +{{- end -}} diff --git a/stable/hazelcast-jet/templates/management-center-deployment.yaml b/stable/hazelcast-jet/templates/management-center-deployment.yaml new file mode 100644 index 0000000000..c993e55bae --- /dev/null +++ b/stable/hazelcast-jet/templates/management-center-deployment.yaml @@ -0,0 +1,95 @@ +{{- if .Values.managementcenter.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "hazelcast-jet-management-center.fullname" . }} + labels: + app.kubernetes.io/name: {{ template "hazelcast-jet.name" . }} + helm.sh/chart: {{ template "hazelcast-jet.chart" . }} + app.kubernetes.io/instance: "{{ .Release.Name }}" + app.kubernetes.io/managed-by: "{{ .Release.Service }}" +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: {{ template "hazelcast-jet.name" . }} + helm.sh/chart: {{ template "hazelcast-jet.chart" . }} + app.kubernetes.io/instance: "{{ .Release.Name }}" + app.kubernetes.io/managed-by: "{{ .Release.Service }}" + role: hazelcast-jet-management-center + template: + metadata: + labels: + app.kubernetes.io/name: {{ template "hazelcast-jet.name" . }} + helm.sh/chart: {{ template "hazelcast-jet.chart" . }} + app.kubernetes.io/instance: "{{ .Release.Name }}" + app.kubernetes.io/managed-by: "{{ .Release.Service }}" + role: hazelcast-jet-management-center + spec: + {{- if .Values.managementcenter.image.pullSecrets }} + imagePullSecrets: + {{- range .Values.managementcenter.image.pullSecrets }} + - name: {{ . }} + {{- end}} + {{- end}} + {{- if .Values.managementcenter.nodeSelector }} + nodeSelector: +{{ toYaml .Values.managementcenter.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.securityContext.enabled }} + securityContext: + runAsUser: {{ .Values.securityContext.runAsUser }} + fsGroup: {{ .Values.securityContext.fsGroup }} + {{- end }} + containers: + - name: {{ template "hazelcast-jet-management-center.fullname" . }} + image: "{{ .Values.managementcenter.image.repository }}:{{ .Values.managementcenter.image.tag }}" + imagePullPolicy: {{ .Values.managementcenter.image.pullPolicy | quote }} + resources: +{{ toYaml .Values.managementcenter.resources | indent 10 }} + ports: + - name: mc-port + containerPort: 8081 + {{- if .Values.managementcenter.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: / + port: 8081 + initialDelaySeconds: {{ .Values.managementcenter.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.managementcenter.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.managementcenter.livenessProbe.timeoutSeconds }} + successThreshold: {{ .Values.managementcenter.livenessProbe.successThreshold }} + failureThreshold: {{ .Values.managementcenter.livenessProbe.failureThreshold }} + {{- end }} + {{- if .Values.managementcenter.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: / + port: 8081 + initialDelaySeconds: {{ .Values.managementcenter.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.managementcenter.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.managementcenter.readinessProbe.timeoutSeconds }} + successThreshold: {{ .Values.managementcenter.readinessProbe.successThreshold }} + failureThreshold: {{ .Values.managementcenter.readinessProbe.failureThreshold }} + {{- end }} + volumeMounts: + - name: hazelcast-jet-management-center-storage + mountPath: /data/hazelcast-jet-management-center + env: + - name: MC_LICENSE_KEY + {{- if .Values.managementcenter.licenseKeySecretName }} + valueFrom: + secretKeyRef: + name: {{ .Values.managementcenter.licenseKeySecretName }} + key: key + {{- else }} + value: {{ .Values.managementcenter.licenseKey }} + {{- end }} + - name: JAVA_OPTS + value: " -Djet.clientConfig=/data/hazelcast-jet-management-center/hazelcast-client.yaml -DserviceName={{ template "hazelcast-jet.fullname" . }} -Dnamespace={{ .Release.Namespace }} {{ .Values.managementcenter.javaOpts }}" + serviceAccountName: {{ template "hazelcast-jet.serviceAccountName" . }} + volumes: + - name: hazelcast-jet-management-center-storage + configMap: + name: {{ template "hazelcast-jet-management-center.fullname" . }}-configuration +{{- end -}} diff --git a/stable/hazelcast-jet/templates/management-center-service.yaml b/stable/hazelcast-jet/templates/management-center-service.yaml new file mode 100644 index 0000000000..bf76da921e --- /dev/null +++ b/stable/hazelcast-jet/templates/management-center-service.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "hazelcast-jet-management-center.fullname" . }} + labels: + app.kubernetes.io/name: {{ template "hazelcast-jet.name" . }} + helm.sh/chart: {{ template "hazelcast-jet.chart" . }} + app.kubernetes.io/instance: "{{ .Release.Name }}" + app.kubernetes.io/managed-by: "{{ .Release.Service }}" +spec: + type: {{ .Values.managementcenter.service.type }} + {{- if .Values.managementcenter.service.clusterIP }} + clusterIP: {{ .Values.managementcenter.service.clusterIP }} + {{- end }} + selector: + app.kubernetes.io/name: {{ template "hazelcast-jet.name" . }} + app.kubernetes.io/instance: "{{ .Release.Name }}" + role: hazelcast-jet-management-center + ports: + - protocol: TCP + port: {{ .Values.managementcenter.service.port }} + targetPort: mc-port + name: mc-port diff --git a/stable/hazelcast-jet/templates/statefulset.yaml b/stable/hazelcast-jet/templates/statefulset.yaml index faeaf91383..565cc9d80a 100644 --- a/stable/hazelcast-jet/templates/statefulset.yaml +++ b/stable/hazelcast-jet/templates/statefulset.yaml @@ -51,7 +51,7 @@ spec: {{- if .Values.metrics.enabled }} - name: metrics containerPort: {{ .Values.metrics.service.port }} - {{- end }} + {{- end }} {{- if .Values.livenessProbe.enabled }} livenessProbe: httpGet: diff --git a/stable/hazelcast-jet/templates/tests/test-hazelcast-jet.yaml b/stable/hazelcast-jet/templates/tests/test-hazelcast-jet.yaml index 7ce2b25c24..e8d7ef7cdb 100644 --- a/stable/hazelcast-jet/templates/tests/test-hazelcast-jet.yaml +++ b/stable/hazelcast-jet/templates/tests/test-hazelcast-jet.yaml @@ -19,6 +19,10 @@ spec: securityContext: runAsNonRoot: true runAsUser: 1001 + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 4 }} + {{- end }} containers: - name: "{{ template "hazelcast-jet.fullname" . }}-test" image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" @@ -40,4 +44,4 @@ spec: capabilities: drop: - ALL - restartPolicy: Never \ No newline at end of file + restartPolicy: Never diff --git a/stable/hazelcast-jet/templates/tests/test-management-center.yaml b/stable/hazelcast-jet/templates/tests/test-management-center.yaml new file mode 100644 index 0000000000..0ce528f7bc --- /dev/null +++ b/stable/hazelcast-jet/templates/tests/test-management-center.yaml @@ -0,0 +1,46 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ template "hazelcast-jet-management-center.fullname" . }}-test-{{ randAlphaNum 5 | lower }}" + annotations: + "helm.sh/hook": test-success + "helm.sh/hook-delete-policy": hook-succeeded, hook-failed + labels: + app.kubernetes.io/name: {{ template "hazelcast-jet.name" . }} + helm.sh/chart: {{ template "hazelcast-jet.chart" . }} + app.kubernetes.io/instance: "{{ .Release.Name }}" + app.kubernetes.io/managed-by: "{{ .Release.Service }}" + app.kubernetes.io/component: "test" + role: test +spec: + hostNetwork: false + hostPID: false + hostIPC: false + securityContext: + runAsNonRoot: true + runAsUser: 1001 + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 4 }} + {{- end }} + containers: + - name: "{{ template "hazelcast-jet-management-center.fullname" . }}-test" + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + command: + - "bash" + - "-c" + - | + set -ex + # Get the HTTP Response Code of the Deployment + HEALTH_CHECK_HTTP_RESPONSE_CODE=$(curl --write-out %{http_code} --silent --output /dev/null {{ template "hazelcast-jet-management-center.fullname" . }}:{{ .Values.managementcenter.service.port }}/login) + test ${HEALTH_CHECK_HTTP_RESPONSE_CODE} -eq 200 + securityContext: + runAsNonRoot: true + runAsUser: 1001 + privileged: false + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + restartPolicy: Never \ No newline at end of file diff --git a/stable/hazelcast-jet/values.yaml b/stable/hazelcast-jet/values.yaml index a68d918885..7fd01dbeec 100644 --- a/stable/hazelcast-jet/values.yaml +++ b/stable/hazelcast-jet/values.yaml @@ -28,54 +28,58 @@ jet: rest: true # javaOpts are additional JAVA_OPTS properties for Hazelcast Jet member javaOpts: - # configurationFiles are Hazelcast Jet configuration files - configurationFiles: - hazelcast.yaml: |- - hazelcast: - network: - join: - multicast: - enabled: false - kubernetes: - enabled: true - namespace: ${namespace} - service-name: ${serviceName} - resolve-not-ready-addresses: true - hazelcast-jet.yaml: |- - hazelcast-jet: - instance: - # period between flow control packets in milliseconds - flow-control-period: 100 - # number of backup copies to configure for Hazelcast IMaps used internally in a Jet job - backup-count: 1 - # the delay after which auto-scaled jobs will restart if a new member is added to the - # cluster. The default is 10 seconds. Has no effect on jobs with auto scaling disabled - scale-up-delay-millis: 10000 - # Sets whether lossless job restart is enabled for the node. With - # lossless restart you can restart the whole cluster without losing the - # jobs and their state. The feature is implemented on top of the Hot - # Restart feature of Hazelcast IMDG which persists the data to disk. - lossless-restart-enabled: false - edge-defaults: - # capacity of the concurrent SPSC queue between each two processors - queue-size: 1024 - # network packet size limit in bytes, only applies to distributed edges - packet-size-limit: 16384 - # receive window size multiplier, only applies to distributed edges - receive-window-multiplier: 3 - metrics: - # whether metrics collection is enabled - enabled: true - # whether jmx mbean metrics collection is enabled - jmx-enabled: true - # the number of seconds the metrics will be retained on the instance - retention-seconds: 120 - # the metrics collection interval in seconds - collection-interval-seconds: 5 - # whether metrics should be collected for data structures. Metrics - # collection can have some overhead if there is a large number of data - # structures - metrics-for-data-structures: false + # Jet and Hazelcast IMDG YAML configuration files + yaml: + hazelcast: + network: + join: + multicast: + enabled: false + kubernetes: + enabled: true + service-name: ${serviceName} + namespace: ${namespace} + resolve-not-ready-addresses: true + management-center: + enabled: ${hazelcast.mancenter.enabled} + url: ${hazelcast.mancenter.url} + hazelcast-jet: + instance: + # period between flow control packets in milliseconds + flow-control-period: 100 + # number of backup copies to configure for Hazelcast IMaps used internally in a Jet job + backup-count: 1 + # the delay after which auto-scaled jobs will restart if a new member is added to the + # cluster. The default is 10 seconds. Has no effect on jobs with auto scaling disabled + scale-up-delay-millis: 10000 + # Sets whether lossless job restart is enabled for the node. With + # lossless restart you can restart the whole cluster without losing the + # jobs and their state. The feature is implemented on top of the Hot + # Restart feature of Hazelcast IMDG which persists the data to disk. + lossless-restart-enabled: false + edge-defaults: + # capacity of the concurrent SPSC queue between each two processors + queue-size: 1024 + # network packet size limit in bytes, only applies to distributed edges + packet-size-limit: 16384 + # receive window size multiplier, only applies to distributed edges + receive-window-multiplier: 3 + metrics: + # whether metrics collection is enabled + enabled: true + # whether jmx mbean metrics collection is enabled + jmx-enabled: true + # the number of seconds the metrics will be retained on the instance + retention-seconds: 120 + # the metrics collection interval in seconds + collection-interval-seconds: 5 + # whether metrics should be collected for data structures. Metrics + # collection can have some overhead if there is a large number of data + # structures + metrics-for-data-structures: false + + # configurationFiles are any additional Hazelcast Jet configuration files + # configurationFiles: # nodeSelector is an array of Hazelcast Node labels for POD assignments # ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector @@ -133,6 +137,7 @@ service: # It is required if DNS Lookup is used (https://github.com/hazelcast/hazelcast-kubernetes#dns-lookup) # clusterIP: "None" + # Role-based Access Control rbac: # Specifies whether RBAC resources should be created @@ -164,3 +169,97 @@ metrics: annotations: prometheus.io/scrape: "true" prometheus.io/path: "/metrics" + +# Hazelcast Jet Management Center application properties +managementcenter: + # enabled is a flag to enable Hazelcast Jet Management Center application + enabled: true + ## Hazelcast Jet Management Center image version + ## ref: https://hub.docker.com/r/hazelcast/hazelcast-jet-management-center/tags/ + ## + image: + # 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: "3.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 + # + pullPolicy: IfNotPresent + # pullSecrets is an array of docker-registry secret names + # Secrets must be manually created in the namespace. + # ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + # pullSecrets: + # - myRegistryKeySecretName + + # javaOpts are additional JAVA_OPTS properties for Hazelcast Jet Management Center + javaOpts: + + # licenseKey is the license key for Hazelcast Jet Management Center + # if not provided, it can be filled in the Management Center web interface + licenseKey: + # licenseKeySecretName is the name of the secret where the Hazelcast Jet Management Center License Key is stored (can be used instead of licenseKey) + # licenseKeySecretName: + + # nodeSelector is an array of Hazelcast Jet Management Center Node labels for POD assignments + # ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector + nodeSelector: {} + + # Jet Client configuration YAML file which will be used by Hazelcast Jet Management Center + yaml: + hazelcast-client: + network: + kubernetes: + enabled: true + namespace: ${namespace} + service-name: ${serviceName} + resolve-not-ready-addresses: true + + # configurationFiles are any additional Hazelcast Jet Client configuration files + # configurationFiles: + + # Configure resource requests and limits + # ref: http://kubernetes.io/docs/user-guide/compute-resources/ + # + # resources: + # requests: + # memory: 256Mi + # cpu: 100m + + # Hazelcast Jet Management Center Service properties + service: + # type defines the Kubernetes service type ('ClusterIP', 'LoadBalancer', or 'NodePort') + type: LoadBalancer + # port is the Kubernetes service port + port: 8081 + + # Hazelcast Jet Management Center Liveness probe + livenessProbe: + # enabled is a flag to used to enable liveness probe + enabled: true + # initialDelaySeconds is a delay before liveness probe is initiated + initialDelaySeconds: 30 + # periodSeconds decides how often to perform the probe + periodSeconds: 10 + # timeoutSeconds decides when the probe times out + timeoutSeconds: 5 + # successThreshold is the minimum consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + # failureThreshold is the minimum consecutive failures for the probe to be considered failed after having succeeded + failureThreshold: 3 + + # Hazelcast Jet Management Center Readiness probe + readinessProbe: + # enabled is a flag to used to enable readiness probe + enabled: true + # initialDelaySeconds is a delay before readiness probe is initiated + initialDelaySeconds: 30 + # periodSeconds decides how often to perform the probe + periodSeconds: 10 + # timeoutSeconds decides when the probe times out + timeoutSeconds: 1 + # successThreshold is the minimum consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + # failureThreshold is the minimum consecutive failures for the probe to be considered failed after having succeeded + failureThreshold: 3