Skip to content

Commit ecb6436

Browse files
authored
Added Tolerations and Node Affinity
1 parent 3f460d2 commit ecb6436

File tree

7 files changed

+1170
-8
lines changed

7 files changed

+1170
-8
lines changed

.github/workflows/build-test.yml

+33
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,39 @@ jobs:
138138
if [[ -z `curl -sS -u admin:admin http://$url:8080/SEMP -d "<rpc><show><config-sync></config-sync></show></rpc>" | grep "<oper-status>Up</oper-status>"` ]] ; then echo "config-sync not up!"; exit 1; fi
139139
helm list
140140
helm delete $(helm list | grep deployed | awk '{print $1}')
141+
kubectl delete secret test-tls
142+
kubectl delete pvc --all
143+
144+
- name: Test HA broker Toleration
145+
run: |
146+
REPO=solace/solace-pubsub-standard
147+
TAG=latest
148+
kubectl get nodes
149+
#create taint for first node
150+
nodesAll=$(kubectl get nodes --output name) && firstNode=`echo "${nodesAll}" | head -1`
151+
kubectl taint nodes $firstNode scheduleBroker=no:NoSchedule
152+
#confirm node taint
153+
echo "$firstNode has been tainted"
154+
kubectl describe $firstNode | grep scheduleBroker
155+
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout tls.key -out tls.crt -subj "/CN=*"
156+
kubectl create secret tls test-tls --key="tls.key" --cert="tls.crt"
157+
helm install my-release-toleration pubsubplus --set "solace.tolerations[0].key=scheduleBroker,solace.tolerations[0].operator=Equal,solace.tolerations[0].value=no,solace.tolerations[0].effect=NoSchedule,solace.size=dev,solace.redundancy=true,solace.podDisruptionBudgetForHA=true,solace.podModifierEnabled=true,tls.enabled=true,tls.serverCertificatesSecret=test-tls,solace.usernameAdminPassword=admin,image.repository=$REPO,image.tag=$TAG"
158+
kubectl get statefulset,svc,pods,pvc,pv --show-labels
159+
echo "Waiting for broker to become active"
160+
sleep 60; kubectl describe nodes
161+
until kubectl get pods --show-labels | grep pubsubplus-0 | grep -m 1 -E '1/1'; do sleep 10; done
162+
until kubectl get pods --show-labels | grep pubsubplus-1 | grep -m 1 -E '1/1'; do sleep 10; done
163+
until kubectl get pods --show-labels | grep pubsubplus-2 | grep -m 1 -E '1/1'; do sleep 10; done
164+
until kubectl get pods --show-labels | grep pubsubplus- | grep -m 1 -E 'active=true'; do sleep 10; done
165+
bash -c 'if [[ `kubectl get po --show-labels | grep -c "1/1"` -ne 3 ]]; then echo "Some pods are not ready!"; kubectl get po --show-labels; exit 1; fi'
166+
#confirm broker deployment meets toleration requirements
167+
echo "get node confirmation of no resources"
168+
kubectl get pods --all-namespaces -o wide --field-selector spec.nodeName=$firstNode
169+
sleep 30
170+
helm list
171+
helm delete $(helm list | grep deployed | awk '{print $1}')
172+
kubectl taint nodes $firstNode scheduleBroker=no:NoSchedule-
173+
kubectl delete secret test-tls
141174
kubectl delete pvc --all
142175
143176
- name: Create chart variants

docs/PubSubPlusK8SDeployment.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ There are [multiple management tools](//docs.solace.com/Management-Tools.htm ) a
846846

847847
A random admin password will be generated if it has not been provided at deployment using the `solace.usernameAdminPassword` parameter, refer to the the information from `helm status` how to retrieve it.
848848

849-
**Important:** Every time `helm install` or `helm upgrade` is called a new admin password will be generated, which may break an existing deployment. Therefore ensure to always provide the password from the initial deployment as `solace.usernameAdminPassword=<PASSWORD>` parameter to subsequent `install` and `upgrade` commands.
849+
**Important:** Every time `helm install` is called a new admin password will be generated. When reusing PVCs from a previous deployment, be cautious, as this action might generate a new password, potentially disrupting an existing deployment. Therefore, ensure to always provide the password from the initial deployment as `solace.usernameAdminPassword=<PASSWORD>` parameter to subsequent `install` commands.
850850

851851
#### WebUI, SolAdmin and SEMP access
852852

@@ -1013,12 +1013,6 @@ solace:
10131013
redundancy: true
10141014
size: dev
10151015
```
1016-
**Important:** this may not show, but be aware of an additional non-default parameter:
1017-
```
1018-
solace:
1019-
usernameAdminPassword: jMzKoW39zz # The value is just an example
1020-
```
1021-
This has been generated at the initial deployment if not specified and must be used henceforth for all change requests, to keep the same. See related note in the [Admin Password section](#admin-password).
10221016

10231017
#### Upgrade example
10241018

pubsubplus/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
description: Deploy Solace PubSub+ Event Broker Singleton or HA redundancy group onto a Kubernetes Cluster
33
name: pubsubplus
4-
version: 3.3.2
4+
version: 3.3.3
55
icon: https://solaceproducts.github.io/pubsubplus-kubernetes-helm-quickstart/images/PubSubPlus.png
66
kubeVersion: '>= 1.10.0-0'
77
maintainers:

pubsubplus/templates/solaceStatefulSet.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ spec:
3030
{"Pods":[{"metadata":{"name":"{{ template "solace.fullname" . }}-2"},"spec":{"containers": [{"name": "pubsubplus","resources": {"requests": {"cpu": "1","memory": "1965Mi"},"limits": {"cpu": "1","memory": "1965Mi"} }} ] } } ]}
3131
{{- end}}
3232
spec:
33+
{{- if .Values.solace.affinity }}
34+
affinity:
35+
{{ toYaml .Values.solace.affinity | indent 8 }}
36+
{{- end }}
37+
{{- if .Values.solace.tolerations }}
38+
tolerations:
39+
{{ toYaml .Values.solace.tolerations | indent 6 }}
40+
{{- end }}
3341
{{- if .Values.image.pullSecretName }}
3442
imagePullSecrets:
3543
- name: {{ .Values.image.pullSecretName}}

pubsubplus/templates/tests/test-semp-connection.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ metadata:
1010
annotations:
1111
"helm.sh/hook": test
1212
spec:
13+
{{- if .Values.solace.affinity }}
14+
affinity:
15+
{{ toYaml .Values.solace.affinity | indent 4 }}
16+
{{- end }}
17+
{{- if .Values.solace.tolerations }}
18+
tolerations:
19+
{{ toYaml .Values.solace.tolerations | indent 2 }}
20+
{{- end }}
1321
{{- if .Values.image.pullSecretName }}
1422
imagePullSecrets:
1523
- name: {{ .Values.image.pullSecretName}}

0 commit comments

Comments
 (0)