forked from bn222/cluster-deployment-automation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common_patches.py
23 lines (15 loc) · 906 Bytes
/
common_patches.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from k8sClient import K8sClient
from logger import logger
def apply_common_pathches(client: K8sClient) -> None:
patch_dns(client)
patch_ingress(client)
patch_monitoring(client)
def patch_dns(client: K8sClient) -> None:
logger.info("Apply dns patch")
client.oc("patch --type=merge --patch='{\"spec\":{\"nodePlacement\": {\"nodeSelector\": " "{\"node-role.kubernetes.io/master\": \"\"}}}}' dns.operator/default")
def patch_ingress(client: K8sClient) -> None:
logger.info("Apply ingress patch")
client.oc("patch --type=merge --patch='{\"spec\":{\"nodePlacement\": {\"nodeSelector\": {\"matchLabels\": " "{\"node-role.kubernetes.io/master\": \"\"}}}}}' " "-n openshift-ingress-operator ingresscontroller/default")
def patch_monitoring(client: K8sClient) -> None:
logger.info("Apply monitoring patches")
client.oc("create -f manifests/common/monitor-patch-cm.yaml")