0

I am trying to create ingress in kubernetes 1.29.x cluster, this is the yaml configuration:

apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
  name: ai-web-route
  namespace: reddwarf-pro
spec:
  entryPoints:
    - web
  routes:
    - kind: Rule
      match: >-
        Host(`ai.example.top`) && (PathPrefix(`/infra/user/login`) ||
        PathPrefix(`/infra/auth/access-token/refresh`) ||
        PathPrefix(`/infra/user/reg`))
      priority: 8
      services:
        - name: infra-server-service
          port: 8081
    - kind: Rule
      match: Host(`ai.example.top`) && PathPrefix(`/infra`)
      middlewares:
        - name: jwt-token-auth
      priority: 2
      services:
        - name: infra-server-service
          port: 8081
    - kind: Rule
      match: Host(`ai.example.top`) && PathPrefix(`/ai`)
      middlewares:
        - name: jwt-token-auth
      priority: 2
      services:
        - name: chat-hub-service
          port: 8081
    - kind: Rule
      match: Host(`ai.example.top`)
      priority: 1
      services:
        - name: ai-web
          port: 80

then using this command to get the ingress route resource:

[root@iZm5e2jhfbrshckqh6qdbuZ ~]# kubectl get ingressroute --all-namespaces -o wide
NAMESPACE      NAME                      AGE
reddwarf-pro   official-website-route    77m
reddwarf-pro   react-admin-new-route     77m
reddwarf-pro   react-admin-route         77m
reddwarf-pro   snap-web-route            77m
reddwarf-pro   tex-websocket-route       77m
reddwarf-pro   tool-web-route            77m
sre            apollo-dev-config-route   77m
sre            apollo-route              77m

did not found the new create ingress route ai-web-route. Am I missing something? By the way, I am create the ingress in Lens and the lens shows create success.

2
  • I assume you have traefik running in your k8s cluster. Can you add the output when you appy your route yaml file. And also the output of kubectl get all,ing -n reddwarf-pro
    – Hackerman
    Commented Jul 8 at 17:45
  • As suggested here Did you try to limit your CustomResourceDefinition to a particular namespace? Commented Jul 8 at 20:35

0

Browse other questions tagged or ask your own question.