1 個回答
- 最新
- 最多得票
- 最多評論
0
【以下的回答经过翻译处理】 你需要使用带有"group"注释的多个"Ingress"。你可以参考这个链接:https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.1/guide/ingress/annotations/#group.order 请按照以下方式进行测试!
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: "base"
annotations:
alb.ingress.kubernetes.io/group.name: example
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
alb.ingress.kubernetes.io/load-balancer-attributes: idle_timeout.timeout_seconds=300
external-dns.alpha.kubernetes.io/hostname: example.com
spec:
rules:
- http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: ssl-redirect
port:
name: use-annotation
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: "jenkins"
annotations:
alb.ingress.kubernetes.io/group.name: example
alb.ingress.kubernetes.io/group.order: 10
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
alb.ingress.kubernetes.io/auth-type: oidc
alb.ingress.kubernetes.io/auth-on-unauthenticated-request: authenticate
alb.ingress.kubernetes.io/auth-idp-oidc: '{"issuer":"https://login.microsoftonline.com/some-id/v2.0","authorizationEndpoint":"https://login.microsoftonline.com/some-id/oauth2/v2.0/authorize","tokenEndpoint":"https://login.microsoftonline.com/some-id/oauth2/v2.0/token","userInfoEndpoint":"https://graph.microsoft.com/oidc/userinfo","secretName":"aws-alb-secret"}'
spec:
rules:
- http:
paths:
- pathType: Prefix
path: /jenkins
backend:
service:
name: jenkins
port:
number: 8080
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: "default"
annotations:
alb.ingress.kubernetes.io/group.name: example
alb.ingress.kubernetes.io/group.order: 20
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
spec:
rules:
- http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: apache
port:
number: 80
相關內容
- 已提問 1 個月前
- 已提問 2 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 9 個月前
- AWS 官方已更新 2 年前
- AWS 官方已更新 8 個月前