-> Create a kubernetes cluster in GKE.
-> Installed Traefik v2.3.3 with traefik service as LoadBalancer with loadbalancerIP: {static-ip-addres}
from GCP.
-> When I do kubectl -n traefik get svc traefik
, I see the EXTERNAL-IP as pending
.
-> Trarfik SVC
clusterIP: 10.67.139.225
externalTrafficPolicy: Cluster
loadBalancerIP: 35.190.63.47
ports:
- name: web
nodePort: 32552
port: 80
protocol: TCP
targetPort: web
- name: websecure
nodePort: 30499
port: 443
protocol: TCP
targetPort: websecure
selector:
app.kubernetes.io/instance: traefik
app.kubernetes.io/name: traefik
sessionAffinity: None
type: LoadBalancer
status:
loadBalancer: {}
Is this the right behaviour.
I have some other doubts.
Now, if I create an ingress for my deployment, it doesn't work
spec:
rules:
- host: epinio.rohitsakala.in
http:
paths:
- backend:
serviceName: epinio-server
servicePort: 80
path: /
pathType: ImplementationSpecific
status:
loadBalancer: {}
My {static-ip} points to epinio.rohitsakala.in
Traefik version - v2.3.3
GKE : 1.19.10-gke.1600
The external IP only available after the service is created, refer to docs. In other word, you do not have to specify loadBalancerIP. If you want to reserve an IP, can reserve it after service creation.
Hey @WLun001 thanks for the reply. I have a static IP address bind to a domain name and I would like to use that particular IP address.
Why does it not work with loadBalancerIP
field ? The loadbalancer should get the IP specified in this field right ? according to this doc https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/#service-v1-core
@rohitsakala yeah I understand. You can bind and reserved the static IP after it generated. Load Balancer is cloud vendor specific.
From docs
Some cloud providers allow you to specify the loadBalancerIP
. In those cases, the load-balancer is created with the user-specified loadBalancerIP
. If the loadBalancerIP
field is not specified, the loadBalancer is set up with an ephemeral IP address. If you specify a loadBalancerIP
but your cloud provider does not support the feature, the loadbalancerIP
field that you set is ignored.
Therefore, should refer to Google Cloud docs that I sent on previous reply, in this case.
Hello @WLun001 ,
I was using --global
static IP address and so it didn't work. I used regiaonal
IP address static where my kubernetes cluster is located and it worked. Seems like for services of type LoadBalancer in GKE, support only regional IP addresses.
1 Like