Skip to content

Instantly share code, notes, and snippets.

@ralvares
Last active February 15, 2021 10:05
Show Gist options
  • Select an option

  • Save ralvares/1400889259cb756cefc2f53f5190652f to your computer and use it in GitHub Desktop.

Select an option

Save ralvares/1400889259cb756cefc2f53f5190652f to your computer and use it in GitHub Desktop.
Fist, Create a MachineConfigPool
----
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfigPool
metadata:
name: infra
spec:
machineConfigSelector:
matchExpressions:
- {key: machineconfiguration.openshift.io/role, operator: In, values: [worker,infra]}
nodeSelector:
matchLabels:
node-role.kubernetes.io/infra: ""
----
.machineset_infra.yaml ( Example )
----
apiVersion: machine.openshift.io/v1beta1
kind: MachineSet
metadata:
labels:
machine.openshift.io/cluster-api-cluster: <CLUSTER-API-CLUSTER>
name: <NameOfMachineset-infra>
spec:
replicas: 2
selector:
matchLabels:
machine.openshift.io/cluster-api-cluster: <CLUSTER-API-CLUSTER>
machine.openshift.io/cluster-api-machineset: <NameOfMachineset-infra>
template:
metadata:
labels:
machine.openshift.io/cluster-api-cluster: <CLUSTER-API-CLUSTER>
machine.openshift.io/cluster-api-machine-role: infra
machine.openshift.io/cluster-api-machine-type: infra
machine.openshift.io/cluster-api-machineset: <NameOfMachineset-infra>
spec:
metadata:
labels:
node-role.kubernetes.io/infra: ""
providerSpec:
value:
.
.
.
.
taints:
- effect: NoSchedule
key: infra
value: reserved
- effect: NoExecute
key: infra
value: reserved
----
oc patch ingresscontroller/default -n openshift-ingress-operator --type=merge -p '{"spec":{"nodePlacement": {"nodeSelector": {"matchLabels": {"node-role.kubernetes.io/infra": ""}},"tolerations": [{"effect":"NoSchedule","key": "infra","value": "reserved"},{"effect":"NoExecute","key": "infra","value": "reserved"}]}}}'
@ralvares
Copy link
Author

...

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