I have an on premise Kubernetes cluster. I have traefik running in the cluster as per the example given by traefik. It is tied to a node, which will be my loadbalancer. I can access the service running(with ingress) by hitting the node port with the route. For example http://build.mydomain.com:NODEPORT will route me to my Jenkins.
But I want to be able to hit my Jenkins by simply entering http://build.mydomain.com
Is this possible or do I have to run traefik outside of the cluster?
Basically I just want everything hitting 80 on the load balancer to hit the traefik ingress controller, which should rout the request based on the ingresses.
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: traefik-ingress-controller
namespace: kube-system
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: traefik-ingress-controller
namespace: kube-system
labels:
k8s-app: traefik-ingress-lb
spec:
replicas: 1
selector:
matchLabels:
k8s-app: traefik-ingress-lb
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
ports:
- name: http
containerPort: 80
- name: admin
containerPort: 8080
args:
- --api
- --kubernetes
- --logLevel=INFO
nodeSelector:
node-role.kubernetes.io/worker: loadbalancer
---
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