Implementing DevOps Solutions and Practices using Cisco Platforms

Configuring Kubernetes Deployment Field for Running Multiple Pods

Question

FILL BLANK - Fill in the blank to complete the statement.

A user wants a Kubernetes deployment to run three separate pods of a web application at one time.

In the deployment YAML, the user must configure the __________ field in the _________ subsection.

Explanations

selector, container.

In the deployment YAML file, the user must configure the "replicas" field in the "spec" subsection to specify the desired number of replicas of the application to run.

The "spec" section of a Kubernetes deployment YAML file describes the desired state of the application deployment, including the number of replicas to run, the container image to use, and other configuration details. The "replicas" field specifies the desired number of identical copies of the application (or "pods") to run at one time.

For example, to configure a Kubernetes deployment to run three separate pods of a web application, the "spec" section of the YAML file might include the following:

yaml
spec: replicas: 3 template: metadata: labels: app: my-web-app spec: containers: - name: my-web-app image: my-web-app-image:latest ports: - containerPort: 80

In this example, the "replicas" field is set to 3 to specify that three identical pods of the "my-web-app" application should be created. The "template" section describes the desired pod configuration, including the container image to use and the ports to expose.