0
0
Kubernetesdevops~10 mins

TLS termination with Ingress in Kubernetes - 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 TLS secret name in the Ingress resource.

Kubernetes
spec:
  tls:
  - hosts:
    - example.com
    secretName: [1]
Drag options to blanks, or click blank then click option'
Adefault-secret
Bingress-secret
Cmy-tls-secret
Dtls-cert
Attempts:
3 left
💡 Hint
Common Mistakes
Using a secret name that does not exist.
Leaving the secretName field empty.
2fill in blank
medium

Complete the Ingress rule to route traffic to the correct service port.

Kubernetes
spec:
  rules:
  - host: example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: my-service
            port:
              number: [1]
Drag options to blanks, or click blank then click option'
A80
B443
C3000
D8080
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 443 which is for HTTPS, but the service listens on HTTP port.
Using port 80 when the service listens on a different port.
3fill in blank
hard

Fix the error in the Ingress TLS configuration by completing the missing field.

Kubernetes
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example-ingress
spec:
  tls:
  - hosts:
    - example.com
    [1]: my-tls-secret
Drag options to blanks, or click blank then click option'
AsecretName
Bcertificate
CtlsSecret
DkeyName
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect field names like certificate or tlsSecret.
Omitting the secretName field.
4fill in blank
hard

Fill both blanks to complete the Ingress rule for TLS termination and backend service.

Kubernetes
spec:
  tls:
  - hosts:
    - [1]
    secretName: my-tls-secret
  rules:
  - host: [2]
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: my-service
            port:
              number: 8080
Drag options to blanks, or click blank then click option'
Aexample.com
Bmy-service
Ctest.com
Dbackend-service
Attempts:
3 left
💡 Hint
Common Mistakes
Using different host names in TLS and rules sections.
Using service names instead of host names.
5fill in blank
hard

Fill all three blanks to create a complete Ingress resource with TLS termination and backend service routing.

Kubernetes
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: [1]
spec:
  tls:
  - hosts:
    - [2]
    secretName: [3]
  rules:
  - host: [2]
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: my-service
            port:
              number: 8080
Drag options to blanks, or click blank then click option'
Aexample-ingress
Bexample.com
Cmy-tls-secret
Ddefault-ingress
Attempts:
3 left
💡 Hint
Common Mistakes
Using mismatched host names in TLS and rules.
Incorrect secret name that does not exist.
Using service name as Ingress name.