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.

Revisions

  1. Dominic Finn revised this gist Jun 4, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions muodev.sh
    Original file line number Diff line number Diff line change
    @@ -8,8 +8,10 @@ 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"
  2. Dominic Finn created this gist Jun 4, 2021.
    17 changes: 17 additions & 0 deletions muodev.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/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

    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"}'

    OPERATOR_TOKEN=$(oc serviceaccounts get-token ${OPERATOR} -n ${NAMESPACE})

    echo "OPTIONAL: Log into API with ${OPERATOR} token"
    echo
    echo "${OPERATOR_TOKEN}"