82 lines
2.5 KiB
Django/Jinja
82 lines
2.5 KiB
Django/Jinja
---
|
|
{% if traefik_version | regex_search('(^1.)') %}
|
|
#will not work: weave hate https...
|
|
apiVersion: extensions/v1beta1
|
|
kind: Ingress
|
|
metadata:
|
|
name: weave
|
|
namespace: weave
|
|
annotations:
|
|
{% if ingress_whitelist is defined %}
|
|
ingress.kubernetes.io/whitelist-source-range: "{% for acl_whitelist in ingress_whitelist %}{{ acl_whitelist }}{% if not loop.last %}, {% endif %}{% endfor %}"
|
|
{% endif %}
|
|
traefik.frontend.priority: "10"
|
|
{% if basic_auth is defined %}
|
|
traefik.ingress.kubernetes.io/auth-type: basic
|
|
traefik.ingress.kubernetes.io/auth-secret: basic-auth
|
|
{% endif %}
|
|
spec:
|
|
rules:
|
|
- host: weave.{{ ingress_domain }}
|
|
http:
|
|
paths:
|
|
- path: /
|
|
backend:
|
|
serviceName: weave-scope-app
|
|
servicePort: 80
|
|
{% else %}
|
|
{% if traefik_version | regex_search('(^2.)') %}
|
|
apiVersion: traefik.containo.us/v1alpha1
|
|
kind: IngressRoute
|
|
metadata:
|
|
name: weave
|
|
namespace: weave
|
|
labels:
|
|
app: weave
|
|
|
|
spec:
|
|
entryPoints:
|
|
- https
|
|
routes:
|
|
# Match is the rule corresponding to an underlying router.
|
|
# Later on, match could be the simple form of a path prefix, e.g. just "/bar",
|
|
# but for now we only support a traefik style matching rule.
|
|
- match: Host(`weave.{{ ingress_domain }}`)
|
|
# kind could eventually be one of "Rule", "Path", "Host", "Method", "Header",
|
|
# "Parameter", etc, to support simpler forms of rule matching, but for now we
|
|
# only support "Rule".
|
|
kind: Rule
|
|
# (optional) Priority disambiguates rules of the same length, for route matching.
|
|
priority: 12
|
|
{% if basic_auth is defined or ingress_whitelist is defined %}
|
|
middlewares:
|
|
{% if ingress_whitelist is defined %}
|
|
- name: traefik-ipwhitelist
|
|
namespace: tools
|
|
{% endif %}
|
|
{% if basic_auth is defined %}
|
|
- name: basic-auth
|
|
namespace: tools
|
|
{% endif %}
|
|
{% endif %}
|
|
services:
|
|
- name: weave-scope-app
|
|
port: 80
|
|
# (default 1) A weight used by the weighted round-robin strategy (WRR).
|
|
weight: 1
|
|
# (default true) PassHostHeader controls whether to leave the request's Host
|
|
# Header as it was before it reached the proxy, or whether to let the proxy set it
|
|
# to the destination (backend) host.
|
|
passHostHeader: true
|
|
responseForwarding:
|
|
# (default 100ms) Interval between flushes of the buffered response body to the client.
|
|
flushInterval: 100ms
|
|
tls:
|
|
store:
|
|
name: default
|
|
namespace: {{ traefik_namespace }}
|
|
options:
|
|
name: default
|
|
namespace: {{ traefik_namespace }}
|
|
{% endif %}
|
|
{% endif %}
|