0

I can find the loadbalancer URL manually:

> LOAD_BALANCER_URL=`kubectl describe service leafsheets-django-service-staging --namespace=$K8S_NAMESPACE | grep "${AWS_REGION}.elb.amazonaws.com*" | awk '{print $3}'`
> echo $LOAD_BALANCER_URL

sample output from kubectl describe command

> kubectl describe service leafsheets-django-service-staging --namespace=leafsheets-staging
Name:                     leafsheets-django-service-staging
Namespace:                leafsheets-staging
Labels:                   <none>
Annotations:              <none>
Selector:                 pod=leafsheets-staging-django
Type:                     LoadBalancer
IP:                       10.100.13.121
LoadBalancer Ingress:     aa13d515171d045319aaf59e9d08e2a5-1015643832.us-west-2.elb.amazonaws.com
Port:                     http  80/TCP
TargetPort:               8000/TCP
NodePort:                 http  32567/TCP
Endpoints:                192.168.93.189:8000
Port:                     https  443/TCP
TargetPort:               8000/TCP
NodePort:                 https  30041/TCP
Endpoints:                192.168.93.189:8000
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>

... but how to find the associated HostedZoneId?

I can hardcode it:

# https://docs.aws.amazon.com/general/latest/gr/elb.html
HOSTED_ZONE_ID=Z1H1FL5HABSF5

... but I'd prefer to deduce it.

Dudi Boy
  • 4,551
  • 1
  • 15
  • 30
P i
  • 29,020
  • 36
  • 159
  • 267
  • provide a sample output to `kubectl describe service leafsheets-django-service-staging --namespace=$K8S_NAMESPACE` and the requested output field. – Dudi Boy Nov 12 '20 at 19:45
  • @DudiBoy https://gist.github.com/p-i-/35c58ba2f81126f878d225e7988c701c – P i Nov 12 '20 at 20:22
  • @P i see this https://stackoverflow.com/a/53230627/6266192 maybe more helpful. I did not find any relevant in formation in the `kubectl describe ` command. Maybe its there and I do not see it. – Dudi Boy Nov 12 '20 at 20:53

0 Answers0