Question

How do I update a DNS record automatically when deploying a loadbalancer from kubernetes?

I am deploying a loadbalancer with kubernetes. Once the loadbalancer is built I need to manually point the external IP address to the loadbalancers IP address. Is there any way I can automate this?

Here is my yaml file…

apiVersion: v1
kind: Service
metadata:
  name: joomla-service
  annotations:
    service.beta.kubernetes.io/do-loadbalancer-protocol: "http"
    service.beta.kubernetes.io/do-loadbalancer-algorithm: "round_robin"
    service.beta.kubernetes.io/do-loadbalancer-tls-ports: "443"
    service.beta.kubernetes.io/do-loadbalancer-certificate-id: "XXXXX-Lets-Encrypt"
    service.beta.kubernetes.io/do-loadbalancer-redirect-http-to-https: "true"
  labels:
    run: joomla
spec:
  type: LoadBalancer
  ports:
  - name: http
    port: 80
    targetPort: 80
    protocol: TCP
  - name: https
    port: 443
    targetPort: 80
    protocol: TCP
  selector:
    app: joomla

Thanks,

Chris Edwards


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

You need to set up the LoadBalancer IP address manually as an A record for the domain.

Best Regards, Purnima Kumari

I noticed a typo but cannot edit it…

Once the loadbalancer is built I need to manually point the external IP address to the proper DNS address.