最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to configure kubernetes' haproxy-ingres for host or path? - Stack Overflow

programmeradmin0浏览0评论

With this setup I was able to get 'global' settings for haproxy ingress controller. Can I modify this settings to change configuration on a host or path level?

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: gn-ingress
  namespace: gn
  annotations:
    kubernetes.io/ingress.class: haproxy
    haproxy/backend-config-snippet: |
      timeout server 600s
      timeout client 600s
      timeout http-request 60s
spec:
  rules:
    - host: "myhost1"
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: myhost
                port:
                  number: 80

With this setup I was able to get 'global' settings for haproxy ingress controller. Can I modify this settings to change configuration on a host or path level?

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: gn-ingress
  namespace: gn
  annotations:
    kubernetes.io/ingress.class: haproxy
    haproxy.org/backend-config-snippet: |
      timeout server 600s
      timeout client 600s
      timeout http-request 60s
spec:
  rules:
    - host: "myhost1.org"
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: myhost
                port:
                  number: 80

Share Improve this question asked Feb 6 at 14:07 dimusdimus 9,37011 gold badges48 silver badges57 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Annotations can only be applied to the whole kubernetes resource because they are part of the resource metadata. One way to solve this is to create separate Ingress resources for each host or path with specific settings.

发布评论

评论列表(0)

  1. 暂无评论