Skip to content

Commit

Permalink
fix: split hz config for cluster and cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jhaeyaert authored and mariano-fernandez committed Aug 1, 2024
1 parent c101b1e commit d4729c4
Show file tree
Hide file tree
Showing 20 changed files with 205 additions and 105 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ commands:
steps:
- run:
name: install helm-unittest plugin
command: helm plugin install https://github.com/quintush/helm-unittest --version 0.2.11
command: helm plugin install https://github.com/helm-unittest/helm-unittest.git --version 0.5.1

execute-tests:
description: execute the unit tests of the folder
Expand All @@ -29,7 +29,7 @@ commands:
steps:
- run:
name: execute the units tests in << parameters.folder >>.
command: helm unittest -3 -f '<< parameters.files >>' << parameters.folder >> -t JUnit -o << parameters.output-file >>
command: helm unittest -f '<< parameters.files >>' << parameters.folder >> -t JUnit -o << parameters.output-file >>
lint:
description: Lint the helm charts available in the folder
parameters:
Expand All @@ -50,7 +50,7 @@ jobs:
steps:
- checkout
- helm/install-helm-client:
version: v3.7.1
version: v3.15.3
- install-helm-unittest
- lint:
folder: cockpit
Expand All @@ -73,7 +73,7 @@ jobs:
steps:
- checkout
- helm/install-helm-client:
version: v3.7.1
version: v3.15.3
- lint:
folder: << parameters.folder >>

Expand Down
4 changes: 4 additions & 0 deletions cockpit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This file documents all notable changes to [Gravitee.io Cockpit](https://github.com/gravitee-io/helm-charts/tree/master/cockpit) Helm Chart. The release numbering uses [semantic versioning](http://semver.org).

### 2.0.1

- [X] Split hazecast configuration for cache and cluster

### 2.0.0

- [X] Add new configuration for controller
Expand Down
49 changes: 42 additions & 7 deletions cockpit/templates/api/api-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ data:
cluster:
type: hazelcast
hazelcast:
config-path: ${gravitee.home}/config/hazelcast.xml
config-path: ${gravitee.home}/config/hazelcast-cluster.xml
cache:
type: hazelcast
hazelcast:
config-path: ${gravitee.home}/config/hazelcast.xml
config-path: ${gravitee.home}/config/hazelcast-cache.xml
exchange:
controller:
Expand Down Expand Up @@ -284,13 +284,13 @@ data:
{{ toYaml .Values.authentication.oidc | indent 8 }}
{{- end }}

hazelcast.xml: |-
hazelcast-cluster.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-5.3.xsd">
<cluster-name>graviteeio-cockpit</cluster-name>
<cluster-name>graviteeio-cockpit-cluster</cluster-name>
<properties>
<property name="hazelcast.discovery.enabled">true</property>
<property name="hazelcast.max.wait.seconds.before.join">3</property>
Expand All @@ -299,12 +299,45 @@ data:
<property name="hazelcast.logging.type">slf4j</property>
</properties>
<queue name="exchange-cluster-command-*">
<queue name="exchange-*">
<backup-count>0</backup-count>
<async-backup-count>1</async-backup-count>
<empty-queue-ttl>300</empty-queue-ttl>
</queue>
<map name="exchange-controller-primary-channel-candidate">
<cp-subsystem>
<cp-member-count>0</cp-member-count>
</cp-subsystem>
<network>
<port>5701</port>
<join>
<multicast enabled="false"/>
<tcp-ip enabled="false"/>
<kubernetes enabled="true">
<namespace>{{ .Release.Namespace }}</namespace>
<service-name>{{ template "gravitee.api.fullname" . }}-hz</service-name>
<service-port>5701</service-port>
</kubernetes>
</join>
</network>
</hazelcast>
hazelcast-cache.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-5.3.xsd">
<cluster-name>graviteeio-cockpit-cache</cluster-name>
<properties>
<property name="hazelcast.discovery.enabled">true</property>
<property name="hazelcast.max.wait.seconds.before.join">3</property>
<property name="hazelcast.member.list.publish.interval.seconds">5</property>
<property name="hazelcast.socket.client.bind.any">false</property>
<property name="hazelcast.logging.type">slf4j</property>
</properties>
<map name="exchange-*">
<backup-count>0</backup-count>
<async-backup-count>1</async-backup-count>
</map>
Expand All @@ -314,12 +347,14 @@ data:
</cp-subsystem>
<network>
<port>5702</port>
<join>
<multicast enabled="false"/>
<tcp-ip enabled="false"/>
<kubernetes enabled="true">
<namespace>{{ .Release.Namespace }}</namespace>
<service-name>{{ template "gravitee.api.fullname" . }}</service-name>
<service-name>{{ template "gravitee.api.fullname" . }}-hz</service-name>
<service-port>5702</service-port>
</kubernetes>
</join>
</network>
Expand Down
8 changes: 4 additions & 4 deletions cockpit/templates/api/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ spec:
mountPath: /opt/gravitee-cockpit-management-api/config/gravitee.yml
subPath: gravitee.yml
- name: config
mountPath: /opt/gravitee-cockpit-management-api/config/hazelcast.xml
subPath: hazelcast.xml
mountPath: /opt/gravitee-cockpit-management-api/config/hazelcast-cluster.xml
subPath: hazelcast-cluster.xml
- name: config
mountPath: /opt/gravitee-cockpit-management-api/config/hazelcast.yml
subPath: hazelcast.yml
mountPath: /opt/gravitee-cockpit-management-api/config/hazelcast-cache.xml
subPath: hazelcast-cache.xml
- name: config
mountPath: /opt/gravitee-cockpit-management-api/config/logback.xml
subPath: logback.xml
Expand Down
32 changes: 32 additions & 0 deletions cockpit/templates/api/api-service-hz.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if and (.Values.api.enabled) (.Values.api.controller.ws.service.enabled) -}}
apiVersion: v1
kind: Service
metadata:
name: {{ template "gravitee.api.fullname" . }}-hz
labels:
app.kubernetes.io/name: {{ template "gravitee.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Values.api.image.tag | default .Chart.AppVersion | quote }}
app.kubernetes.io/component: "{{ .Values.api.name }}"
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
annotations:
{{- range $key, $value := .Values.api.service.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
type: "ClusterIP"
ports:
- port: 5701
targetPort: 5701
protocol: TCP
name: {{ printf "%s-%s" (.Values.api.name | trunc 56 | trimSuffix "-") "hz-cluster" }}
- port: 5702
targetPort: 5702
protocol: TCP
name: {{ printf "%s-%s" (.Values.api.name | trunc 56 | trimSuffix "-") "hz-cache" }}
selector:
app.kubernetes.io/name: {{ template "gravitee.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: "{{ .Values.api.name }}"
{{- end -}}
Loading

0 comments on commit d4729c4

Please sign in to comment.