Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Hazelcast scaling in Kubernetes #63

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions k8s/devicehive/templates/devicehive-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ rules:
- apiGroups:
- ""
resources:
- endpoints
- pods
verbs:
- get
Expand Down
54 changes: 54 additions & 0 deletions k8s/devicehive/templates/dh-hazelcast-conf.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ .Release.Name }}-devicehive-hazelcast-conf
data:
hazelcast.xml: |-
<?xml version="1.0" encoding="UTF-8"?>
<hazelcast xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.hazelcast.com/schema/config
http://www.hazelcast.com/schema/config/hazelcast-config-3.10.xsd">
<properties>
<property name="hazelcast.discovery.enabled">true</property>
</properties>

<serialization>
<portable-version>0</portable-version>
<portable-factories>
<portable-factory factory-id="1">com.devicehive.model.DevicePortableFactory</portable-factory>
</portable-factories>
</serialization>
<map name="default">
<eviction-policy>LRU</eviction-policy>
</map>
<map name="NOTIFICATIONS-MAP">
<time-to-live-seconds>120</time-to-live-seconds>
</map>
<map name="COMMANDS-MAP">
<time-to-live-seconds>120</time-to-live-seconds>
</map>
<multimap name="default">
<backup-count>0</backup-count>
<async-backup-count>1</async-backup-count>
<value-collection-type>SET</value-collection-type>
</multimap>
<management-center enabled="false">
http://127.0.0.1:8090/mancenter
</management-center>

<network>
<join>
<multicast enabled="false"/>
<tcp-ip enabled="false" />
<discovery-strategies>
<discovery-strategy enabled="true" class="com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy">
<properties>
<property name="service-name">{{ .Release.Name }}-devicehive-hazelcast</property>
<property name="namespace">{{ .Release.Namespace }}</property>
</properties>
</discovery-strategy>
</discovery-strategies>
</join>
</network>
</hazelcast>
8 changes: 8 additions & 0 deletions k8s/devicehive/templates/dh-hazelcast-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down