This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
"os" | |
"statsd" | |
"time" | |
"github.com/thedevsaddam/gojsonq" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir bkpIngressObjects | |
# clusters | |
for cluster in cluster1 cluster2 | |
do | |
mkdir bkpIngressObjects/${cluster} | |
kubectl config use-context $cluster | |
for ingObject in $(kubectl get ing -o custom-columns=NAME:.metadata.name | grep -v NAME) | |
kubectl get ing/$ingObject -o json > bkpIngressObjects/${cluster}/${ingObject}.bkp.json | |
kubectl get ing/$ingObject -o json | jq '(.spec.rules[].http.paths[].backend.serviceName) |= "maintenance-page"' > ing.tmp |