0
0
Kubernetesdevops~10 mins

Why Ingress manages external access in Kubernetes - Test Your Understanding

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

Complete the code to define an Ingress resource that manages external access.

Kubernetes
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
Bservices
Crules
Dendpoints
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'services' instead of 'rules' causes a syntax error.
Confusing 'endpoints' with Ingress routing rules.
2fill in blank
medium

Complete the code to specify the backend service port in the Ingress.

Kubernetes
spec:
  rules:
  - host: example.com
    http:
      paths:
      - path: /app
        pathType: Prefix
        backend:
          service:
            name: app-service
            port:
              number: [1]
Drag options to blanks, or click blank then click option'
A80
B443
C22
D8080
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 22 (SSH) causes connection failure.
Using port 443 without TLS configuration causes errors.
3fill in blank
hard

Fix the error in the Ingress pathType to correctly route traffic.

Kubernetes
spec:
  rules:
  - host: example.com
    http:
      paths:
      - path: /api
        pathType: [1]
        backend:
          service:
            name: api-service
            port:
              number: 80
Drag options to blanks, or click blank then click option'
AExact
BPrefix
CRegex
DContains
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Regex' causes syntax errors as it's not supported in this version.
Using 'Contains' is invalid pathType.
4fill in blank
hard

Fill both blanks to configure TLS for Ingress external access.

Kubernetes
spec:
  tls:
  - hosts:
    - [1]
    secretName: [2]
Drag options to blanks, or click blank then click option'
Aexample.com
Bmy-tls-secret
Cdefault-secret
Dmy-service
Attempts:
3 left
💡 Hint
Common Mistakes
Using service name instead of secret name for TLS.
Using wrong domain name in hosts causes TLS errors.
5fill in blank
hard

Fill all three blanks to create an Ingress rule that routes traffic to a service on a specific path.

Kubernetes
spec:
  rules:
  - host: [1]
    http:
      paths:
      - path: [2]
        pathType: [3]
        backend:
          service:
            name: web-service
            port:
              number: 80
Drag options to blanks, or click blank then click option'
Amyapp.example.com
B/web
CPrefix
D/api
Attempts:
3 left
💡 Hint
Common Mistakes
Using path without leading slash causes routing failure.
Using 'Exact' pathType when prefix matching is needed.