Complete the code to specify the TLS secret name in the Ingress resource.
spec:
tls:
- hosts:
- example.com
secretName: [1]The secretName field must match the name of the Kubernetes secret that contains the TLS certificate and key for the domain.
Complete the Ingress rule to route traffic to the correct service port.
spec:
rules:
- host: example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-service
port:
number: [1]The port.number should match the port your service listens on, often 8080 for HTTP apps.
Fix the error in the Ingress TLS configuration by completing the missing field.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
spec:
tls:
- hosts:
- example.com
[1]: my-tls-secretcertificate or tlsSecret.secretName field.The correct field to specify the TLS secret is secretName.
Fill both blanks to complete the Ingress rule for TLS termination and backend service.
spec:
tls:
- hosts:
- [1]
secretName: my-tls-secret
rules:
- host: [2]
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-service
port:
number: 8080The hosts under tls and the host under rules must match exactly for TLS termination to work properly.
Fill all three blanks to create a complete Ingress resource with TLS termination and backend service routing.
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
The Ingress metadata.name, TLS hosts, and secretName must be set correctly to enable TLS termination and route traffic to the backend service.