Switch plugin traefik-on-demand by sablier
This commit is contained in:
parent
48c523ec9a
commit
62961f7e06
4 changed files with 79 additions and 36 deletions
|
|
@ -70,13 +70,17 @@ data:
|
|||
kubernetesCRD:
|
||||
# ingressClass: "traefik"
|
||||
throttleDuration: 2s
|
||||
{% if traefik_ondemand is defined %}
|
||||
allowEmptyServices: true
|
||||
{% endif%}
|
||||
kubernetesIngress:
|
||||
ingressClass: "traefik"
|
||||
{% if traefik_hub_token is defined %}
|
||||
allowExternalNameServices: true
|
||||
{% endif%}
|
||||
{% if traefik_ondemand is defined %}
|
||||
allowEmptyServices: true
|
||||
{% endif%}
|
||||
file:
|
||||
directory: /etc/traefik/file/
|
||||
watch: true
|
||||
|
|
@ -113,8 +117,8 @@ data:
|
|||
{% endif %}
|
||||
{% if traefik_ondemand is defined %}
|
||||
plugins:
|
||||
traefik-ondemand-plugin:
|
||||
moduleName: github.com/acouvreur/traefik-ondemand-plugin
|
||||
version: v1.2.0
|
||||
sablier:
|
||||
moduleName: github.com/acouvreur/sablier
|
||||
version: v1.7.0
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,19 @@ data:
|
|||
- {{ acl_whitelist }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if traefik_ondemand is defined %}
|
||||
ondemand:
|
||||
plugin:
|
||||
sablier:
|
||||
#group: default
|
||||
dynamic:
|
||||
displayName: Application is starting
|
||||
refreshFrequency: 5s
|
||||
showDetails: "true"
|
||||
theme: hacker-terminal
|
||||
sablierUrl: http://sablier:10000
|
||||
sessionDuration: 1m
|
||||
{% endif %}
|
||||
{% if basic_auth|bool %}
|
||||
basic-auth:
|
||||
basicAuth:
|
||||
|
|
|
|||
|
|
@ -144,6 +144,11 @@ metrics:
|
|||
experimental:
|
||||
plugins:
|
||||
enabled: true
|
||||
{% if traefik_ondemand is defined %}
|
||||
sablier:
|
||||
moduleName: "github.com/acouvreur/sablier"
|
||||
version: "v1.7.0"
|
||||
{% endif %}
|
||||
kubernetesGateway:
|
||||
enabled: false
|
||||
{% if traefik_hub_token is defined %}
|
||||
|
|
|
|||
|
|
@ -1,35 +1,35 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: traefik-ondemand-service
|
||||
name: sablier
|
||||
labels:
|
||||
app: traefik-ondemand-service
|
||||
app: sablier
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: traefik-ondemand-service
|
||||
app: sablier
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: traefik-ondemand-service
|
||||
app: sablier
|
||||
spec:
|
||||
serviceAccountName: traefik-ondemand-service
|
||||
serviceAccount: traefik-ondemand-service
|
||||
serviceAccountName: sablier
|
||||
serviceAccount: sablier
|
||||
containers:
|
||||
- name: traefik-ondemand-service
|
||||
image: ghcr.io/acouvreur/traefik-ondemand-service:1
|
||||
args: ["--swarmMode=false", "--kubernetesMode=true"]
|
||||
- name: sablier
|
||||
image: acouvreur/sablier:1.7.0
|
||||
args: ["start", "--provider.name=kubernetes"]
|
||||
ports:
|
||||
- containerPort: 10000
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: traefik-ondemand-service
|
||||
name: sablier
|
||||
spec:
|
||||
selector:
|
||||
app: traefik-ondemand-service
|
||||
app: sablier
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 10000
|
||||
|
|
@ -38,44 +38,65 @@ spec:
|
|||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: traefik-ondemand-service
|
||||
name: sablier
|
||||
namespace: {{ traefik_namespace }}
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: traefik-ondemand-service
|
||||
namespace: {{ traefik_namespace }}
|
||||
name: sablier
|
||||
# namespace: {{ traefik_namespace }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- apps
|
||||
- ""
|
||||
resources:
|
||||
- deployments
|
||||
- deployments/scale
|
||||
# - deployments/scale
|
||||
- statefulsets
|
||||
# - statefulsets/scale
|
||||
verbs:
|
||||
- patch
|
||||
- get
|
||||
- update
|
||||
---
|
||||
- patch # Scale up and down
|
||||
- get # Retrieve info about specific dep
|
||||
- update # Scale up and down
|
||||
- list # Events
|
||||
- watch # Events
|
||||
- apiGroups:
|
||||
- apps
|
||||
- ""
|
||||
resources:
|
||||
- deployments/scale
|
||||
- statefulsets/scale
|
||||
verbs:
|
||||
- patch # Scale up and down
|
||||
- update # Scale up and down
|
||||
- get # Retrieve info about specific dep
|
||||
- list # Events
|
||||
- watch # Events---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: traefik-ondemand-service
|
||||
name: sablier
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: traefik-ondemand-service
|
||||
name: sablier
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: traefik-ondemand-service
|
||||
name: sablier
|
||||
namespace: {{ traefik_namespace }}
|
||||
---
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: ondemand
|
||||
spec:
|
||||
plugin:
|
||||
traefik-ondemand-plugin:
|
||||
name: traefik_ondemand_plugin
|
||||
serviceUrl: 'http://traefik-ondemand-service.{{ traefik_namespace }}:10000'
|
||||
timeout: 1m
|
||||
#---
|
||||
#apiVersion: traefik.containo.us/v1alpha1
|
||||
#kind: Middleware
|
||||
#metadata:
|
||||
# name: ondemand
|
||||
#spec:
|
||||
# plugin:
|
||||
# group: default
|
||||
# dynamic:
|
||||
# displayName: My Title
|
||||
# refreshFrequency: 5s
|
||||
# showDetails: "true"
|
||||
# theme: hacker-terminal
|
||||
# sablierUrl: http://sablier.{{ traefik_namespace }}:10000
|
||||
# sessionDuration: 1m
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue