Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply taint and tolerations to infra #215

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions OCP-4.X/roles/post-install/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,6 @@
KUBECONFIG: "{{ kubeconfig_path }}"
when: (openshift_toggle_infra_node|bool == true or openshift_toggle_workload_node|bool == true)

- name: Relabel the infra nodes
shell: |
oc label nodes --overwrite -l 'node-role.kubernetes.io/infra=' node-role.kubernetes.io/worker-
environment:
KUBECONFIG: "{{ kubeconfig_path }}"
when: openshift_toggle_infra_node|bool

- name: Relabel the workload node
shell: |
oc label nodes --overwrite -l 'node-role.kubernetes.io/workload=' node-role.kubernetes.io/worker-
Expand Down Expand Up @@ -382,12 +375,12 @@
- namespace: openshift-ingress-operator
object: ingresscontrollers/default
patch: |
'{"spec": {"nodePlacement": {"nodeSelector": {"matchLabels": {"node-role.kubernetes.io/infra": ""}}}}}'
'{"spec":{"nodePlacement": {"nodeSelector": {"matchLabels": {"node-role.kubernetes.io/infra": ""}},"tolerations": [{"effect":"NoSchedule","key": "node-role.kubernetes.io/infra","value": "reserved"},{"effect":"NoExecute","key": "node-role.kubernetes.io/infra","value": "reserved"}]}}}'
type: "--type merge"
- namespace: openshift-image-registry
object: configs.imageregistry.operator.openshift.io/cluster
patch: |
'{"spec": {"nodeSelector": {"node-role.kubernetes.io/infra": ""}}}'
'{"spec":{"nodeSelector": {"node-role.kubernetes.io/infra": ""},"tolerations": [{"effect":"NoSchedule","key": "node-role.kubernetes.io/infra","value": "reserved"},{"effect":"NoExecute","key": "node-role.kubernetes.io/infra","value": "reserved"}]}}'
type: "--type merge"
# Monitoring (Relocate cluster-monitoring-operator from worker nodes) - Requires CVO overriding
#- namespace: openshift-monitoring
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ items:
vpcId: ""
zoneId: {{alibaba_region}}a
taints:
- key: node-role.kubernetes.io/infra
effect: NoSchedule
- effect: NoSchedule
key: node-role.kubernetes.io/infra
value: reserved
- effect: NoExecute
key: node-role.kubernetes.io/infra
value: reserved
- apiVersion: machine.openshift.io/v1beta1
kind: MachineSet
metadata:
Expand Down Expand Up @@ -162,5 +166,9 @@ items:
vpcId: ""
zoneId: {{alibaba_region}}b
taints:
- key: node-role.kubernetes.io/infra
effect: NoSchedule
- effect: NoSchedule
key: node-role.kubernetes.io/infra
value: reserved
- effect: NoExecute
key: node-role.kubernetes.io/infra
value: reserved
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ items:
creationTimestamp: null
labels:
node-role.kubernetes.io/infra: ""
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/infra
value: reserved
- effect: NoExecute
key: node-role.kubernetes.io/infra
value: reserved
providerSpec:
value:
ami:
Expand Down Expand Up @@ -99,6 +106,13 @@ items:
creationTimestamp: null
labels:
node-role.kubernetes.io/infra: ""
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/infra
value: reserved
- effect: NoExecute
key: node-role.kubernetes.io/infra
value: reserved
providerSpec:
value:
ami:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ items:
creationTimestamp: null
labels:
node-role.kubernetes.io/infra: ""
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/infra
value: reserved
- effect: NoExecute
key: node-role.kubernetes.io/infra
value: reserved
providerSpec:
value:
apiVersion: azureproviderconfig.openshift.io/v1beta1
Expand Down Expand Up @@ -95,6 +102,13 @@ items:
creationTimestamp: null
labels:
node-role.kubernetes.io/infra: ""
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/infra
value: reserved
- effect: NoExecute
key: node-role.kubernetes.io/infra
value: reserved
providerSpec:
value:
apiVersion: azureproviderconfig.openshift.io/v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ data:
configReloaderBaseImage: quay.io/coreos/configmap-reload
nodeSelector:
node-role.kubernetes.io/infra: ""
tolerations:
- key: node-role.kubernetes.io/infra
value: reserved
effect: NoSchedule
- key: node-role.kubernetes.io/infra
value: reserved
effect: NoExecute
prometheusK8s:
{% if thanos_enable %}
externalLabels:
Expand All @@ -22,6 +29,13 @@ data:
baseImage: openshift/prometheus
nodeSelector:
node-role.kubernetes.io/infra: ""
tolerations:
- key: node-role.kubernetes.io/infra
value: reserved
effect: NoSchedule
- key: node-role.kubernetes.io/infra
value: reserved
effect: NoExecute
volumeClaimTemplate:
spec:
storageClassName: {{openshift_prometheus_storage_class}}
Expand All @@ -32,6 +46,13 @@ data:
baseImage: openshift/prometheus-alertmanager
nodeSelector:
node-role.kubernetes.io/infra: ""
tolerations:
- key: node-role.kubernetes.io/infra
value: reserved
effect: NoSchedule
- key: node-role.kubernetes.io/infra
value: reserved
effect: NoExecute
volumeClaimTemplate:
spec:
storageClassName: {{openshift_alertmanager_storage_class}}
Expand All @@ -46,15 +67,36 @@ data:
baseImage: quay.io/coreos/kube-state-metrics
nodeSelector:
node-role.kubernetes.io/infra: ""
tolerations:
- key: node-role.kubernetes.io/infra
value: reserved
effect: NoSchedule
- key: node-role.kubernetes.io/infra
value: reserved
effect: NoExecute
grafana:
baseImage: grafana/grafana
nodeSelector:
node-role.kubernetes.io/infra: ""
tolerations:
- key: node-role.kubernetes.io/infra
value: reserved
effect: NoSchedule
- key: node-role.kubernetes.io/infra
value: reserved
effect: NoExecute
auth:
baseImage: openshift/oauth-proxy
k8sPrometheusAdapter:
nodeSelector:
node-role.kubernetes.io/infra: ""
tolerations:
- key: node-role.kubernetes.io/infra
value: reserved
effect: NoSchedule
- key: node-role.kubernetes.io/infra
value: reserved
effect: NoExecute
metadata:
name: cluster-monitoring-config
namespace: openshift-monitoring
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ items:
creationTimestamp: null
labels:
node-role.kubernetes.io/infra: ""
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/infra
value: reserved
- effect: NoExecute
key: node-role.kubernetes.io/infra
value: reserved
providerSpec:
value:
apiVersion: gcpprovider.openshift.io/v1beta1
Expand Down Expand Up @@ -91,6 +98,13 @@ items:
creationTimestamp: null
labels:
node-role.kubernetes.io/infra: ""
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/infra
value: reserved
- effect: NoExecute
key: node-role.kubernetes.io/infra
value: reserved
providerSpec:
value:
apiVersion: gcpprovider.openshift.io/v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ items:
creationTimestamp: null
labels:
node-role.kubernetes.io/infra: ""
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/infra
value: reserved
- effect: NoExecute
key: node-role.kubernetes.io/infra
value: reserved
providerSpec:
value:
apiVersion: openstackproviderconfig.k8s.io/v1alpha1
Expand Down