removed scripts & patches
This commit is contained in:
parent
97a8c6d270
commit
a79eedc99e
@ -1,12 +0,0 @@
|
|||||||
spec:
|
|
||||||
rules:
|
|
||||||
- host:
|
|
||||||
http:
|
|
||||||
paths:
|
|
||||||
- path: /
|
|
||||||
pathType: ImplementationSpecific
|
|
||||||
backend:
|
|
||||||
service:
|
|
||||||
name: wir-social-webapp
|
|
||||||
port:
|
|
||||||
number: 3000
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
spec:
|
|
||||||
rules:
|
|
||||||
- host:
|
|
||||||
http:
|
|
||||||
paths:
|
|
||||||
- path: /
|
|
||||||
pathType: ImplementationSpecific
|
|
||||||
backend:
|
|
||||||
service:
|
|
||||||
name: wir-social-maintenance
|
|
||||||
port:
|
|
||||||
number: 80
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# base setup
|
|
||||||
SCRIPT_PATH=$(realpath $0)
|
|
||||||
SCRIPT_DIR=$(dirname $SCRIPT_PATH)
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
on)
|
|
||||||
echo "Network maintenance: on"
|
|
||||||
kubectl patch --namespace=wir-social-ocelot-production ingress wir-social --type merge --patch-file ${SCRIPT_DIR}/../patches/patch.ingress.maintenance.on.yaml
|
|
||||||
;;
|
|
||||||
off)
|
|
||||||
echo "Network maintenance: off"
|
|
||||||
kubectl patch --namespace=wir-social-ocelot-production ingress wir-social --type merge --patch-file ${SCRIPT_DIR}/../patches/patch.ingress.maintenance.off.yaml
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo -e "Run this script with first argument either 'on' or 'off'"
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# base setup
|
|
||||||
SCRIPT_PATH=$(realpath $0)
|
|
||||||
SCRIPT_DIR=$(dirname $SCRIPT_PATH)
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
on)
|
|
||||||
# set Neo4j in offline mode (maintenance)
|
|
||||||
echo "Neo4j maintenance: on"
|
|
||||||
kubectl get --namespace=wir-social-ocelot-production statefulset ocelot-neo4j-neo4j -o json \
|
|
||||||
| jq '.spec.template.spec.containers[] += {"command": ["tail", "-f", "/dev/null"]}' \
|
|
||||||
| kubectl apply -f -
|
|
||||||
|
|
||||||
# wait for the container to restart
|
|
||||||
echo "Wait 60s ..."
|
|
||||||
sleep 60
|
|
||||||
;;
|
|
||||||
off)
|
|
||||||
# set Neo4j in online mode
|
|
||||||
echo "Neo4j maintenance: off"
|
|
||||||
kubectl get --namespace=wir-social-ocelot-production statefulset ocelot-neo4j-neo4j -o json \
|
|
||||||
| jq 'del(.spec.template.spec.containers[].command)' \
|
|
||||||
| kubectl apply -f -
|
|
||||||
|
|
||||||
# wait for the container to restart
|
|
||||||
echo "Wait 60s ..."
|
|
||||||
sleep 60
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo -e "Run this script with first argument either 'off' or 'on'"
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# base setup
|
|
||||||
SCRIPT_PATH=$(realpath $0)
|
|
||||||
SCRIPT_DIR=$(dirname $SCRIPT_PATH)
|
|
||||||
|
|
||||||
# configuration
|
|
||||||
BACKUP_DATE="2024-12-04_09-39-10"
|
|
||||||
BACKUP_FOLDER=${BACKUP_FOLDER:-${SCRIPT_DIR}/../backup/${BACKUP_DATE}}
|
|
||||||
|
|
||||||
printf "Backup folder: %s\n" $BACKUP_FOLDER
|
|
||||||
|
|
||||||
${SCRIPT_DIR}/maintenance.sh on
|
|
||||||
${SCRIPT_DIR}/neo4j.sh on
|
|
||||||
|
|
||||||
# copy neo4j backup from local drive
|
|
||||||
echo "Copying database from local file system ..."
|
|
||||||
kubectl cp \
|
|
||||||
$BACKUP_FOLDER/neo4j-dump \
|
|
||||||
wir-social-ocelot-production/$(kubectl --namespace=wir-social-ocelot-production get pods | grep ocelot-neo4j |awk '{ print $1 }'):/var/lib/neo4j/$BACKUP_DATE-neo4j-dump
|
|
||||||
|
|
||||||
# copy image data
|
|
||||||
echo "Copying public uploads to local file system ..."
|
|
||||||
kubectl cp \
|
|
||||||
$BACKUP_FOLDER/public-uploads/. \
|
|
||||||
wir-social-ocelot-production/$(kubectl --namespace=wir-social-ocelot-production get pods | grep wir-social-backend |awk '{ print $1 }'):/app/public/uploads/
|
|
||||||
|
|
||||||
# restore database
|
|
||||||
echo "Restoring Database ..."
|
|
||||||
kubectl --namespace=wir-social-ocelot-production exec -it \
|
|
||||||
$(kubectl --namespace=wir-social-ocelot-production get pods | grep ocelot-neo4j | awk '{ print $1 }') \
|
|
||||||
-- neo4j-admin load --from=/var/lib/neo4j/$BACKUP_DATE-neo4j-dump --force
|
|
||||||
|
|
||||||
${SCRIPT_DIR}/neo4j.sh off
|
|
||||||
${SCRIPT_DIR}/maintenance.sh off
|
|
||||||
Loading…
x
Reference in New Issue
Block a user