I am learning CKS - CLUSTER SETUP AND HARDENING, LABS – INGRESS – 2.
Ingress is failing (404 when accessing URLs) when ingress class is supplied. I tried to reproduce this couple of times and it consistently fails. I understand there are no ingressclasses, but why that is? According to the documentation a default ingress should be supplied if a specific ingress class is not in use. But I see no ingressclass configured.
controlplane ~ ➜ k get ingressclasses.networking.k8s.io -A
No resources found
I compared the lab provided solution with the one I created based on official documentation reference and the only difference I can see is the class not supplied in lab solution. Why that is?
controlplane ~ sdiff provided.yaml created.yaml
— <
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: ingress-wear-watch name: ingress-wear-watch
namespace: app-space <
annotations: annotations:
nginx.ingress.kubernetes.io/rewrite-target: / nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/ssl-redirect: “false” | namespace: app-space
spec: spec:
> ingressClassName: nginx
rules: rules:
- http: - http:
paths: paths:- path: /wear - path: /wear
pathType: Prefix pathType: Prefix
backend: backend:
service: service:
name: wear-service | name: wear-service
port: | port:
number: 8080 | number: 8080 - path: /watch - path: /watch
pathType: Prefix pathType: Prefix
backend: backend:
service: service:
name: video-service | name: video-service
port: | port:
number: 8080 | number: 8080
- path: /wear - path: /wear