Skip to content

Commit 3282cd1

Browse files
authored
Kubernetes QS v3.2.0 Release (#117)
* Support for PodDisruptionBudget for Broker nodes in High Availability mode - Resolves #107 * Readiness check reliability improvements * Config-sync improvements in High Availability mode * Readiness check clearer logging
1 parent 66142a2 commit 3282cd1

File tree

10 files changed

+155
-45
lines changed

10 files changed

+155
-45
lines changed

.github/workflows/build-test.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
echo "TESTCLUSTERNAME=k8s-gha-test-$(date +%s)" >> $GITHUB_ENV
1919
echo "TESTRUNBRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
2020
#
21-
sudo gem update --system 3.0.6
2221
sudo gem install yaml-lint
2322
sudo snap install kubectl --classic
2423
kubectl version --client
@@ -30,7 +29,7 @@ jobs:
3029
uses: actions/checkout@v2
3130

3231
- name: Set up Cloud SDK
33-
uses: google-github-actions/setup-gcloud@v0
32+
uses: google-github-actions/setup-gcloud@v0.6.0
3433
with:
3534
project_id: ${{ secrets.GCP_PROJECT_ID }}
3635
service_account_key: ${{ secrets.GCP_SA_KEY }}
@@ -49,10 +48,13 @@ jobs:
4948
5049
- name: Setup K8s env in GKE
5150
run: |
51+
gcloud components install gke-gcloud-auth-plugin --quiet
52+
gcloud components update
53+
export USE_GKE_GCLOUD_AUTH_PLUGIN=True
5254
mkdir gke_test; pushd gke_test
5355
wget https://raw.githubusercontent.com/SolaceProducts/solace-gke-quickstart/master/scripts/create_cluster.sh
5456
chmod +x create_cluster.sh
55-
./create_cluster.sh -z us-east4-a,us-east4-b,us-east4-c -c $TESTCLUSTERNAME -m e2-standard-2
57+
./create_cluster.sh -z us-east4-a,us-east4-b,us-east4-c -c $TESTCLUSTERNAME -i ubuntu_containerd -m e2-standard-4
5658
gcloud container clusters get-credentials $TESTCLUSTERNAME --zone us-east4-a --project capable-stream-180018
5759
popd
5860
kubectl get statefulset,svc,pods,pvc,pv
@@ -74,7 +76,7 @@ jobs:
7476
TAG=latest
7577
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout tls.key -out tls.crt -subj "/CN=*"
7678
kubectl create secret tls test-tls --key="tls.key" --cert="tls.crt"
77-
helm install my-release pubsubplus --set solace.size=dev,solace.redundancy=true,solace.podModifierEnabled=true,tls.enabled=true,tls.serverCertificatesSecret=test-tls,solace.usernameAdminPassword=admin,image.repository=$REPO,image.tag=$TAG
79+
helm install my-release pubsubplus --set 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
7880
kubectl get statefulset,svc,pods,pvc,pv --show-labels
7981
echo "Waiting for broker to become active"
8082
sleep 40; kubectl describe nodes
@@ -101,8 +103,11 @@ jobs:
101103
- name: Upgrade HA broker and test
102104
run: |
103105
REPO=solace/solace-pubsub-standard
104-
UPGRADETAG=$(wget -q https://registry.hub.docker.com/v1/repositories/solace/solace-pubsub-standard/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' | sort -t "." -k1,1n -k2,2n -k3,3n | tail -1)
105-
helm upgrade my-release pubsubplus --set solace.size=dev,solace.redundancy=true,solace.podModifierEnabled=true,tls.enabled=true,tls.serverCertificatesSecret=test-tls,solace.usernameAdminPassword=admin,image.repository=$REPO,image.tag=$UPGRADETAG,storage.useStorageGroup=true
106+
# grab a tag from Docker Hub that has the same SHA as "latest", so upgrade is easy
107+
DOCKERHUBRESULTS=`curl --silent "https://hub.docker.com/v2/repositories/$REPO/tags?page_size=1000" | jq -r '.results[] | "\(.digest) \(.name)"' | sort`
108+
SHA=`echo "$DOCKERHUBRESULTS" | grep latest | awk '{print $1;}'`
109+
UPGRADETAG=`echo "$DOCKERHUBRESULTS" | grep $SHA | head -n 1 | awk '{print $2;}'`
110+
helm upgrade my-release pubsubplus --set 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=$UPGRADETAG,storage.useStorageGroup=true
106111
kubectl get statefulset,svc,pods,pvc,pv --show-labels
107112
echo "Waiting for broker to become active after upgrade"
108113
statefulset_name=$(kubectl get statefulset | grep pubsubplus | awk '{print $1}')

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The [Solace PubSub+ Platform](https://solace.com/products/platform/)'s [software
66

77
## Overview
88

9-
This project is a best practice template intended for development and demo purposes. The tested and recommended Solace PubSub+ Software Event Broker version is 9.10.
9+
This project is a best practice template intended for development and demo purposes. The tested and recommended Solace PubSub+ Software Event Broker version is 10.0.
1010

1111
This document provides a quick getting started guide to install a software event broker in various configurations onto a [Kubernetes](https://kubernetes.io/docs/home/) cluster.
1212

docs/PubSubPlusK8SDeployment.md

+23
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ Contents:
1414
+ [Deployment scaling](#deployment-scaling)
1515
- [Simplified vertical scaling](#simplified-vertical-scaling)
1616
- [Comprehensive vertical scaling](#comprehensive-vertical-scaling)
17+
- [Enabling a Disruption Budget for HA deployment](#enabling-a-disruption-budget-for-ha-deployment)
1718
- [Reducing resource requirements of Monitoring Nodes in an HA deployment](#reducing-resource-requirements-of-monitoring-nodes-in-an-ha-deployment)
1819
+ [Disk Storage](#disk-storage)
1920
- [Allocating smaller storage to Monitor pods in an HA deployment](#allocating-smaller-storage-to-monitor-pods-in-an-ha-deployment)
2021
- [Using the default or an existing storage class](#using-the-default-or-an-existing-storage-class)
2122
- [Creating a new storage class](#creating-a-new-storage-class)
2223
- [Using an existing PVC (Persistent Volume Claim)](#using-an-existing-pvc-persistent-volume-claim-)
2324
- [Using a pre-created provider-specific volume](#using-a-pre-created-provider-specific-volume)
25+
- [Tested storage environments and providers](#tested-storage-environments-and-providers)
2426
+ [Exposing the PubSub+ Event Broker Services](#exposing-the-pubsub-software-event-broker-services)
2527
- [Specifying Service Type](#specifying-service-type)
2628
- [Using Ingress to access event broker services](#using-ingress-to-access-event-broker-services)
@@ -89,6 +91,10 @@ There are two deployment options described in this document:
8991
* The recommended option is to use the [Kubernetes Helm tool](https://github.com/helm/helm/blob/master/README.md), which can also manage your deployment's lifecycle, including upgrade and delete.
9092
* Another option is to generate a set of templates with customized values from the PubSub+ Helm chart and then use the Kubernetes native `kubectl` tool to deploy. The deployment will use the authorizations of the requesting user. However, in this case, Helm will not be able to manage your Kubernetes rollouts lifecycle.
9193

94+
It is also important to know that Helm is a templating tool that helps package PubSub+ Software Event Broker deployment into charts.
95+
It is most useful when first setting up broker nodes on the Kubernetes cluster. It can handle the install-update-delete lifecycle for the broker nodes deployed to the cluster.
96+
It can not be used to scale-up, scale down or apply custom configuration to an already deployed PubSub+ Software Event Broker.
97+
9298
The next sections will provide details on the PubSub+ Helm chart, dependencies and customization options, followed by [deployment prerequisites](#deployment-prerequisites) and the actual [deployment steps](#deployment-steps).
9399

94100
## PubSub+ Software Event Broker Deployment Considerations
@@ -135,6 +141,17 @@ Note: beyond CPU and memory requirements, required storage size (see next sectio
135141

136142
Also note, that specifying maxConnections, maxQueueMessages and maxSpoolUsage on initial deployment will overwrite the broker’s default values. On the other hand, doing the same using Helm upgrade on an existing deployment will not overwrite these values on brokers configuration, but it can be used to prepare (first step) for a manual scale up through CLI where these parameters can be actually changed (second step).
137143

144+
#### Enabling a Disruption Budget for HA deployment
145+
146+
One of the important parameters available to configure PubSub+ Software Event Broker HA is the [`podDisruptionBudget`](https://kubernetes.io/docs/tasks/run-application/configure-pdb/).
147+
This helps you control and limit the disruption to your application when its pods need to be rescheduled for upgrades, maintenance or any other reason.
148+
This is only available when we have the PubSub+ Software Event Broker deployed in [high-availability (HA) mode](//docs.solace.com/Overviews/SW-Broker-Redundancy-and-Fault-Tolerance.htm), that is, `solace.redundancy=true`.
149+
150+
In an HA deployment with Primary, Backup and Monitor nodes, we require a minimum of 2 nodes to reach a quorum. The pod disruption budget defaults to a minimum of two nodes when enabled.
151+
152+
To enable this functionality you have to set `solace.podDisruptionBudgetForHA=true` and `solace.redundancy=true`.
153+
154+
138155
#### Reducing resource requirements of Monitoring Nodes in an HA deployment
139156

140157
The Kubernetes StatefulSet which controls the pods that make up a PubSub+ broker [deployment in an HA redundancy group](#deployment-scaling) does not distinguish between PubSub+ HA node types: it assigns the same CPU and memory resources to pods hosting worker and monitoring node types, even though monitoring nodes have minimal resource requirements.
@@ -259,6 +276,12 @@ Another example is using [hostPath](//kubernetes.io/docs/concepts/storage/volume
259276
# this field is optional
260277
type: Directory
261278
```
279+
#### Tested storage environments and providers
280+
281+
The PubSub+ Software Event Broker has been tested to work with the following, Portworx, Ceph, Cinder (Openstack), vSphere storage for Kubernetes as documented [here](https://docs.solace.com/Cloud/Deployment-Considerations/resource-requirements-k8s.htm#supported-storage-solutions).
282+
However, note that for [EKS](https://docs.solace.com/Cloud/Deployment-Considerations/installing-ps-cloud-k8s-eks-specific-req.htm) and [GKE](https://docs.solace.com/Cloud/Deployment-Considerations/installing-ps-cloud-k8s-gke-specific-req.htm#storage-class), `xfs` produced the best results during tests.
283+
[AKS](https://docs.solace.com/Cloud/Deployment-Considerations/installing-ps-cloud-k8s-aks-specific-req.htm) users can opt for `Local Redundant Storage (LRS)` redundancy. This is because they produce the best results
284+
when compared with the other types available on Azure.
262285

263286
### Exposing the PubSub+ Software Event Broker Services
264287

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.1.0
4+
version: 3.2.0
55
icon: https://solaceproducts.github.io/pubsubplus-kubernetes-quickstart/images/PubSubPlus.png
66
kubeVersion: '>= 1.10.0-0'
77
maintainers:

pubsubplus/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ For more ways to override default chart values, refer to [Customizing the Helm C
8181
| `nameOverride` | Kubernetes objects will be named as `<release-name>-nameOverride` | Undefined, default naming is `<release-name>-<chart-name>` |
8282
| `fullnameOverride` | Kubernetes objects will be named as `fullnameOverride` | Undefined, default naming is `<release-name>-<chart-name>` |
8383
| `solace.redundancy` | `false` will create a single-node non-HA deployment; `true` will create an HA deployment with Primary, Backup and Monitor nodes | `false` |
84+
| `solace.podDisruptionBudgetForHA` | `true` will set up a [Pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for the PubSub+ broker in HA deployment, `false` does not set up a pod disruption budget. HA deployment with Primary, Backup and Monitor nodes requires a minimum of 2 nodes to reach a quorum, the pod disruption budget is defaulted to `2` minimum nodes when enabled. | `false` |
8485
| `solace.size` | Event broker simple vertical scaling by number of client connections. **Ignored** if `solace.systemScaling` is set. Options: `dev` (requires minimum resources but no guaranteed performance), `prod100`, `prod1k`, `prod10k`, `prod100k`, `prod200k`. | `prod100` |
8586
| `solace.systemScaling.*` | Event broker fine-grained vertical scaling definition. If defined, all sub-settings must be provided and these settings will **override** `solace.size`. For scaling documentation, look for "system scaling" at [docs.solace.com](https://docs.solace.com/Search.htm?q=system%20scaling). Use the [online calculator](https://docs.solace.com/Assistance-Tools/Resource-Calculator/pubsubplus-resource-calculator.html) to determine CPU, Memory and Storage requirements for "Container (messaging)" type. </br> `maxConnections`: max supported number of client connections </br> `maxQueueMessages`: max number of queue messages, in millions of messages </br> `maxSpoolUsage`: max Spool Usage, in MB. Also ensure adequate storage.size parameter, use the calculator </br> `cpu`: CPUs in cores </br> `memory`: host Virtual Memory, in MiB | Undefined |
8687
| `solace.podModifierEnabled` | Enables modifying (reducing) CPU and memory resources for Monitoring nodes in an HA deployment. Also requires the ["solace-pod-modifier" Kubernetes admission plugin](https://github.com/SolaceProducts/pubsubplus-kubernetes-quickstart/blob/master/solace-pod-modifier-admission-plugin/README.md#how-to-use) deployed to work. | Undefined, meaning not enabled. |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# PodDisruptionBudget for Statefulsets
2+
{{- if .Values.solace.podDisruptionBudgetForHA }}
3+
{{- if .Values.solace.redundancy }}
4+
{{ if $.Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" -}}
5+
apiVersion: policy/v1
6+
{{- else -}}
7+
apiVersion: policy/v1beta1
8+
{{- end }}
9+
kind: PodDisruptionBudget
10+
metadata:
11+
name: {{ template "solace.fullname" . }}
12+
labels:
13+
app.kubernetes.io/name: {{ template "solace.name" . }}
14+
app.kubernetes.io/instance: {{ .Release.Name }}
15+
app.kubernetes.io/managed-by: {{ .Release.Service }}
16+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
17+
spec:
18+
minAvailable: 2
19+
selector:
20+
matchLabels:
21+
app.kubernetes.io/name: {{ template "solace.name" . }}
22+
app.kubernetes.io/instance: {{ .Release.Name }}
23+
{{- end }}
24+
{{- end }}

0 commit comments

Comments
 (0)