SHARE
TWEET

Untitled

a guest Oct 17th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. patch = {
  2.         "spec": {
  3.             "template": {
  4.                 "spec": {
  5.                     "containers": [
  6.                         {
  7.                             "name": "kubedns",
  8.                             "resources": {
  9.                                 "requests": {
  10.                                     "cpu": "10m",
  11.                                     "memory": "50Mi",
  12.                                 },
  13.                                 "limits": {
  14.                                     "cpu": "100m",
  15.                                     "memory": "100Mi",
  16.                                 }
  17.                             }
  18.                         }
  19.                     ]
  20.                 }
  21.             }
  22.         }
  23.     }
  24.  
  25. def patch_deployment(name: str, patch: str):
  26.     api_instance = client.AppsV1Api()
  27.     try:
  28.         api_instance.patch_namespaced_deployment(
  29.             name=name,
  30.             namespace='kube-system',
  31.             force=True,
  32.             field_manager='right-sizer',
  33.             body=patch)
  34.     except client.rest.ApiException as e:
  35.         logger.error(f"Failed to patch deployment: {name} - error was {e}")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top