Advanced network support (#81) (#18995)

Signed-off-by: devOpsHelm <devops+1@hazelcast.com>
This commit is contained in:
devOpsHelm
2019-11-19 06:35:42 -08:00
committed by Kubernetes Prow Robot
parent 90590531b8
commit ffe8102834
5 changed files with 49 additions and 50 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: hazelcast
version: 2.8.0
version: 2.9.0
appVersion: "3.12.4"
tillerVersion: ">=2.7.2"
kubeVersion: ">=1.9.0-0"
+30 -6
View File
@@ -95,8 +95,6 @@ their default values.
|`+cluster.memberCount+` |Number of Hazelcast members |2
|`+hazelcast.rest+` |Enable REST endpoints for Hazelcast member |`+true+`
|`+hazelcast.javaOpts+` |Additional JAVA_OPTS properties for Hazelcast member
|`+nil+`
@@ -138,6 +136,10 @@ to be considered successful after having failed |`+1+`
|`+livenessProbe.failureThreshold+` |Minimum consecutive failures for the probe
to be considered failed after having succeeded. |`+3+`
|`+livenessProbe.path+` |URL path that will be called to check liveness. |`+/hazelcast/health/node-state+`
|`+livenessProbe.port+` |Port that will be used in liveness probe calls. |`+nil+`
|`+readinessProbe.enabled+` |Turn on and off readiness probe |`+true+`
|`+readinessProbe.initialDelaySeconds+` |Delay before readiness probe is
@@ -153,6 +155,10 @@ 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+`
|`+readinessProbe.path+` |URL path that will be called to check readiness. |`+/hazelcast/health/ready+`
|`+readinessProbe.port+` |Port that will be used in readiness probe calls. |`+nil+`
|`+resources.limits.cpu+` |CPU resource limit |`+default+`
|`+resources.limits.memory+` |Memory resource limit |`+default+`
@@ -301,7 +307,7 @@ ifeval::["{repo}"=="hazelcast/charts"]
[source,bash]
----
$ helm install --name my-release \
--set cluster.memberCount=3,hazelcast.rest=false \
--set cluster.memberCount=3 \
hazelcast/hazelcast
----
endif::[]
@@ -310,13 +316,12 @@ ifeval::["{repo}"=="helm/charts"]
[source,bash]
----
$ helm install --name my-release \
--set cluster.memberCount=3,hazelcast.rest=false \
--set cluster.memberCount=3 \
stable/hazelcast
----
endif::[]
The above command sets number of Hazelcast members to 3 and disables REST
endpoints.
The above command sets number of Hazelcast members to 3.
Alternatively, a YAML file that specifies the values for the parameters can be
provided while installing the chart. For example,
@@ -361,3 +366,22 @@ hazelcast:
resolve-not-ready-addresses: true
<!-- Custom Configuration Placeholder -->
----
== Notable changes
=== 2.8.0
Hazelcast REST Endpoints are no longer enabled by default and the parameter `hazelcast.rest` is no longer available. If you want to enable REST, please add the related `endpoint-groups` to the Hazelcast Configuration. For example:
[source,yaml]
----
rest-api:
enabled: true
endpoint-groups:
HEALTH_CHECK:
enabled: true
CLUSTER_READ:
enabled: true
CLUSTER_WRITE:
enabled: true
----
-36
View File
@@ -5,14 +5,6 @@
To access Hazelcast within the Kubernetes cluster:
- Use Hazelcast Client with Kubernetes Discovery Strategy. Read more at: https://github.com/hazelcast/hazelcast-kubernetes.
{{- if .Values.hazelcast.rest }}
- Use REST endpoint:
*) Insert Data:
$ curl -v -X POST -H "Content-Type: text/plain" -d "bar" http://{{ template "hazelcast.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}/hazelcast/rest/maps/mapName/foo
*) Get Data:
$ curl http://{{ template "hazelcast.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}/hazelcast/rest/maps/mapName/foo
{{- end }}
-------------------------------------------------------------------------------
@@ -40,34 +32,6 @@ To access Hazelcast from outside the Kubernetes cluster:
clientConfig.getNetworkConfig().setSmartRouting(false);
clientConfig.getNetworkConfig().addAddress("$NODE_IP:$NODE_PORT");
{{- end }}
{{- if .Values.hazelcast.rest }}
- Use REST endpoint:
{{- if contains "LoadBalancer" .Values.service.type }}
*) Check service external IP:
$ export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "hazelcast.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
*) Insert Data:
$ curl -v -X POST -H "Content-Type: text/plain" -d "bar" http://$SERVICE_IP:{{ .Values.service.port }}/hazelcast/rest/maps/mapName/foo
*) Get Data:
$ curl http://$SERVICE_IP:{{ .Values.service.port }}/hazelcast/rest/maps/mapName/foo
{{- else if contains "ClusterIP" .Values.service.type }}
*) Forward port from POD:
$ export POD=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "hazelcast.name" . }},role=hazelcast" -o jsonpath="{.items[0].metadata.name}")
$ kubectl port-forward --namespace {{ .Release.Namespace }} $POD 5701:{{ .Values.service.port }}
*) Insert Data:
$ curl -v -X POST -H "Content-Type: text/plain" -d "bar" http://127.0.0.1:5701/hazelcast/rest/maps/mapName/foo
*) Get Data:
$ curl http://127.0.0.1:5701/hazelcast/rest/maps/mapName/foo
{{- else if contains "NodePort" .Values.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.fullname" . }})
*) Insert Data:
$ curl -v -X POST -H "Content-Type: text/plain" -d "bar" http://$NODE_IP:$NODE_PORT/hazelcast/rest/maps/mapName/foo
*) Get Data:
$ curl http://$NODE_IP:$NODE_PORT/hazelcast/rest/maps/mapName/foo
{{- end }}
{{- end }}
{{- if .Values.mancenter.enabled }}
+5 -5
View File
@@ -69,8 +69,8 @@ spec:
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /hazelcast/health/node-state
port: {{ if .Values.hostPort }}{{ .Values.hostPort }}{{ else }}5701{{ end }}
path: {{ .Values.livenessProbe.path }}
port: {{ if .Values.livenessProbe.port }}{{ .Values.livenessProbe.port }}{{ else if .Values.hostPort }}{{ .Values.hostPort }}{{ else }}5701{{ end }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
@@ -80,8 +80,8 @@ spec:
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /hazelcast/health/node-state
port: {{ if .Values.hostPort }}{{ .Values.hostPort }}{{ else }}5701{{ end }}
path: {{ .Values.readinessProbe.path }}
port: {{ if .Values.readinessProbe.port }}{{ .Values.readinessProbe.port }}{{ else if .Values.hostPort }}{{ .Values.hostPort }}{{ else }}5701{{ end }}
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
@@ -105,7 +105,7 @@ spec:
value: "{{ .Values.metrics.service.port }}"
{{- end }}
- name: JAVA_OPTS
value: "-Dhazelcast.rest.enabled={{ .Values.hazelcast.rest }} -Dhazelcast.config=/data/hazelcast/hazelcast.yaml -DserviceName={{ template "hazelcast.serviceName" . }} -Dnamespace={{ .Release.Namespace }} -Dhazelcast.mancenter.enabled={{ .Values.mancenter.enabled }} -Dhazelcast.mancenter.url=http://{{ template "mancenter.fullname" . }}:{{ .Values.mancenter.service.port }}/hazelcast-mancenter {{ if .Values.gracefulShutdown.enabled }}-Dhazelcast.shutdownhook.policy=GRACEFUL -Dhazelcast.shutdownhook.enabled=true -Dhazelcast.graceful.shutdown.max.wait={{ .Values.gracefulShutdown.maxWaitSeconds }} {{ end }} {{ if .Values.metrics.enabled }}-Dhazelcast.jmx=true{{ end }} {{ .Values.hazelcast.javaOpts }}"
value: "-Dhazelcast.config=/data/hazelcast/hazelcast.yaml -DserviceName={{ template "hazelcast.serviceName" . }} -Dnamespace={{ .Release.Namespace }} -Dhazelcast.mancenter.enabled={{ .Values.mancenter.enabled }} -Dhazelcast.mancenter.url=http://{{ template "mancenter.fullname" . }}:{{ .Values.mancenter.service.port }}/hazelcast-mancenter {{ if .Values.gracefulShutdown.enabled }}-Dhazelcast.shutdownhook.policy=GRACEFUL -Dhazelcast.shutdownhook.enabled=true -Dhazelcast.graceful.shutdown.max.wait={{ .Values.gracefulShutdown.maxWaitSeconds }} {{ end }} {{ if .Values.metrics.enabled }}-Dhazelcast.jmx=true{{ end }} {{ .Values.hazelcast.javaOpts }}"
{{- if .Values.securityContext.enabled }}
securityContext:
runAsNonRoot: {{ if eq (int .Values.securityContext.runAsUser) 0 }}false{{ else }}true{{ end }}
+13 -2
View File
@@ -24,8 +24,6 @@ cluster:
# Hazelcast properties
hazelcast:
# rest is a flag used to enable REST endpoints for Hazelcast member
rest: true
# javaOpts are additional JAVA_OPTS properties for Hazelcast member
javaOpts:
# existingConfigMap defines a ConfigMap which contains Hazelcast configuration file(s) that are used instead hazelcast.yaml configuration below
@@ -42,6 +40,11 @@ hazelcast:
service-name: ${serviceName}
namespace: ${namespace}
resolve-not-ready-addresses: true
rest-api:
enabled: true
endpoint-groups:
HEALTH_CHECK:
enabled: true
management-center:
enabled: ${hazelcast.mancenter.enabled}
url: ${hazelcast.mancenter.url}
@@ -94,6 +97,10 @@ livenessProbe:
successThreshold: 1
# failureThreshold is the minimum consecutive failures for the probe to be considered failed after having succeeded
failureThreshold: 10
# url path that will be called to check liveness
path: /hazelcast/health/node-state
# port that will be used in liveness probe calls
# port:
# Hazelcast Readiness probe
readinessProbe:
@@ -109,6 +116,10 @@ readinessProbe:
successThreshold: 1
# failureThreshold is the minimum consecutive failures for the probe to be considered failed after having succeeded
failureThreshold: 10
# url path that will be called to check readiness
path: /hazelcast/health/ready
# port that will be used in readiness probe calls
# port:
# Configure resource requests and limits
# ref: http://kubernetes.io/docs/user-guide/compute-resources/