mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
script to set a cluster in maintenance mode
This commit is contained in:
parent
e045bc96f9
commit
b5bbf5164d
22
deployment/scripts/cluster.maintenance.sh
Executable file
22
deployment/scripts/cluster.maintenance.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# base setup
|
||||
SCRIPT_PATH=$(realpath $0)
|
||||
SCRIPT_DIR=$(dirname $SCRIPT_PATH)
|
||||
|
||||
# configuration
|
||||
CONFIGURATION=${CONFIGURATION:-"example"}
|
||||
KUBECONFIG=${KUBECONFIG:-${SCRIPT_DIR}/../configurations/${CONFIGURATION}/kubeconfig.yaml}
|
||||
|
||||
case $1 in
|
||||
on)
|
||||
kubectl --kubeconfig=${KUBECONFIG} patch ingress ingress-ocelot-webapp --type merge --patch-file ${SCRIPT_DIR}/../src/kubernetes/patches/patch.ingress.maintenance.on.yaml
|
||||
;;
|
||||
off)
|
||||
kubectl --kubeconfig=${KUBECONFIG} patch ingress ingress-ocelot-webapp --type merge --patch-file ${SCRIPT_DIR}/../src/kubernetes/patches/patch.ingress.maintenance.off.yaml
|
||||
;;
|
||||
*)
|
||||
echo -e "Run this script with first argument either 'on' or 'off'"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
@ -0,0 +1,12 @@
|
||||
spec:
|
||||
rules:
|
||||
- host:
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: ocelot-webapp
|
||||
port:
|
||||
number: 3000
|
||||
@ -0,0 +1,12 @@
|
||||
spec:
|
||||
rules:
|
||||
- host:
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: ocelot-maintenance
|
||||
port:
|
||||
number: 80
|
||||
Loading…
x
Reference in New Issue
Block a user