Expand the deployment_crud example to include requests and limits specification

This commit is contained in:
MoShitrit 2020-05-05 00:36:33 -04:00
parent 10a7f95435
commit a318e83c37

View File

@ -26,7 +26,12 @@ def create_deployment_object():
container = client.V1Container(
name="nginx",
image="nginx:1.15.4",
ports=[client.V1ContainerPort(container_port=80)])
ports=[client.V1ContainerPort(container_port=80)],
resources=client.V1ResourceRequirements(
requests={"cpu": "100m", "memory": "200Mi"},
limits={"cpu": "500m", "memory": "500Mi"}
)
)
# Create and configurate a spec section
template = client.V1PodTemplateSpec(
metadata=client.V1ObjectMeta(labels={"app": "nginx"}),