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

Traefik return 404 page not found - Kubernetes on Cloudstack 4.17.2.0 #7517

Closed
tuanhoangth1603 opened this issue May 11, 2023 · 2 comments
Closed

Comments

@tuanhoangth1603
Copy link

tuanhoangth1603 commented May 11, 2023

Hello,
I created a Kubernetes cluster on Cloudstack and used this guide (https://docs.cloudstack.apache.org/en/latest/plugins/cloudstack-kubernetes-provider.html) to deploy Traefik as an ingress controller.

  1. According to the guide:
    On successfully deploying the yaml file, a new Public IP Address in the same network as the cluster will be created. It will automatically have the firewall and port forwarding rules configured to distribute any traffic amongst the cluster worker nodes

However, upon inspecting the LB rules, I noticed that the control node was also added as a backend server ?
image

  1. Furthermore, I created and deployed a file that defines a basic deployment, service, and ingress. However, when I curl http://k8s.lab.com.vn/, the response is "404 page not found". Is there a mistake in my YAML file?
    Thanks for your help!
---
apiVersion: v1
kind: Service
metadata:
  name: app
spec:
  selector:
    app: app
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: app-deployment
  labels:
    app: app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: app
  template:
    metadata:
      labels:
        app: app
    spec:
      containers:
      - name: app
        image: nginx:latest
        ports:
        - containerPort: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: traefik-app-ingress
spec:
  rules:
    - host: k8s.lab.com.vn
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name:  app
                port:
                  number: 80
@weizhouapache
Copy link
Member

@tuanhoangth1603
have you solved the issue ?

@tuanhoangth1603
Copy link
Author

I follow this guide and the issue was solved.
https://doc.traefik.io/traefik/getting-started/install-traefik/

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

2 participants