Last active
January 19, 2021 11:10
-
-
Save fleeto/0666a58e83c5b201e61ab2fca779ace2 to your computer and use it in GitHub Desktop.
Traefik 2.0 for kubernetes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apiextensions.k8s.io/v1beta1 | |
kind: CustomResourceDefinition | |
metadata: | |
name: ingressroutes.traefik.containo.us | |
spec: | |
group: traefik.containo.us | |
version: v1alpha1 | |
names: | |
kind: IngressRoute | |
plural: ingressroutes | |
singular: ingressroute | |
scope: Namespaced | |
--- | |
apiVersion: apiextensions.k8s.io/v1beta1 | |
kind: CustomResourceDefinition | |
metadata: | |
name: middlewares.traefik.containo.us | |
spec: | |
group: traefik.containo.us | |
version: v1alpha1 | |
names: | |
kind: Middleware | |
plural: middlewares | |
singular: middleware | |
scope: Namespaced | |
--- | |
apiVersion: apiextensions.k8s.io/v1beta1 | |
kind: CustomResourceDefinition | |
metadata: | |
name: tlsoptions.traefik.containo.us | |
spec: | |
group: traefik.containo.us | |
version: v1alpha1 | |
names: | |
kind: TLSOption | |
plural: tlsoptions | |
singular: tlsoption | |
scope: Namespaced | |
--- | |
apiVersion: apiextensions.k8s.io/v1beta1 | |
kind: CustomResourceDefinition | |
metadata: | |
name: ingressroutetcps.traefik.containo.us | |
spec: | |
group: traefik.containo.us | |
version: v1alpha1 | |
names: | |
kind: IngressRouteTCP | |
plural: ingressroutetcps | |
singular: ingressroutetcp | |
scope: Namespaced | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
name: traefik | |
rules: | |
- apiGroups: | |
- "" | |
resources: | |
- services | |
- endpoints | |
- secrets | |
verbs: | |
- get | |
- list | |
- watch | |
- apiGroups: | |
- "extensions" | |
resources: | |
- ingresses | |
verbs: | |
- get | |
- list | |
- watch | |
- apiGroups: | |
- extensions | |
resources: | |
- ingresses/status | |
verbs: | |
- update | |
- apiGroups: | |
- "traefik.containo.us" | |
resources: | |
- middlewares | |
- ingressroutes | |
- ingressroutetcps | |
- tlsoptions | |
verbs: | |
- get | |
- list | |
- watch | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: traefik | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: traefik | |
subjects: | |
- kind: ServiceAccount | |
name: traefik | |
namespace: traefik-system | |
--- | |
apiVersion: v1 | |
data: | |
config.yaml: | | |
providers: | |
kubernetescrd: | |
endpoint: https://kubernetes.default | |
api: | |
dashboard: true | |
insecure: true | |
entryPoints: | |
web: | |
address: ":80" | |
websecure: | |
address: ":443" | |
log: | |
level: debug | |
accessLog: | |
fields: | |
defaultMode: "keep" | |
names: | |
defaultMode: "keep" | |
headers: | |
defaultMode: "keep" | |
kind: ConfigMap | |
metadata: | |
name: traefik | |
--- | |
--- | |
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: traefik-system | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
app: traefik | |
name: traefik | |
namespace: traefik-system | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: traefik | |
template: | |
metadata: | |
labels: | |
app: traefik | |
spec: | |
containers: | |
- args: | |
- --configFile=/etc/traefik/config.yaml | |
image: traefik:v2.0 | |
name: traefik | |
ports: | |
- containerPort: 8080 | |
name: admin | |
protocol: TCP | |
- containerPort: 80 | |
name: http | |
protocol: TCP | |
- containerPort: 443 | |
name: https | |
protocol: TCP | |
volumeMounts: | |
- name: config | |
mountPath: /etc/traefik | |
volumes: | |
- name: config | |
configMap: | |
name: traefik | |
serviceAccount: traefik | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: traefik-ingress | |
namespace: traefik-system | |
labels: | |
app: traefik | |
spec: | |
ports: | |
- name: https | |
protocol: TCP | |
port: 443 | |
targetPort: 443 | |
- name: http | |
protocol: TCP | |
port: 80 | |
targetPort: 80 | |
type: LoadBalancer | |
selector: | |
app: traefik | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: traefik-admin | |
namespace: traefik-system | |
labels: | |
app: traefik | |
spec: | |
ports: | |
- name: admin | |
protocol: TCP | |
port: 8080 | |
targetPort: 8080 | |
type: ClusterIP | |
selector: | |
app: traefik | |
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: traefik | |
namespace: traefik-system | |
--- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment