Skip to content

Instantly share code, notes, and snippets.

@Jamstah
Last active March 2, 2020 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jamstah/1b8e2473430a1e82aa46e604bf022115 to your computer and use it in GitHub Desktop.
Save Jamstah/1b8e2473430a1e82aa46e604bf022115 to your computer and use it in GitHub Desktop.
IBM Platform Common Services dedicated node fix
#!/bin/sh
#
# Patch IBM Platform Common Services 3.2.3 with correct node selectors and tolerations
#
# This script can be run multiple times without adverse affects
#
kubectl patch deployment iam-policy-controller -n kube-system --patch '{"spec":{"template":{"spec":{"nodeSelector":{"master": "true"}}}}}'
kubectl patch statefulset prometheus-monitoring-prometheus -n kube-system --patch '{"spec":{"template":{"spec":{"nodeSelector":{"management": "true"},"tolerations":[{"effect":"NoSchedule","key":"dedicated","operator":"Exists"}]}}}}'
kubectl patch deployment monitoring-grafana -n kube-system --patch '{"spec":{"template":{"spec":{"nodeSelector":{"management": "true"},"tolerations":[{"effect":"NoSchedule","key":"dedicated","operator":"Exists"}]}}}}'
kubectl patch deployment monitoring-prometheus-collectdexporter -n kube-system --patch '{"spec":{"template":{"spec":{"nodeSelector":{"management": "true"},"tolerations":[{"effect":"NoSchedule","key":"dedicated","operator":"Exists"}]}}}}'
kubectl patch deployment monitoring-prometheus-kubestatemetrics -n kube-system --patch '{"spec":{"template":{"spec":{"nodeSelector":{"management": "true"},"tolerations":[{"effect":"NoSchedule","key":"dedicated","operator":"Exists"}]}}}}'
kubectl patch deployment monitoring-prometheus-operator -n kube-system --patch '{"spec":{"template":{"spec":{"nodeSelector":{"management": "true"},"tolerations":[{"effect":"NoSchedule","key":"dedicated","operator":"Exists"}]}}}}'
# License service is optional
kubectl get deployment ibm-licensing-licensing -n kube-system >/dev/null 2>&1 && kubectl patch deployment ibm-licensing-licensing -n kube-system --patch '{"spec":{"template":{"spec":{"nodeSelector":{"management": "true"},"tolerations":[{"effect":"NoSchedule","key":"dedicated","operator":"Exists"}]}}}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment