Last active
October 16, 2018 18:10
-
-
Save ironcladlou/d3a7af553130f710a08475adc4096624 to your computer and use it in GitHub Desktop.
Testing cluster-ingress-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 | |
REPO="$1" | |
if [ -z "$REPO" ]; then | |
echo "usage: local-release.sh <repo>" | |
exit 1 | |
fi | |
TEMP_COMMIT="false" | |
test -z "$(git status --porcelain)" || TEMP_COMMIT="true" | |
if [[ "${TEMP_COMMIT}" == "true" ]]; then | |
git add . | |
git commit -m "Temporary" || true | |
fi | |
REV=$(git rev-parse --short HEAD) | |
docker build -t $REPO:$REV -f images/cluster-ingress-operator/Dockerfile . | |
docker push $REPO:$REV | |
if [[ "${TEMP_COMMIT}" == "true" ]]; then | |
git reset --soft HEAD~1 | |
fi | |
TMP_MANIFESTS=/tmp/cluster-ingress-operator-manifests | |
mkdir -p $TMP_MANIFESTS | |
cp manifests/* $TMP_MANIFESTS | |
cat manifests/02-deployment.yaml | sed "s~openshift/origin-cluster-ingress-operator:latest~$REPO:$REV~" > "$TMP_MANIFESTS/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 tectonic ingress | |
oc delete namespaces/openshift-ingress | |
# Uninstall cluster-dns-operator | |
oc delete -n openshift-cluster-ingress-operator clusteringresses/default | |
oc delete namespaces/openshift-cluster-ingress-operator | |
oc delete namespaces/openshift-cluster-ingress-router | |
oc delete clusterroles/cluster-ingress-operator:operator | |
oc delete clusterroles/cluster-ingress:router | |
oc delete clusterrolebindings/cluster-ingress-operator:operator | |
oc delete clusterrolebindings/cluster-ingress:router | |
oc delete customresourcedefinition.apiextensions.k8s.io/clusteringresses.ingress.openshift.io |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment