Skip to content

Instantly share code, notes, and snippets.

@XSAM
Last active December 19, 2019 13:10
Show Gist options
  • Save XSAM/f7885d13fb681c7890522796283c9d97 to your computer and use it in GitHub Desktop.
Save XSAM/f7885d13fb681c7890522796283c9d97 to your computer and use it in GitHub Desktop.
Traefik In Kubernetes Ingress Sample
apiVersion: v1
kind: ServiceAccount
metadata:
name: ingress
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: ingress
subjects:
- kind: ServiceAccount
name: ingress
namespace: default
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: test-deploy
spec:
template:
metadata:
labels:
name: test-deploy
spec:
containers:
- name: nginx
image: nginx
ports:
- name: http
containerPort: 80
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test-ingress
spec:
rules:
- host: test.io
http:
paths:
- path: /
backend:
serviceName: test-service
servicePort: 80
apiVersion: v1
kind: Service
metadata:
name: test-service
spec:
selector:
name: test-deploy
ports:
- name: web
port: 80
targetPort: 80
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: traefik-deploy
spec:
template:
metadata:
labels:
name: traefik-deploy
spec:
hostNetwork: true
serviceAccountName: ingress
containers:
- image: traefik
name: traefik
ports:
- name: http
containerPort: 80
hostPort: 80
args:
- --kubernetes
@XSAM
Copy link
Author

XSAM commented Dec 19, 2019

gopher
1Gopher!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment