Skip to content

Commit

Permalink
Merge pull request #154 from camunda-community-hub/zell-rework-config…
Browse files Browse the repository at this point in the history
…-map

Rework config map's
  • Loading branch information
Zelldon committed Feb 4, 2022
2 parents 7d70c84 + 7a75a77 commit 8692485
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 47 deletions.
30 changes: 0 additions & 30 deletions charts/ccsm-helm/charts/zeebe-gateway/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,6 @@ metadata:
labels: {{- include "zeebe.labels.gateway" . | nindent 4 }}
apiVersion: v1
data:
startup.sh: |
#!/usr/bin/env bash
set -eux -o pipefail
export ZEEBE_BROKER_NETWORK_ADVERTISEDHOST=${ZEEBE_BROKER_NETWORK_ADVERTISEDHOST:-$(hostname -f)}
export ZEEBE_BROKER_CLUSTER_NODEID=${ZEEBE_BROKER_CLUSTER_NODEID:-${K8S_POD_NAME##*-}}
# As the number of replicas or the DNS is not obtainable from the downward API yet,
# defined them here based on conventions
export ZEEBE_BROKER_CLUSTER_CLUSTERSIZE=${ZEEBE_BROKER_CLUSTER_CLUSTERSIZE:-1}
contactPointPrefix=${K8S_POD_NAME%-*}
contactPoints=${ZEEBE_BROKER_CLUSTER_INITIALCONTACTPOINTS:-""}
if [[ -z "${contactPoints}" ]]; then
for ((i=0; i<${ZEEBE_BROKER_CLUSTER_CLUSTERSIZE}; i++))
do
contactPoints="${contactPoints},${contactPointPrefix}-$i.$(hostname -d):{{ .Values.service.internalPort }}"
done
export ZEEBE_BROKER_CLUSTER_INITIALCONTACTPOINTS="${contactPoints}"
fi
if [ "$(ls -A /exporters/)" ]; then
mkdir /usr/local/zeebe/exporters/
cp -a /exporters/*.jar /usr/local/zeebe/exporters/
else
echo "No exporters available."
fi
exec /usr/local/zeebe/bin/broker
gateway-log4j2.xml: |
{{- if .Values.log4j2 }}
{{ .Values.log4j2 | indent 4 | trim }}
Expand Down
20 changes: 3 additions & 17 deletions charts/ccsm-helm/charts/zeebe/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,16 @@ data:
#!/usr/bin/env bash
set -eux -o pipefail
export ZEEBE_BROKER_NETWORK_ADVERTISEDHOST=${ZEEBE_BROKER_NETWORK_ADVERTISEDHOST:-$(hostname -f)}
export ZEEBE_BROKER_CLUSTER_NODEID=${ZEEBE_BROKER_CLUSTER_NODEID:-${K8S_POD_NAME##*-}}
export ZEEBE_BROKER_CLUSTER_NODEID=${ZEEBE_BROKER_CLUSTER_NODEID:-${K8S_NAME##*-}}
# As the number of replicas or the DNS is not obtainable from the downward API yet,
# defined them here based on conventions
export ZEEBE_BROKER_CLUSTER_CLUSTERSIZE=${ZEEBE_BROKER_CLUSTER_CLUSTERSIZE:-1}
contactPointPrefix=${K8S_POD_NAME%-*}
contactPoints=${ZEEBE_BROKER_CLUSTER_INITIALCONTACTPOINTS:-""}
if [[ -z "${contactPoints}" ]]; then
for ((i=0; i<${ZEEBE_BROKER_CLUSTER_CLUSTERSIZE}; i++))
do
contactPoints="${contactPoints},${contactPointPrefix}-$i.$(hostname -d):{{ .Values.service.internalPort }}"
done
export ZEEBE_BROKER_CLUSTER_INITIALCONTACTPOINTS="${contactPoints}"
fi
if [ "$(ls -A /exporters/)" ]; then
mkdir /usr/local/zeebe/exporters/
cp -a /exporters/*.jar /usr/local/zeebe/exporters/
else
else
echo "No exporters available."
fi
env
exec /usr/local/zeebe/bin/broker
application.yaml: |
Expand Down
17 changes: 17 additions & 0 deletions charts/ccsm-helm/charts/zeebe/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,23 @@ spec:
env:
- name: LC_ALL
value: C.UTF-8
- name: K8S_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: K8S_SERVICE_NAME
value: {{ include "zeebe.names.broker" . }}
- name: K8S_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: ZEEBE_BROKER_NETWORK_ADVERTISEDHOST
value: "$(K8S_NAME).$(K8S_SERVICE_NAME).$(K8S_NAMESPACE).svc.cluster.local"
- name: ZEEBE_BROKER_CLUSTER_INITIALCONTACTPOINTS
value:
{{- range (untilStep 0 (int .Values.clusterSize) 1) }}
$(K8S_SERVICE_NAME)-{{ . }}.$(K8S_SERVICE_NAME).$(K8S_NAMESPACE).svc.cluster.local,
{{- end }}
- name: ZEEBE_BROKER_CLUSTER_CLUSTERNAME
value: {{ tpl .Values.global.zeebeClusterName . }}
- name: ZEEBE_LOG_LEVEL
Expand Down

0 comments on commit 8692485

Please sign in to comment.