Skip to content

Instantly share code, notes, and snippets.

Last active February 4, 2022 01:44
Show Gist options
  • Save williamcaban/7d4fa16c91cf597517e5778428e74658 to your computer and use it in GitHub Desktop.
Save williamcaban/7d4fa16c91cf597517e5778428e74658 to your computer and use it in GitHub Desktop.

OCP 4.2/4.3 All-In-One (UPI mode)

This document assume reader is familiar with the OCP4x installation process.

Before Deployment

  • Setup the install-config.yaml to deploy a single master and no workers
    apiVersion: v1
    - hyperthreading: Enabled
      name: worker
      replicas: 0
      hyperthreading: Enabled
      name: master
      replicas: 1
     name: aio
        - cidr:
            hostPrefix: 23
        networkType: OpenShiftSDN
        none: {}
    pullSecret: '<your-pull-secret-here>'
    sshKey: 'ssh-rsa AAA...'

During Deployment

  • During installation there still need for a temporary external load balancer (or poor man version, modify the DNS entries).

    • For the installation prepare the DNS equivalent to this:             <ip_aio>      <ip_aio>        <ip_aio>
      *      <ip_aio>     <ip_bootstrap>         <ip_bootstrap>
      # etcd Service Record   IN SRV  0   0   2380
    • After bootkube.service completes modify the DNS             <ip_aio>      <ip_aio>        <ip_aio>
      *      <ip_aio>     <ip_aio>         <ip_aio>
      # etcd Service Record   IN SRV  0   0   2380
  • The single node will be shown with both roles (master and worker)

    $ oc get nodes
    NAME   STATUS   ROLES           AGE    VERSION
    aio    Ready    master,worker   33m    v1.16.2
  • Set etcd-quorum-guard to unmanaged state

    oc patch clusterversion/version --type='merge' -p "$(cat <<- EOF
        - group: apps/v1
          kind: Deployment
          name: etcd-quorum-guard
          namespace: openshift-machine-config-operator
          unmanaged: true
  • Downscale etcd-quorum-guard to one:

    oc scale --replicas=1 deployment/etcd-quorum-guard -n openshift-machine-config-operator
  • Downscale the number of routers to one:

    oc scale --replicas=1 ingresscontroller/default -n openshift-ingress-operator
  • (Recommended) Downscale the number of consoles, authentication, OLM and monitoring services to one:

    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
    # NOTE: When enabled, the Operator will auto-scale this services back to original quantity
    oc scale --replicas=1 deployment.apps/prometheus-adapter -n openshift-monitoring
    oc scale --replicas=1 deployment.apps/thanos-querier -n openshift-monitoring
    oc scale --replicas=1 statefulset.apps/prometheus-k8s -n openshift-monitoring
    oc scale --replicas=1 statefulset.apps/alertmanager-main -n openshift-monitoring
  • (optional) Setup image-registry to use ephemeral storage.

    WARNING: Only use ephemeral storage for internal registry for testing purposes.

    oc patch cluster --type merge \
    --patch '{"spec":{"storage":{"emptyDir":{}}}}'
    oc patch cluster --type merge \
    --patch '{"spec":{"managementState":"Managed"}}'

    NOTE: Wait until the image-registry operator completes the update before using the registry.

Copy link

hello,Could it apply to openshift 4.4 or 4.5?

Copy link

yes, but not for 4.6 as some of the deployment names have changed

Copy link

What is the corresponding name in 4.6? tried but failed with:
[root@helper ocp4]# oc scale --replicas=1 deployment/etcd-quorum-guard -n openshift-machine-config-operator
Error from server (NotFound): deployments.apps "etcd-quorum-guard" not found

Copy link

OCP 4.6 uses an etcd operator so the adjustments are done in the openshfit-etcd namespace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment