Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- patch = {
- "spec": {
- "template": {
- "spec": {
- "containers": [
- {
- "name": "kubedns",
- "resources": {
- "requests": {
- "cpu": "10m",
- "memory": "50Mi",
- },
- "limits": {
- "cpu": "100m",
- "memory": "100Mi",
- }
- }
- }
- ]
- }
- }
- }
- }
- def patch_deployment(name: str, patch: str):
- api_instance = client.AppsV1Api()
- try:
- api_instance.patch_namespaced_deployment(
- name=name,
- namespace='kube-system',
- force=True,
- field_manager='right-sizer',
- body=patch)
- except client.rest.ApiException as e:
- logger.error(f"Failed to patch deployment: {name} - error was {e}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement