Skip to content

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

@tuanhoangth1603

Description

@tuanhoangth1603

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions