We have a web application and pgadmin which we would like to expose via traefik. Application should be reachable from internet where pgadmin is not and has to be intranet.
So to do that I installed two ingress controller which one for internet and the other is for intranet. I added labelSelector such as traffic-type=internal
and traffic-type=external
My expectation is, able to connect my web app via host in ingress with internet and in same cluster expose pgadmin but only accesible from intranet.
- When I checked the logs there is a warnings say endpoints not avaliable which is exist. My question is where is my mistake? How can I point multiple ingress controller and ingress to each other?
2.Before ı have one ingress controller I able to access traefik dashboard via /traefik/dashboard but after ı install second ingress controller ı can not able to access anymore?
> th\":\"\",\"DisablePassHostHeaders\":false,\"EnablePassTLSCert\":false,\"Namespaces\":[\"default\",\"dev\",\"stage\"],\"LabelSelector\":\"traffic-type=external\",\"IngressClass\":\"\",\"IngressEndpoint\":null,\"ThrottleDuration\":0}","time":"2020-03-27T06:17:16Z"} > {"level":"info","msg":"ingress label selector is: > \"traffic-type=external\"","time":"2020-03-27T06:17:16Z"} > {"level":"warning","msg":"Endpoints not available for > dev/oneapihub-ui-dev","time":"2020-03-27T06:27:32Z"} W0327 > 06:29:41.237781 1 reflector.go:341] > github.com/containous/traefik/vendor/k8s.io/client-go/informers/factory.go:86: > watch of *v1.Endpoints ended with: too old resource version: 12124379 > (12124722)
capel0068340585:~ semural$ kubectl get pods -n ingress
NAME READY STATUS RESTARTS AGE
ingress-traefik-5694df5667-fzs29 1/1 Running 0 3h58m
internal-ingress-traefik-d65fdd9d9-fp9z7 1/1 Running 0 105m
capel0068340585:~ semural$ kubectl get ep oneapihub-ui-dev -n dev
NAME ENDPOINTS AGE
oneapihub-ui-dev 10.6.24.148:3000 3h56m
kubectl describe configmap
# traefik.toml
logLevel = "info"
defaultEntryPoints = ["http", "httpn"]
[entryPoints]
[entryPoints.http]
address = ":6080"
compress = true
[entryPoints.httpn]
address = ":8880"
compress = true
[entryPoints.traefik]
address = ":8080"
[ping]
entryPoint = "http"
[kubernetes]
namespaces = ["default", "dev", "stage"] -> namespace where webbapp deployed
labelselector = "traffic-type=external" -> labelselector point ingress resource
[traefikLog]
format = "json"
kubectl get ingress -o yaml
kind: Ingress
metadata:
name: RELEASE-NAME-oneapihub-ui
labels:
app.kubernetes.io/name: oneapihub-ui
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
helm.sh/chart: oneapihub-ui-0.1.0
traffic-type: external -> specify label here to point ingress controller
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: host.inter.net -> example
http:
paths:
- path: /
backend:
serviceName: RELEASE-NAME-oneapihub-ui
servicePort: 80
kubectl get tenantspec -o yaml
loadBalancers:
- ip: <IP1>
name: LBaaS2
ports:
- extPort: 80
name: "80"
nodePort: 30001
- ip: <IP2>
name: LBaaS1
ports:
- extPort: 80
name: "80"
nodePort: 30000