Skip to content

Instantly share code, notes, and snippets.

@hedinasr
Last active January 3, 2018 09:46
Show Gist options
  • Save hedinasr/6af569b662156cc5e62311e17c8bd467 to your computer and use it in GitHub Desktop.
Save hedinasr/6af569b662156cc5e62311e17c8bd467 to your computer and use it in GitHub Desktop.
DaemonSet for Traefik with NodeSelector (role=ingress-controller)
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: traefik-ingress-controller
namespace: kube-system
---
kind: DaemonSet
apiVersion: extensions/v1beta1
metadata:
name: traefik-ingress-controller
namespace: kube-system
labels:
k8s-app: traefik-ingress-lb
spec:
template:
metadata:
labels:
k8s-app: traefik-ingress-lb
name: traefik-ingress-lb
spec:
serviceAccountName: traefik-ingress-controller
terminationGracePeriodSeconds: 60
hostNetwork: true
containers:
- image: traefik
name: traefik-ingress-lb
ports:
- name: http
containerPort: 80
hostPort: 80
- name: admin
containerPort: 8080
securityContext:
privileged: true
args:
- -d
- --web
- --kubernetes
nodeSelector:
role: ingress-controller
---
kind: Service
apiVersion: v1
metadata:
name: traefik-ingress-service
namespace: kube-system
spec:
selector:
k8s-app: traefik-ingress-lb
ports:
- protocol: TCP
port: 80
name: web
- protocol: TCP
port: 8080
name: admin
type: NodePort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment