英文:
Deploying traefik on EKS with Application Load Balancer controller
问题
我正在尝试在AWS EKS集群上使用Load Balancer Controller设置traefik
。以下是我的helm-values.yml文件的外观:
ingressClass:
enabled: true
isDefaultClass: true
ingressRoute:
dashboard:
enabled: false
service:
enabled: true
type: NodePort
globalArguments:
- "--api.insecure=true"
我使用以下命令通过helm chart部署traefik
:helm install traefik traefik/traefik --create-namespace --namespace=traefik --values=helm-values.yaml
接下来,我创建了dashboard.yml文件来部署traefik仪表板。以下是dashboard.yml文件的外观:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: traefik
name: traefik-ingress
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: instance
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: traefik
port:
number: 80
---
apiVersion: v1
kind: Secret
metadata:
name: basic-auth-creds
namespace: traefik
type: kubernetes.io/basic-auth
stringData:
username: test
password: password
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: basic-auth
namespace: traefik
spec:
basicAuth:
secret: basic-auth-creds
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: dashboard
namespace: traefik
spec:
entryPoints:
- web
routes:
- match: PathPrefix(`/dashboard`, `/dashboard/`) || PathPrefix(`/api`, `/api/`)
kind: Rule
services:
- name: api@internal
kind: TraefikService
middlewares:
- name: basic-auth
namespace: traefik
当我部署dashboard.yml文件时,我可以看到一个应用程序负载均衡器被创建,但健康检查失败,当我访问http://myalbdnsname/dashboard
时,我收到404页面未找到错误
。我漏掉了什么?
英文:
I am trying to setup traefik
on AWS EKS Cluster with Load Balancer Controller.
Here is how my helm-values.yml file looks like:
ingressClass:
enabled: true
isDefaultClass: true
ingressRoute:
dashboard:
enabled: false
service:
enabled: true
type: NodePort
globalArguments:
- "--api.insecure=true"
I deploy trefik
using helm chart by issuing command: helm install traefik traefik/traefik --create-namespace --namespace=traefik --values=helm-values.yaml
Next, I created dashboard.yml file to deploy the traefik dashboard. This is how the dashboard.yml file looks like:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: traefik
name: traefik-ingress
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: instance
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: traefik
port:
number: 80
---
apiVersion: v1
kind: Secret
metadata:
name: basic-auth-creds
namespace: traefik
type: kubernetes.io/basic-auth
stringData:
username: test
password: password
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: basic-auth
namespace: traefik
spec:
basicAuth:
secret: basic-auth-creds
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: dashboard
namespace: traefik
spec:
entryPoints:
- web
routes:
- match: PathPrefix(`/dashboard`, `/dashboard/`) || PathPrefix(`/api`, `/api/`)
kind: Rule
services:
- name: api@internal
kind: TraefikService
middlewares:
- name: basic-auth
namespace: traefik
When I deploy dashboard.yml
file, I can see a Application Load Balancer being created but the health checks fail and when I visit http://myalbdnsname/dashboard
, I get 404 page not found error
What am I missing here?
答案1
得分: 1
尝试在"dashboard"后面添加斜杠,这样就会变成http://myalbdnsname/dashboard/
英文:
Try to add / after dashboard
So it'll be http://myalbdnsname/dashboard/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论