0
0
AWScloud~10 mins

Deploying workloads on EKS in AWS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the Kubernetes namespace in the deployment manifest.

AWS
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
Drag options to blanks, or click blank then click option'
Adefault
Bproduction
Cstaging
Dkube-system
Attempts:
3 left
💡 Hint
Common Mistakes
Using a namespace that does not exist in the cluster.
Omitting the namespace field when a specific namespace is required.
2fill in blank
medium

Complete the command to create an EKS cluster using AWS CLI.

AWS
aws eks create-cluster --name my-cluster --role-arn arn:aws:iam::123456789012:role/EKSRole --resources-vpc-config subnetIds=[1]
Drag options to blanks, or click blank then click option'
Asubnet-11111,subnet-22222
Bsubnet-12345,subnet-67890
Csubnet-abcde,subnet-fghij
Dsubnet-xyz12,subnet-xyz34
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid or non-existent subnet IDs.
Separating subnet IDs with spaces instead of commas.
3fill in blank
hard

Fix the error in the kubectl command to apply the deployment manifest.

AWS
kubectl [1] -f deployment.yaml
Drag options to blanks, or click blank then click option'
Adelete
Bapply
Cremove
Dcreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'delete' or 'remove' which deletes resources instead of creating them.
Using 'create' which fails if the resource already exists.
4fill in blank
hard

Fill both blanks to define a container port and protocol in the deployment manifest.

AWS
containers:
- name: my-app-container
  image: my-app-image:latest
  ports:
  - containerPort: [1]
    protocol: [2]
Drag options to blanks, or click blank then click option'
A80
B443
CTCP
DUDP
Attempts:
3 left
💡 Hint
Common Mistakes
Using UDP protocol for HTTP containers.
Using incorrect port numbers for the service.
5fill in blank
hard

Fill all three blanks to create a service manifest exposing the deployment on port 80.

AWS
apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  selector:
    app: [1]
  ports:
  - protocol: [2]
    port: [3]
    targetPort: 80
Drag options to blanks, or click blank then click option'
Amy-app
BTCP
C80
Dmy-service
Attempts:
3 left
💡 Hint
Common Mistakes
Mismatching selector labels causing no pods to be selected.
Using wrong protocol or port numbers.