Last active
October 15, 2018 14:33
-
-
Save ironcladlou/e99f98a5526a8cc2b00e6e2253bb378c to your computer and use it in GitHub Desktop.
Testing cluster-dns-operator without CVO
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 | |
set -euo pipefail | |
# usage: local-release.sh <repo> | |
# Tags a new image from local working tree, makes a temporary commit, | |
# pushes it to $repo, builds a temporary set of manifests replacing the | |
# deployment with the $repo pullspec. | |
REPO="$1" | |
git add . | |
git commit -m "Temporary" | |
REV=$(git rev-parse --short HEAD) | |
docker build -t $REPO:$REV -f images/cluster-dns-operator/Dockerfile . | |
docker push $REPO:$REV | |
git reset --soft HEAD~1 | |
TMP_MANIFESTS=/tmp/cluster-dns-operator-manifests | |
mkdir -p $TMP_MANIFESTS | |
cp manifests/* $TMP_MANIFESTS | |
cat manifests/0000_08_cluster-dns-operator_02-deployment.yaml | sed "s~openshift/origin-cluster-dns-operator:latest~$REPO:$REV~" > "$TMP_MANIFESTS/0000_08_cluster-dns-operator_02-deployment.yaml" | |
echo "Pushed $REPO:$REV" | |
echo "Install manifests using:" | |
echo "" | |
echo "oc apply -f $TMP_MANIFESTS" |
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 | |
CLUSTER_NAME="$1" | |
if [ -z "${CLUSTER_NAME}" ]; then | |
echo "usage: uninstall.sh <cluster_name>" | |
exit 1 | |
fi | |
# Disable the CVO | |
oc patch -n openshift-cluster-version daemonsets/cluster-version-operator --patch '{"spec": {"template": {"spec": {"nodeSelector": {"node-role.kubernetes.io/fake": ""}}}}}' | |
# Uninstall kube-dns | |
oc scale -n kube-system --replicas 0 deployments/kube-core-operator | |
oc scale -n kube-system --replicas 0 deployments/kube-dns | |
oc delete -n kube-system services/kube-dns | |
# Uninstall cluster-dns-operator | |
oc delete namespaces/openshift-cluster-dns-operator | |
oc delete namespaces/openshift-cluster-dns | |
oc delete clusterroles/cluster-dns-operator | |
oc delete clusterroles/cluster-dns:dns | |
oc delete clusterrolebindings/cluster-dns-operator | |
oc delete clusterrolebindings/cluster-dns:dns | |
oc delete customresourcedefinition.apiextensions.k8s.io/clusterdnses.dns.openshift.io |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment