Skip to content

Commit

Permalink
chore(AWX/NetBox): Shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurVardevanyan committed Dec 26, 2024
1 parent 55f7ba0 commit f13895b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion kubernetes/awx/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: awx-operator-controller-manager
namespace: awx
spec:
replicas: 1
replicas: 0
selector:
matchLabels:
control-plane: controller-manager
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/netbox/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ metadata:
helm.sh/chart: netbox-5.0.0-beta9
app.kubernetes.io/component: netbox
spec:
replicas: 2
replicas: 0
selector:
matchLabels:
app.kubernetes.io/name: netbox
Expand Down Expand Up @@ -195,7 +195,7 @@ metadata:
helm.sh/chart: netbox-5.0.0-beta9
app.kubernetes.io/component: worker
spec:
replicas: 2
replicas: 0
selector:
matchLabels:
app.kubernetes.io/name: netbox
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/netbox/base/dragonfly/dragonfly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
spec:
replicas: 2
replicas: 0 # 2
skipFSGroup: true
image: docker.dragonflydb.io/dragonflydb/dragonfly:v1.24.0@sha256:9d7fbf70085b5bb13570e2a4019cc14e6bf74576eec339de89c6aeda7025c847
resources:
Expand Down
5 changes: 3 additions & 2 deletions kubernetes/netbox/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ kind: Kustomization
resources:
- ./limit-range.yaml
- ./namespace.yaml
- ./pdb.yaml
# - ./pdb.yaml
# - ./ingress.yaml
- ./secret.yaml
- ./deployment.yaml
- ./network-policy.yaml
Expand All @@ -12,7 +13,7 @@ resources:
- ./service.yaml
- ./dragonfly/dragonfly.yaml
- ./dragonfly/network-policy.yaml
- ./dragonfly/pdb.yaml
# - ./dragonfly/pdb.yaml
- ./postgres/postgres.yaml
- ./postgres/network-policy.yaml
- ./postgres/secret.yaml
Expand Down
3 changes: 2 additions & 1 deletion kubernetes/postgres/components/pg_dump/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ stringData:
pg_dump -d <path:secret/data/homelab/stackrox/postgres#uri> > ${LOCATION}/stackrox.sql
echo "Dumping NetBox"
pg_dump -d <path:secret/data/homelab/netbox#db_uri> > ${LOCATION}/netbox.sql
echo "Dumping AWX"
pg_dump -d <path:secret/data/homelab/awx/postgres#db_uri> > ${LOCATION}/awx.sql
mkdir /tmp/.mc
Expand Down
11 changes: 6 additions & 5 deletions main.bash
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ stateful_workload_stop() {
kubectl patch postgresCluster stackrox -n stackrox --type=merge -p '{"spec":{"shutdown":true}}'
kubectl patch postgresCluster quay -n quay --type=merge -p '{"spec":{"shutdown":true}}'
kubectl patch postgresCluster awx -n awx --type=merge -p '{"spec":{"shutdown":true}}'
kubectl patch postgresCluster netbox -n netbox --type=merge -p '{"spec":{"shutdown":true}}'

kubectl scale --replicas=0 -n argocd deployment/argocd-operator-controller-manager
kubectl scale --replicas=0 -n argocd statefulset/argocd-application-controller
Expand Down Expand Up @@ -226,8 +227,8 @@ stateful_workload_start_pre() {
kubectl patch postgresCluster nextcloud -n nextcloud --type=merge -p '{"spec":{"shutdown":false}}'
kubectl patch postgresCluster photoprism -n postgres --type=merge -p '{"spec":{"shutdown":false}}'
kubectl patch postgresCluster stackrox -n stackrox --type=merge -p '{"spec":{"shutdown":false}}'
kubectl patch postgresCluster awx -n awx --type=merge -p '{"spec":{"shutdown":false}}'
kubectl patch postgresCluster netbox -n netbox --type=merge -p '{"spec":{"shutdown":false}}'
# kubectl patch postgresCluster awx -n awx --type=merge -p '{"spec":{"shutdown":false}}'
# kubectl patch postgresCluster netbox -n netbox --type=merge -p '{"spec":{"shutdown":false}}'

kubectl scale --replicas=1 -n zitadel statefulset/pihole
}
Expand Down Expand Up @@ -306,10 +307,10 @@ stateful_workload_start() {
kubectl scale --replicas=1 -n stackrox deployment/scanner-db

kubectl scale --replicas=1 -n loki-operator deployment/loki-operator-controller-manager
kubectl scale --replicas=1 -n awx deployment/awx-operator-controller-manager
# kubectl scale --replicas=1 -n awx deployment/awx-operator-controller-manager

kubectl scale --replicas=1 -n awx deployment/netbox
kubectl scale --replicas=1 -n awx deployment/netbox-worker
# kubectl scale --replicas=1 -n awx deployment/netbox
# kubectl scale --replicas=1 -n awx deployment/netbox-worker

# echo -e "\nkubectl exec -it vault-0 -n vault -- vault operator unseal --tls-skip-verify"
}
Expand Down

0 comments on commit f13895b

Please sign in to comment.