From d6de36d5c4d10c408e071eba03efc11cb9316f04 Mon Sep 17 00:00:00 2001 From: Alexander Sitnik Date: Fri, 24 Aug 2018 13:25:35 +0300 Subject: [PATCH 1/2] k8s: configmap for hazelcast kubernetes --- CHANGELOG.md | 1 + .../templates/dh-hazelcast-conf.xml | 54 +++++++++++++++++++ .../templates/dh-hazelcast-deployment.yaml | 8 +++ 3 files changed, 63 insertions(+) create mode 100644 k8s/devicehive/templates/dh-hazelcast-conf.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index a39174d..0e56dce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Add CoAP-WebSockets proxy deployment and service in chart * Remove separate switch for deploying external WebSocket proxy. It is requred for Plugin management service and must be deployed if it is enabled. * Add top level Ingress in chart Notes +* Add Hazelcast config for enabling discovery in Kubernetes ### Docker Compose * Add compose file for CoAP-WebSockets proxy diff --git a/k8s/devicehive/templates/dh-hazelcast-conf.xml b/k8s/devicehive/templates/dh-hazelcast-conf.xml new file mode 100644 index 0000000..99458b8 --- /dev/null +++ b/k8s/devicehive/templates/dh-hazelcast-conf.xml @@ -0,0 +1,54 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: {{ .Release.Name }}-devicehive-hazelcast-conf +data: + hazelcast.xml: |- + + + + true + + + + 0 + + com.devicehive.model.DevicePortableFactory + + + + LRU + + + 120 + + + 120 + + + 0 + 1 + SET + + + http://127.0.0.1:8090/mancenter + + + + + + + + + + {{ .Release.Name }}-devicehive-hazelcast + {{ .Release.Namespace }} + + + + + + diff --git a/k8s/devicehive/templates/dh-hazelcast-deployment.yaml b/k8s/devicehive/templates/dh-hazelcast-deployment.yaml index 94644f1..d207c49 100644 --- a/k8s/devicehive/templates/dh-hazelcast-deployment.yaml +++ b/k8s/devicehive/templates/dh-hazelcast-deployment.yaml @@ -29,6 +29,14 @@ spec: containerPort: 5701 resources: {{ toYaml .Values.javaServer.hazelcast.resources | indent 10 }} + volumeMounts: + - name: hazelcast-xml + mountPath: /opt/hazelcast/hazelcast.xml + subPath: hazelcast.xml + volumes: + - name: hazelcast-xml + configMap: + name: {{ .Release.Name }}-devicehive-hazelcast-conf {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} From ed3aa9ea73015887221ab4f2a4ede33ce726b0ea Mon Sep 17 00:00:00 2001 From: Alexander Sitnik Date: Sat, 9 Jun 2018 15:32:02 +0300 Subject: [PATCH 2/2] k8s: fix role for devicehive-hazelcast discovery --- k8s/devicehive/templates/devicehive-role.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/k8s/devicehive/templates/devicehive-role.yaml b/k8s/devicehive/templates/devicehive-role.yaml index 4587b51..f4de76b 100644 --- a/k8s/devicehive/templates/devicehive-role.yaml +++ b/k8s/devicehive/templates/devicehive-role.yaml @@ -11,6 +11,7 @@ rules: - apiGroups: - "" resources: + - endpoints - pods verbs: - get