|
| 1 | +# Install Minikube |
| 2 | + |
| 3 | +``` |
| 4 | +curl -LO https://storage.googleapis.com/minikube/releases/v1.33.1/minikube-linux-amd64 |
| 5 | +sudo install minikube-linux-amd64 /usr/local/bin/minikube && rm minikube-linux-amd64 |
| 6 | +``` |
| 7 | + |
| 8 | +``` |
| 9 | +minikube version |
| 10 | +minikube version: v1.33.1 |
| 11 | +commit: 5883c09216182566a63dff4c326a6fc9ed2982ff |
| 12 | +``` |
| 13 | + |
| 14 | +``` |
| 15 | +minikube start --kubernetes-version 1.28.4 |
| 16 | +``` |
| 17 | + |
| 18 | +# Create test namespace |
| 19 | + |
| 20 | +``` |
| 21 | +kubectl create ns bonita |
| 22 | +``` |
| 23 | + |
| 24 | +# Deploy PostgreSQL |
| 25 | + |
| 26 | +``` |
| 27 | +kubectl -n bonita create configmap db-scripts --from-file=db_scripts/ |
| 28 | +kubectl -n bonita apply -f postgresql.yaml |
| 29 | +``` |
| 30 | + |
| 31 | +Test connection |
| 32 | + |
| 33 | +``` |
| 34 | +kubectl -n bonita run psql-client --image postgres:15.7 --rm --tty -i --command -- /bin/bash |
| 35 | +``` |
| 36 | + |
| 37 | +``` |
| 38 | +export PGPASSWORD=testpassword |
| 39 | +psql -h postgres-db -p 5432 -U postgres postgres |
| 40 | +postgres=# show max_connections; |
| 41 | + max_connections |
| 42 | +----------------- |
| 43 | + 100 |
| 44 | +(1 ligne) |
| 45 | +
|
| 46 | +postgres=# \list |
| 47 | + List of databases |
| 48 | + Name | Owner | Encoding | Collate | Ctype | Access privileges |
| 49 | +-----------+------------+----------+------------+------------+----------------------- |
| 50 | + bizdata | bizuser | UTF8 | en_US.utf8 | en_US.utf8 | |
| 51 | + bonita | bonitauser | UTF8 | en_US.utf8 | en_US.utf8 | |
| 52 | + postgres | postgres | UTF8 | en_US.utf8 | en_US.utf8 | |
| 53 | + template0 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres + |
| 54 | + | | | | | postgres=CTc/postgres |
| 55 | + template1 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres + |
| 56 | + | | | | | postgres=CTc/postgres |
| 57 | +(5 rows) |
| 58 | +``` |
| 59 | + |
| 60 | + |
| 61 | +# Deploy Bonita |
| 62 | + |
| 63 | +Add Docker registry credentials |
| 64 | +``` |
| 65 | +DOCKER_SEVER=bonitasoft.jfrog.io |
| 66 | +DOCKER_USERNAME=... |
| 67 | +DOCKER_TOKEN=... |
| 68 | +kubectl create secret docker-registry imagepullsecret --docker-server="${DOCKER_SEVER}" --docker-username="${DOCKER_USERNAME}" --docker-password="${DOCKER_TOKEN}" -n bonita |
| 69 | +``` |
| 70 | + |
| 71 | +Request a Bonita license compatible with Kubernetes into the [Customer service center](https://csc.bonitacloud.bonitasoft.com/apps/CustomerServices) |
| 72 | + |
| 73 | +Add this bonita license |
| 74 | +``` |
| 75 | +cp BonitaSubscription-10.0-Test-20240312-20240908.lic bonita-license.lic |
| 76 | +kubectl -n bonita create configmap bonita-license --from-file=bonita-license.lic |
| 77 | +``` |
| 78 | + |
| 79 | +``` |
| 80 | +kubectl -n bonita create configmap bonita-scripts --from-file=bonita_scripts/ |
| 81 | +``` |
| 82 | + |
| 83 | +``` |
| 84 | +kubectl -n bonita apply -f bonita_secrets.yaml |
| 85 | +kubectl -n bonita apply -f bonita_cm.yaml |
| 86 | +kubectl -n bonita create serviceaccount bonitaserviceaccount |
| 87 | +kubectl -n bonita apply -f bonita_rbac.yaml |
| 88 | +kubectl -n bonita apply -f bonita_deployment.yaml |
| 89 | +kubectl -n bonita apply -f bonita_service.yaml |
| 90 | +``` |
| 91 | + |
| 92 | +Test connection |
| 93 | +``` |
| 94 | +kubectl -n bonita port-forward service/bonita-test 8080:8080 |
| 95 | +``` |
| 96 | + |
| 97 | +Open http://127.0.0.1:8080 in your browser and use admin / myAdminSecret credentials. |
| 98 | + |
| 99 | +# Scale up Bonita |
| 100 | + |
| 101 | +Once bonita finished its startup |
| 102 | +``` |
| 103 | +kubectl -n bonita logs --selector app.kubernetes.io/instance=bonita-test | grep "Server startup in" | jq .message |
| 104 | +"Server startup in [20896] milliseconds" |
| 105 | +``` |
| 106 | + |
| 107 | +``` |
| 108 | +kubectl -n bonita get deployment |
| 109 | +NAME READY UP-TO-DATE AVAILABLE AGE |
| 110 | +bonita-test 1/1 1 1 11m |
| 111 | +``` |
| 112 | + |
| 113 | +You can scale up |
| 114 | +``` |
| 115 | +kubectl -n bonita scale --current-replicas=1 --replicas=2 deployment/bonita-test |
| 116 | +``` |
| 117 | + |
| 118 | +``` |
| 119 | +kubectl -n bonita get deployment |
| 120 | +NAME READY UP-TO-DATE AVAILABLE AGE |
| 121 | +bonita-test 2/2 2 2 16m |
| 122 | +``` |
| 123 | + |
| 124 | +In case of success you will have this kind of message |
| 125 | +``` |
| 126 | +kubectl -n bonita logs --selector app.kubernetes.io/instance=bonita-test | grep Members | jq .message |
| 127 | +"[10.244.0.9]:5701 [bonita-test] [5.3.5] \n\nMembers {size:2, ver:2} [\n\tMember [10.244.0.9]:5701 - e633ecf6-a670-448b-bd69-f1fdab39299a this\n\tMember [10.244.0.10]:5701 - 90903a8a-c5d9-49f7-9021-e81e958e995a\n]\n" |
| 128 | +``` |
| 129 | + |
| 130 | +# Clean test |
| 131 | + |
| 132 | +``` |
| 133 | +kubectl delete ns bonita |
| 134 | +``` |
0 commit comments