How to publish kubernetes LoadBalancer Ingress URL to aws route53

Question:

Today when I launch an app using kubernetes over aws it exposes a publicly visible LoadBalancer Ingress URL, however to link that to my domain to make the app accessible to the public, I need to manually go into the aws route53 console in a browser on every launch. Can I update the aws route53 Resource Type A to match the latest Kubernetes LoadBalancer Ingress URL from the command line ?

Kubernetes over gcloud shares this challenge of having to either predefine a Static IP which is used in launch config or manually do a browser based domain linkage post launch. On aws I was hoping I could use something similar to this from the command line

__ OR __ can I predefine an aws kubernetes LoadBalancer Ingress similar to doing a predefined Static IP when over gcloud ?

to show the deployed app’s LoadBalancer Ingress URL issue

… output

UPDATE:

Getting error trying new command line technique (hat tip to @error2007s comment) … issue this

… outputs

Important bit used below : hostedzone Z3II3949ZDMDXV

now I craft following using this Doc (and this Doc as well) as file /change-resource-record-sets.json (NOTE I can successfully change Type A using a similar cli call … however I need to change Type A with an Alias Target of LoadBalancer Ingress URL)

on command line I then issue

aws route53 change-resource-record-sets –hosted-zone-id Z3II3949ZDMDXV –change-batch file:///change-resource-record-sets.json

which give this error message

Any insights ?

Answer:

Here is the logic needed to update aws route53 Resource Record Type A with value from freshly minted kubernetes LoadBalancer Ingress URL

step 1 – identify your hostedzone Id by issuing

… from output here is clip for my domain

… importantly never populate json with hostedzone Z3II3949ZDMDXV its only used as a cli parm … there is a second similarly named token HostedZoneId which is entirely different

step 2 – see current value of your route53 domain record … issue :

… output

… in above notice value of

which is the second similarly name token Do NOT use wrong Hosted Zone ID

step 3 – put below into your change file aws_route53_type_A.json (for syntax Doc see link mentioned in comment above)

To identify value for above field “DNSName” … after the kubernetes app deploy on aws it responds with a LoadBalancer Ingress as shown in output of cli command :

… as in

… even though my goal is to execute a command line call I can do this manually by getting into the aws console browser … pull up my domain on route53 …

Notice the green circle where the correct value of my LoadBalancer Ingress URL will auto appear in a self populating picklist (thanks aws)

… In this browser picklist editable text box (circled in green) I noticed the URL gets magically prepended with : dualstack. Previously I was missing that magic string … so json key “DNSName” wants this

finally execute the change request

… output

…. now to confirm change is live run this to show record

Leave a Reply