Question

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

Posted February 4, 2021 276 views
Load BalancingKubernetes

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

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.

×
Submit an Answer
2 answers

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.

Hi there,

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

Best Regards,
Purnima Kumari