Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ingress example not working #31

Open
kimllee opened this issue Jan 12, 2022 · 2 comments
Open

Ingress example not working #31

kimllee opened this issue Jan 12, 2022 · 2 comments

Comments

@kimllee
Copy link

kimllee commented Jan 12, 2022

Hello,

The ingress example isn't working because now the api used is the networking v1 and the syntax doesn't seem to be recognized
Tested with GKE 1.21.5
Thank you.

Name:             hello-kubernetes-ingress
Namespace:        hello-kubernetes
Address:          
Default backend:  default-http-backend:80 (10.20.0.7:8080)
TLS:
  hello-prod terminates XXXXXXXXXXX
Rules:
  Host        Path  Backends
  ----        ----  --------
  *           
              /hello-world(/|$)(.*)   hello-kubernetes-hello-world:80 (10.20.0.31:8080,10.20.1.30:8080)
Annotations:  acme.cert-manager.io/http01-edit-in-place: true
              cert-manager.io/cluster-issuer: letsencrypt
              kubernetes.io/ingress.class: nginx
              nginx.ingress.kubernetes.io/rewrite-target: /$2
Events:
  Type     Reason          Age                   From                      Message
  ----     ------          ----                  ----                      -------
  Warning  Rejected        <invalid>             nginx-ingress-controller  hello-kubernetes/hello-kubernetes-ingress was rejected: with error: spec.rules[0].host: Required value
  Warning  Rejected        <invalid>             nginx-ingress-controller  hello-kubernetes/hello-kubernetes-ingress was rejected: with error: spec.rules[0].host: Required value
  Warning  Rejected        <invalid>             nginx-ingress-controller  spec.rules[0].host: Required value
  Warning  Rejected        <invalid>             nginx-ingress-controller  spec.rules[0].host: Required value
@dcorbe
Copy link

dcorbe commented Mar 4, 2022

The ingress example probably shouldn't be there at all as Ingress configuration is typically cluster-specific.

@frayos
Copy link

frayos commented Sep 12, 2022

My adapted / working example on K3S 1.23

# hello-kubernetes-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: hello-kubernetes-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
  rules:
  - http:
      paths:
      - pathType: Prefix #Exact
        backend:
          service:
             name: hello-kubernetes-hello-world
             port: 
              number: 80
        path: /hello-world(/|$)(.*)
      - pathType: Prefix #Exact   
        backend:
          service:
             name: hello-kubernetes-custom-message
             port: 
                number: 80
        path: /custom-message(/|$)(.*)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants