Skip to content

Instantly share code, notes, and snippets.

@luszczynski
Last active July 23, 2020 19:27
Show Gist options
  • Save luszczynski/f812b20967bda5cf095046a74d2f23b7 to your computer and use it in GitHub Desktop.
Save luszczynski/f812b20967bda5cf095046a74d2f23b7 to your computer and use it in GitHub Desktop.
Openshift 4 installation using minimum resource

Openshift Installation using minimum resource

Fix etcd

oc patch \
   etcd \
   cluster \
   -p='{"spec": {"unsupportedConfigOverrides": {"useUnsupportedUnsafeNonHANonProductionUnstableEtcd": true}}}' \
   --type=merge
oc patch clusterversion version --type json -p "$(cat <<- EOF
- op: add
  path: /spec/overrides
  value:
  - kind: Deployment
    group: apps/v1
    name: etcd-quorum-guard
    namespace: openshift-machine-config-operator
    unmanaged: true
EOF
)"
oc scale --replicas=1 deployment/etcd-quorum-guard -n openshift-machine-config-operator

Change instance type

AWS M5a

Scale Registry down

oc patch configs.imageregistry.operator.openshift.io cluster -p='{"spec": {"replicas": 1}}' --type=merge

Scale Router down

oc patch ingresses.config.openshift.io cluster -p='{"spec": {"replicas": 1}}' --type=merge
oc scale --replicas=1 deployment/router-default -n openshift-ingress

Scale monitoring down

oc patch clusterversion version --type json -p "$(cat <<- EOF
- op: add
  path: /spec/overrides
  value:
  - kind: Deployment
    group: apps/v1
    name: prometheus-operator
    namespace: openshift-monitoring
    unmanaged: true
  - kind: Deployment
    group: apps/v1
    name: etcd-quorum-guard
    namespace: openshift-machine-config-operator
    unmanaged: true
  - kind: Deployment
    group: apps/v1
    name: cluster-monitoring-operator
    namespace: openshift-monitoring
    unmanaged: true
  - kind: Deployment
    group: apps/v1
    name: prometheus-adapter
    namespace: openshift-monitoring
    unmanaged: true
EOF
)"

Add spot instance

providerSpec:
  value:
    spotMarketOptions:
      maxPrice: '0.0225'
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 sts --replicas=1 --all -n openshift-monitoring
oc scale deploy prometheus-operator --replicas=0
oc scale deploy cluster-monitoring-operator --replicas=0
oc scale deploy prometheus-adapter --replicas=1
oc scale deploy thanos-querier --replicas=1

oc scale deploy image-registry --replicas=1 -n openshift-image-registry
oc scale deploy console --replicas=1 -n openshift-console
oc scale deploy downloads --replicas=1 -n openshift-console
oc scale deploy oauth-openshift --replicas=1 -n openshift-authentication
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment