Skip to content

Commit

Permalink
Merge pull request #40 from nanit/k8s1.16
Browse files Browse the repository at this point in the history
changed curl command to match app version
  • Loading branch information
erez-rabih authored Jun 17, 2020
2 parents feb9a5a + 724dd12 commit 2b992e0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docker/set_cluster_nodes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -u

function join_by { local IFS="$1"; shift; echo "$*"; }

STATEFUL_SETS=$(curl -f -k https://${KUBERNETES_SERVICE_HOST}/apis/apps/v1beta1/statefulsets -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)")
STATEFUL_SETS=$(curl -f -k https://${KUBERNETES_SERVICE_HOST}/apis/apps/v1/statefulsets -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)")
RMQ_SS=$(echo $STATEFUL_SETS | jq ".items[] | select(.metadata.name == \"${RABBITMQ_APP_NAME}\")")
REPLICAS=$(echo $RMQ_SS | jq .spec.replicas)
SERVICE_NAME=$(echo $RMQ_SS | jq .spec.serviceName | tr -d '"')
Expand Down
4 changes: 2 additions & 2 deletions docker/set_ha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ while true ; do
if [ ${ready} == 0 ]; then
echo "RabbitMQ is ready, setting ha policy"
sleep 5
rabbitmqctl set_policy ha-all '.*' '{{RABBITMQ_HA_POLICY}}' --apply-to queues
rabbitmqctl set_policy expiry '.*' '{"expires":1800000}' --apply-to queues
rabbitmqctl set_policy ha-all '.*' '{{RABBITMQ_HA_POLICY}}' --apply-to queues || break
rabbitmqctl set_policy expiry '.*' '{"expires":1800000}' --apply-to queues || break
echo "ha-all policy set successfully"
break
fi
Expand Down
5 changes: 4 additions & 1 deletion kube/stateful.set.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{APP_NAME}}
spec:
serviceName: {{SVC_NAME}}
replicas: {{REPLICAS}}
selector:
matchLabels:
app: {{APP_NAME}}
template:
metadata:
labels:
Expand Down

0 comments on commit 2b992e0

Please sign in to comment.