Last active
September 18, 2017 21:41
-
-
Save nicolai86/abfda3b82ec2ba6b4eac788a68c5ff86 to your computer and use it in GitHub Desktop.
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
--- | |
kind: ClusterRole | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
metadata: | |
name: traefik-ingress-controller | |
rules: | |
- apiGroups: | |
- "" | |
resources: | |
- pods | |
- services | |
- endpoints | |
verbs: | |
- get | |
- list | |
- watch | |
- apiGroups: | |
- extensions | |
resources: | |
- ingresses | |
verbs: | |
- get | |
- list | |
- watch | |
--- | |
kind: ClusterRoleBinding | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
metadata: | |
name: traefik-ingress-controller | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: traefik-ingress-controller | |
subjects: | |
- kind: ServiceAccount | |
name: traefik-ingress-controller | |
namespace: kube-system |
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: v1 | |
kind: Service | |
metadata: | |
labels: | |
app: nginx | |
name: nginx | |
annotations: | |
traefik.backend.enabled: true | |
spec: | |
ports: | |
- port: 80 | |
protocol: TCP | |
targetPort: 80 | |
selector: | |
app: nginx | |
--- | |
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: nginx | |
spec: | |
replicas: 3 | |
template: | |
metadata: | |
labels: | |
app: nginx | |
spec: | |
containers: | |
- name: nginx | |
image: nginx | |
ports: | |
- containerPort: 80 | |
--- | |
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: nginx | |
annotations: | |
kubernetes.io/ingress.class: "traefik" | |
spec: | |
rules: | |
- host: example.com | |
http: | |
paths: | |
- path: / | |
backend: | |
serviceName: nginx | |
servicePort: 80 |
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
#!/bin/bash | |
kubectl apply -f config.yml | |
kubectl apply -f traefik.yml | |
kubectl apply -f service.yml | |
curl $(minikube ip) | |
curl -H "Host: example.com" $(minikube ip) |
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: 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 | |
kubernetes.io/cluster-service: "true" | |
spec: | |
template: | |
metadata: | |
labels: | |
k8s-app: traefik-ingress-lb | |
name: traefik-ingress-lb | |
spec: | |
serviceAccountName: traefik-ingress-controller | |
terminationGracePeriodSeconds: 60 | |
containers: | |
- image: traefik | |
name: traefik-ingress-lb | |
resources: | |
limits: | |
cpu: 200m | |
memory: 30Mi | |
requests: | |
cpu: 100m | |
memory: 20Mi | |
ports: | |
- containerPort: 80 | |
hostPort: 80 | |
- containerPort: 8080 | |
hostPort: 8080 | |
args: | |
- --web | |
- --kubernetes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment