How to manually update the airgap FQDN in TCA-CP postgres database
search cancel

How to manually update the airgap FQDN in TCA-CP postgres database

book

Article ID: 345719

calendar_today

Updated On:

Products

VMware Telco Cloud Automation

Issue/Introduction

This document contains the procedure to update the database manually with the airgapFqdn in the ApplianceConfig table on TCA-CP (where workload cluster is configured).

Symptoms:

  1. Trying to open terminal for a workload cluster  from TCA UI fails abruptly due to associated pods trying to pull images from public jfrog repo in an airgapped env.
  2. Running diagnosis tests for a mgmt/workload cluster from TCA UI fails due to associated pods trying to pull images from public jfrog repo in an airgapped env.
  3. During the CNF instantiation/upgrade below error of pulling image can be observed for the clusters which has the airgap fqdn missing in DB.
    Failed to pull image "example.packages.com/kubectl:3.2.0-ob-24441215": rpc error: code = Unknown desc = failed to pull and unpack image "example.packages.com/kubectl:3.2.0-ob-24441215": failed to resolve reference "example.packages.com/kubectl:3.2.0-ob-24441215": failed to do request: Head "https://example.packages.com/v2/kubectl/manifests/3.2.0-ob-24441215": dial tcp ##.###.##.##:443: connect: network is unreachable

Environment

2.3 or above

Cause

Airgap Server FQDN is missing for clusters in the database of TCA Control plane node. This could happen after cluster certs are renewed using manual/automated work arounds provided.

Resolution

Update Airgap FQDN for management cluster in TCA-CP DB.

  1. SSH into the TCA-CP appliance as admin.

  2. Connect to the postgres database using the below procedure:

    • Procedure For TCA 2.3
      Run the below command:
      connect-to-postgres

    • Procedure For TCA 3.x
      Run the below command:
      debug-tca-cluster

      Once new shell starts, then type

      debug-tca

      Then go to postgres

  3.  Verify that the record exists
    SELECT * from "ApplianceConfig" WHERE val->'config'->>'clusterName'='<cluster_name>';
    Check the entries for the cluster, you will find Airgap entry is missing.

  4. Run the following command on the postgress to update the airgap fqdn for the cluster(s)
    UPDATE "ApplianceConfig" SET "val" = jsonb_set("val", '{config,airgapFqdn}', '"<airgap_fqdn>"') WHERE "val"->'config'->>'clusterName'='<cluster_name>';


Example of the DB entry before and after the changes:

Before adding airgap FQDN:
{ "_id" : ObjectId("########################"), "config" : { "url" : "[https://##.###.##.###:6443|https://##.###.##.###:6443/]", "clusterName" : "<clusterName>", , "UUID" : "########-####-####-####-############", "version" : "1.22", "kubeSystemUUID" : "########-####-####-####-############", "clusterType" : "WORKLOAD" } , "section" : "kubernetes", "enterprise" : "HybridityAdmin", "organization" : "HybridityAdmin", "lastUpdated" : ISODate("20##-##-##T07:59:24.211Z"),
"lastUpdateEnterprise" : "HybridityAdmin", "lastUpdateOrganization" : "HybridityAdmin", "lastUpdateUser" : "HybridityAdmin", "creationDate" : ISODate("20##-##-##T11:13:18.802Z"), "creationEnterprise" : "HybridityAdmin", "creationOrganization" : "HybridityAdmin", "creationUser" : "HybridityAdmin", "isDeleted" : false }

 After updating the changes in DB:
{ "_id" : ObjectId("########################"), "config" : { "url" : "[https://##.###.##.###:6443|https://##.###.##.###:6443/]",       "clusterName" : "<clusterName>","kubeconfig" : "",  "UUID" : "########-####-####-####-############", "version" : "1.22", "kubeSystemUUID" : "########-####-####-####-############",   "clusterType" : "WORKLOAD", "airgapFqdn" : "[name.example.com|http://name.example.com/]"         } ,         "section" : "kubernetes",         "enterprise" : "HybridityAdmin",         "organization" : "HybridityAdmin",         "lastUpdated" : ISODate("20##-##-##T07:59:24.211Z"),         "lastUpdateEnterprise" : "HybridityAdmin",         "lastUpdateOrganization" : "HybridityAdmin",         "lastUpdateUser" : "HybridityAdmin",         "creationDate" : ISODate("20##-##-##T11:13:18.802Z"),         "creationEnterprise" : "HybridityAdmin",         "creationOrganization" : "HybridityAdmin",         "creationUser" : "HybridityAdmin",         "isDeleted" : false }