Complete the code to specify the Kubernetes namespace in the deployment manifest.
apiVersion: apps/v1 kind: Deployment metadata: name: my-app namespace: [1] spec: replicas: 3 selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - name: my-app-container image: my-app-image:latest
The namespace field specifies where the deployment will be created. Using default is common for simple deployments.
Complete the command to create an EKS cluster using AWS CLI.
aws eks create-cluster --name my-cluster --role-arn arn:aws:iam::123456789012:role/EKSRole --resources-vpc-config subnetIds=[1]
The subnetIds parameter requires the IDs of the subnets where the cluster resources will be created. These must be valid subnet IDs in your VPC.
Fix the error in the kubectl command to apply the deployment manifest.
kubectl [1] -f deployment.yamlThe kubectl apply command updates or creates resources from a manifest file. It is the correct command to deploy or update workloads.
Fill both blanks to define a container port and protocol in the deployment manifest.
containers: - name: my-app-container image: my-app-image:latest ports: - containerPort: [1] protocol: [2]
The containerPort defines the port the container listens on, commonly 80 for HTTP. The protocol is usually TCP for web traffic.
Fill all three blanks to create a service manifest exposing the deployment on port 80.
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
selector:
app: [1]
ports:
- protocol: [2]
port: [3]
targetPort: 80The selector matches the deployment's label app: my-app. The service uses TCP protocol and exposes port 80 to route traffic to the container's port 80.