Add ondemand plugin
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
e76a31ffeb
commit
ba1319aeef
4 changed files with 108 additions and 1 deletions
81
templates/traefik-ondemand-plugin.yml.j2
Normal file
81
templates/traefik-ondemand-plugin.yml.j2
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: traefik-ondemand-service
|
||||
labels:
|
||||
app: traefik-ondemand-service
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: traefik-ondemand-service
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: traefik-ondemand-service
|
||||
spec:
|
||||
serviceAccountName: traefik-ondemand-service
|
||||
serviceAccount: traefik-ondemand-service
|
||||
containers:
|
||||
- name: traefik-ondemand-service
|
||||
image: ghcr.io/acouvreur/traefik-ondemand-service:1
|
||||
args: ["--swarmMode=false", "--kubernetesMode=true"]
|
||||
ports:
|
||||
- containerPort: 10000
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: traefik-ondemand-service
|
||||
spec:
|
||||
selector:
|
||||
app: traefik-ondemand-service
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 10000
|
||||
targetPort: 10000
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: traefik-ondemand-service
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: traefik-ondemand-service
|
||||
namespace: {{ traefik_namespace }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- apps
|
||||
resources:
|
||||
- deployments
|
||||
- deployments/scale
|
||||
verbs:
|
||||
- patch
|
||||
- get
|
||||
- update
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: traefik-ondemand-service
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: traefik-ondemand-service
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: traefik-ondemand-service
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue