|
| 1 | +#!/usr/bin/fish |
| 2 | + |
| 3 | +source helper.fish |
| 4 | + |
| 5 | +set -g TESTNAME test2b |
| 6 | +set -g TESTDESC "Scale an cluster deployment (enterprise)" |
| 7 | +set -g YAMLFILE generated/cluster-enterprise-dev.yaml |
| 8 | +set -g DEPLOYMENT acceptance-cluster |
| 9 | +printheader |
| 10 | + |
| 11 | +# Deploy and check |
| 12 | +kubectl apply -f $YAMLFILE |
| 13 | +and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 9 120 |
| 14 | +and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120 |
| 15 | +and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120 |
| 16 | +and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120 |
| 17 | +and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120 |
| 18 | +and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 120 |
| 19 | +or fail "Deployment did not get ready." |
| 20 | + |
| 21 | +# Automatic check |
| 22 | +set ip (getLoadBalancerIP "$DEPLOYMENT-ea") |
| 23 | +testArangoDB $ip 60 |
| 24 | +or fail "ArangoDB was not reachable." |
| 25 | + |
| 26 | +# Patching |
| 27 | +output "Patching" "Patching Spec for Scaling up" |
| 28 | +kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/dbservers/count", "value":5}]' |
| 29 | +and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 11 120 |
| 30 | +and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 5 120 |
| 31 | +and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120 |
| 32 | +and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120 |
| 33 | +or fail "Deployment did not get ready." |
| 34 | + |
| 35 | +# Patching |
| 36 | +output "Patching" "Patching Spec for Scaling up" |
| 37 | +kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/coordinators/count", "value":4}]' |
| 38 | +and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 12 120 |
| 39 | +and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 5 120 |
| 40 | +and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120 |
| 41 | +and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 4 120 |
| 42 | +or fail "Deployment did not get ready." |
| 43 | + |
| 44 | +# Patching |
| 45 | +output "Patching" "Patching Spec for Scaling up" |
| 46 | +kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/dbservers/count", "value":2}]' |
| 47 | +and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 9 120 |
| 48 | +and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 2 120 |
| 49 | +and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120 |
| 50 | +and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 4 120 |
| 51 | +or fail "Deployment did not get ready." |
| 52 | + |
| 53 | +# Patching |
| 54 | +output "Patching" "Patching Spec for Scaling up" |
| 55 | +kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/coordinators/count", "value":1}]' |
| 56 | +and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 6 120 |
| 57 | +and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 2 120 |
| 58 | +and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120 |
| 59 | +and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 1 120 |
| 60 | +or fail "Deployment did not get ready." |
| 61 | + |
| 62 | +# Manual check |
| 63 | +output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER." |
| 64 | +inputAndLogResult |
| 65 | + |
| 66 | +# Cleanup |
| 67 | +kubectl delete -f $YAMLFILE |
| 68 | +and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 0 120 |
| 69 | +or fail "Could not delete deployment." |
| 70 | + |
| 71 | +output "Ready" "" |
0 commit comments