0
0
GCPcloud~10 mins

GKE Ingress with Load Balancer in GCP - Interactive Code Practice

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

Complete the code to create a Kubernetes Ingress resource that uses a Load Balancer.

GCP
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example-ingress
spec:
  [1]:
  - host: example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: example-service
            port:
              number: 80
Drag options to blanks, or click blank then click option'
Aports
Brules
Cservices
Dendpoints
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ports' instead of 'rules' causes the Ingress to be invalid.
Confusing 'services' or 'endpoints' with Ingress routing rules.
2fill in blank
medium

Complete the command to create a GKE Ingress resource with a Load Balancer.

GCP
kubectl [1] -f ingress.yaml
Drag options to blanks, or click blank then click option'
Adelete
Bdescribe
Cget
Dapply
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'delete' removes resources instead of creating them.
Using 'get' or 'describe' only shows information, does not create.
3fill in blank
hard

Fix the error in the Ingress YAML by completing the missing field for backend service port number.

GCP
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: test-ingress
spec:
  rules:
  - host: test.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: test-service
            port:
              number: [1]
Drag options to blanks, or click blank then click option'
A80
Beighty
Chttp
Dport
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string like 'eighty' instead of the number 80.
Using 'http' or 'port' as the port number causes errors.
4fill in blank
hard

Fill both blanks to define a backend service and port in the Ingress spec.

GCP
backend:
  service:
    name: [1]
    port:
      number: [2]
Drag options to blanks, or click blank then click option'
Amy-service
B8080
C80
Dbackend-service
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid service names or wrong port numbers.
Mixing service names and port numbers.
5fill in blank
hard

Fill all three blanks to create a complete Ingress rule with host, path, and backend service port.

GCP
rules:
- host: [1]
  http:
    paths:
    - path: [2]
      pathType: Prefix
      backend:
        service:
          name: example-service
          port:
            number: [3]
Drag options to blanks, or click blank then click option'
Amyapp.example.com
B/app
C80
D443
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 443 without TLS configured.
Incorrect host or path format.