-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (71 loc) · 4.3 KB
/
test-helm-upgrade.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Integration Test for Helm to Operator Upgrade
on: workflow_call
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Create k8s Kind Cluster
uses: helm/[email protected]
- name: Login to Github Packages
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Testing operator deployment
run: |
kubectl cluster-info
kubectl get pods -n kube-system
echo "current-context:" $(kubectl config current-context)
echo "environment-kubeconfig:" ${KUBECONFIG}
kubectl create ns pubsubplus-operator-system --save-config
kubectl create secret generic regcred --from-file=.dockerconfigjson=${HOME}/.docker/config.json --type=kubernetes.io/dockerconfigjson -n pubsubplus-operator-system
make deploy | grep created
kubectl rollout status deployment pubsubplus-eventbroker-operator -n pubsubplus-operator-system --timeout=30s
kubectl get crd | grep eventbrokers
- name: Testing the Operator - Upgrade a nonHA Helm deployment to Operator
run: |
curl -O https://sftp.solace.com/download/SDKPERF_C_LINUX64
tar -xvf SDKPERF_C_LINUX64
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout tls.key -out tls.crt -subj "/CN=*"
kubectl create secret tls test-tls --key="tls.key" --cert="tls.crt"
helm repo add solacecharts https://solaceproducts.github.io/pubsubplus-kubernetes-helm-quickstart/helm-charts
helm install my-release solacecharts/pubsubplus-dev --set solace.size=dev,solace.redundancy=false,solace.podModifierEnabled=true,tls.enabled=true,tls.serverCertificatesSecret=test-tls,solace.usernameAdminPassword=admin
echo "Waiting for broker to become active"
until kubectl get pods --show-labels | grep pubsubplus-dev-0 | grep -m 1 -E '1/1'; do sleep 10; done
helm test my-release | grep Phase | grep Succeeded
kubectl get statefulset,svc,pods,pvc,pv --show-labels
kubectl port-forward svc/my-release-pubsubplus-dev 55566:55555 &
kubectl port-forward svc/my-release-pubsubplus-dev 55455:55443 &
sleep 5
pubSubTools/sdkperf_c -cip=tcp://localhost:55566 -mn=1000 -mr=0 -ptl=t1 -stl=t1 | grep "Total Messages"
pubSubTools/sdkperf_c -cip=tcps://localhost:55455 -mn=1000 -mr=0 -ptl=t1 -stl=t1 | grep "Total Messages"
echo "Helm release for broker working...uninstalling to upgrade to operator"
bash ci/scripts/uninstall-helm-broker.sh my-release default
sleep 5 ; kubectl get all
kubectl apply -f ci/manifests/eventbroker-nonha-upgrade.yaml | grep "test-nonha created"
sleep 5 ; kubectl get all
kubectl wait pods --selector app.kubernetes.io/instance=test-nonha --for condition=Ready --timeout=120s
kubectl get po --show-labels | grep test-nonha | grep "1/1"
kubectl get po --show-labels | grep test-nonha | grep active=true
kubectl get sts | grep test-nonha
kubectl port-forward svc/test-nonha-pubsubplus 55555:55555 &
kubectl port-forward svc/test-nonha-pubsubplus 55443:55443 &
sleep 5
pubSubTools/sdkperf_c -cip=tcp://localhost:55555 -mn=1000 -mr=0 -ptl=t1 -stl=t1 | grep "Total Messages"
pubSubTools/sdkperf_c -cip=tcps://localhost:55443 -mn=10000 -mr=0 -ptl=t1 -stl=t1 | grep "Total Messages"
# TODO extract secret BROKER_PASSWORD=$(kubectl get secret broker-secret -o "jsonpath={.data.username_admin_password}" -n default | base64 -d )
# verify SEMP over TLS
# Example: curl -k -sS -u admin:$BROKER_PASSWORD https://$url:1943/SEMP -d "<rpc><show><config-sync></config-sync></show></rpc>
sleep 50 ; kubectl get all
kubectl wait pods --selector app.kubernetes.io/component=metricsexporter --for condition=Ready --timeout=120s
kubectl port-forward svc/test-nonha-pubsubplus-prometheus-metrics 9629:9628 &
sleep 1
curl localhost:9629 | grep Exporter
kubectl delete eventbroker test-nonha | grep deleted