Skip to content

Instantly share code, notes, and snippets.

@dofinn
Last active July 23, 2021 13:43
Show Gist options
  • Save dofinn/00a39c272bfadb67eb4da84d168c204d to your computer and use it in GitHub Desktop.
Save dofinn/00a39c272bfadb67eb4da84d168c204d to your computer and use it in GitHub Desktop.
Things I do every time Im deving MUO
#!/bin/bash
set -e
NAMESPACE=openshift-managed-upgrade-operator
OPERATOR=managed-upgrade-operator
# Set replicas to 0
oc -n ${NAMESPACE} scale deployment ${OPERATOR} --replicas=0
# Patch config to query OCM every minute
oc -n ${NAMESPACE} patch cm ${OPERATOR}-config -p '"data": {"config.yaml": "configManager:\n source: OCM\n ocmBaseUrl: https://api.stage.openshift.com\n watchInterval: 1\nmaintenance:\n controlPlaneTime: 90\n ignoredAlerts:\n controlPlaneCriticals:\n # ClusterOperatorDown - OSD-6330\n - ClusterOperatorDown\n # ClusterOperatorDegraded - OSD-6330\n - ClusterOperatorDegraded\n # CloudCredentialOperatorDown - BZ 1889540\n - CloudCredentialOperatorDown\nscale:\n timeOut: 30\nupgradeWindow:\n delayTrigger: 30\n timeOut: 120\nnodeDrain:\n timeOut: 45\n expectedNodeDrainTime: 8\nhealthCheck:\n ignoredCriticals:\n - DNSErrors05MinSRE\n - MetricsClientSendFailingSRE\n - UpgradeNodeScalingFailedSRE\n - UpgradeClusterCheckFailedSRE\n - PrometheusRuleFailures\n - CannotRetrieveUpdates\nextDependencyAvailabilityChecks:\n http:\n timeout: 10\n urls:\n - https://quay.io/health\n - https://api.stage.openshift.com\nverification:\n ignoredNamespaces:\n - openshift-logging\n namespacePrefixesToCheck:\n - openshift\n - kube\n - default\n"}'
# Get MUO token
OPERATOR_TOKEN=$(oc serviceaccounts get-token ${OPERATOR} -n ${NAMESPACE})
echo "OPTIONAL: Log into API with ${OPERATOR} token"
echo
echo "${OPERATOR_TOKEN}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment