Change DNS Server IP Address in TCA deployed TKG Cluster Nodes
search cancel

Change DNS Server IP Address in TCA deployed TKG Cluster Nodes

book

Article ID: 379667

calendar_today

Updated On:

Products

VMware Telco Cloud Automation

Issue/Introduction

The cluster is deployed with static DNS IP address entered in the TCA cluster deployment workflow.

Environment

vCenter SW Version: 7.x
TCA SW Version: 2.x
TKG SW Version: 1.x

Resolution

Change of static DNS Server IP address , initially set at the time of deployment , through TCA is not supported.

Workaround:

The DNS IP address can be forcefully changed by following below steps.

IMPACT:All nodes will be redeployed, which may lead to potential application downtime depending on the deployment strategy and how high availability is configured for the CNF application.

 

  1. List existing vspheremachinetemplate of the cluster.
    kubectl get vspheremachinetemplate -A | grep <cluster-name>

    NAMESPACE NAME AGE
    xxx-cluster-ccs-1 xxx-cluster-ccs-1 343d
    xxx-cluster-ccs-1 xxx-cluster-ccs-1-np1 343d
    xxx-cluster-ccs-1 xxx-cluster-ccs-1-np2 343d

  2. Take backup of the all the vspheremachinetemplates of this cluster.
    kubectl get vspheremachinetemplate xxx-cluster-ccs-1 -n xxx-cluster-ccs-1 -o yaml > xxx-cluster-ccs-1-new.yaml
    kubectl get vspheremachinetemplate xxx-cluster-ccs-1-np1 -n xxx-cluster-ccs-1 -o yaml > xxx-cluster-ccs-1-np1-new.yaml
    kubectl get vspheremachinetemplate xxx-cluster-ccs-1-np2 -n xxx-cluster-ccs-1 -o yaml > xxx-cluster-ccs-1-np2-new.yaml

  3. Edit the new vspheremachinetemplates yaml files and replace nameserver values under network section with correct values. Also change the name field to match with file name.
    network:
    devices:
    - dhcp4: true
    nameservers:
    - x.x.x.x
    - x.x.x.x

  4. Note:Change name field to match with filename (adding "new" to name)
  5. Create the new vspheremachinetemplates from those files. Use either create or apply. Both should work.
    kubectl apply -f xxx-cluster-ccs-1-new.yaml
    kubectl apply -f xxx-cluster-ccs-1-np1-new.yaml
    kubectl apply -f xxx-cluster-ccs-1-np2-new.yaml

  6. There will now be three more vspheremachinetemplates with name new in it.
  7. Now edit kcp object to point newly created vspheremachinetemplate in it. After this change new control plane nodes will be rolled out.
    kubectl get kcp -n mdc01-cluster-ccs-1
    NAME CLUSTER INITIALIZED API SERVER AVAILABLE REPLICAS READY UPDATED UNAVAILABLE AGE VERSION
    xxx-cluster-ccs-1-control-plane xxx-cluster-ccs-1 true true 3 3 3 0 343d v1.23.10+vmware.1

    kubectl edit kcp xxx-cluster-ccs-1-control-plane -n xxx-cluster-ccs-1
    :
    :
    machineTemplate:
    infrastructureRef:
    apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    kind: VSphereMachineTemplate
    name: xxx-cluster-ccs-1-new ---> change the name here matching with new template name
    namespace: xxx-cluster-ccs-1

  8. Now edit MD object to point newly created vspheremachinetemplate in it. After this change new worker nodes will be rolled out.
    kubectl get md -n xxx-cluster-ccs-1
    NAME CLUSTER REPLICAS READY UPDATED UNAVAILABLE PHASE AGE VERSION
    xxx-cluster-ccs-1-np1 xxx-cluster-ccs-1 29 29 29 0 Running 343d v1.23.10+vmware.1
    xxx-cluster-ccs-1-np2 xxx-cluster-ccs-1 140 140 140 0 Running 343d v1.23.10+vmware.1

    kubectl edit md xxx-cluster-ccs-1-np1 -n xxx-cluster-ccs-1
    :
    :
    infrastructureRef:
    apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    kind: VSphereMachineTemplate
    name: xxx-cluster-ccs-1-np1-new --> new template name


    kubectl edit md xxx-cluster-ccs-1-np2 -n xxx-cluster-ccs-1
    :
    :
    infrastructureRef:
    apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    kind: VSphereMachineTemplate
    name: xxx-cluster-ccs-1-np2-new --> new template name

  9. For a long-term solution, it might be worth considering a design change where DNS can be injected via DHCP, allowing flexibility to change and for easier change management.