Skip to content

Instantly share code, notes, and snippets.

@davivcgarcia
Created March 12, 2020 12:42
Show Gist options
  • Save davivcgarcia/d621936244ffae5d3a9785037d0153c1 to your computer and use it in GitHub Desktop.
Save davivcgarcia/d621936244ffae5d3a9785037d0153c1 to your computer and use it in GitHub Desktop.
Red Hat OpenShift 4 - Downscale control-plane components (remove HA)
#
# WARNING: This document is not a official Red Hat procedure, and the commands will disable HA
# of control-plane components, turning your environment to not supported.
#
oc patch clusterversion/version --type='merge' -p "$(cat <<- EOF
spec:
overrides:
- group: apps/v1
kind: Deployment
name: etcd-quorum-guard
namespace: openshift-machine-config-operator
unmanaged: true
- group: apps/v1
kind: Deployment
name: cluster-monitoring-operator
namespace: openshift-monitoring
unmanaged: true
EOF
)"
oc scale --replicas=1 deployment/etcd-quorum-guard -n openshift-machine-config-operator
oc scale --replicas=1 ingresscontroller/default -n openshift-ingress-operator
oc scale --replicas=1 deployment.apps/console -n openshift-console
oc scale --replicas=1 deployment.apps/downloads -n openshift-console
oc scale --replicas=1 deployment.apps/oauth-openshift -n openshift-authentication
oc scale --replicas=1 deployment.apps/packageserver -n openshift-operator-lifecycle-manager
oc scale --replicas=0 deploy/cluster-monitoring-operator -n openshift-monitoring
oc patch prometheus/k8s -n openshift-monitoring --type='merge' -p "$(cat <<- EOF
spec:
replicas: 1
EOF
)"
oc patch alertmanagers/main -n openshift-monitoring --type='merge' -p "$(cat <<- EOF
spec:
replicas: 1
EOF
)"
oc scale --replicas=1 deployment.apps/prometheus-adapter -n openshift-monitoring
oc scale --replicas=1 deployment.apps/thanos-querier -n openshift-monitoring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment