New Registry Endpoint - TEST CONNECTION is "Failed to ping endpoint" against OVA Harbor
search cancel

New Registry Endpoint - TEST CONNECTION is "Failed to ping endpoint" against OVA Harbor

book

Article ID: 380677

calendar_today

Updated On:

Products

Tanzu Kubernetes Runtime

Issue/Introduction

When registering the New Registry Endpoint against OVA harbor, it failed with an error message.

# kubectl -n ${HARBOR_NAMESPACE} harbor-core-xxxxxxxx
2024-10-22T07:45:32Z [ERROR] [/pkg/reg/adapter/native/adapter.go:126]: failed to ping registry https://ova-harbor.AAA.BBB: Get "https://ova-harbor/service/token?service=harbor-registry": dial tcp: lookup ova-harbor on <kube-dns-SVC-IP-ADDRESS>:53: server misbehaving

We can confirm

  • OVA harbor is deployed as
    • FQDN(DNS): ova-harbor.AAA.BBB
    • Hostname: ova-harbor
  • DNS and core DNS can solve ova-harbor.AAA.BBB correctly
  • Ping and Curl to ova-harbor.AAA.BBB works well from node and pods

NOTE - Please note that there are no networking  issue exists between the source harbor and destination harbor. 

Environment

OVA harbor

Cause

In Harbor, registering a new registry endpoint retrieves the target's hostname information via Bearer realm. This hostname must be an FQDN that DNS can resolve.

You can check the Bearer realm information(Target harbor) from the source harbor pod.

kubect -n ${HARBOR_NAMESPACE} exec  ${HARBOAR_CORE_POD} --  bash
curl -kv https://${OVA_HARBOR_FQDN}/v2/
#> ...
#> *Connected to ova-harbor.AAA.BBB (192.168.##.##) port 443
#> < Www-Authenticate: Bearer realm="https://ova-harbor/service/token",service="harbor-registry" # !!!!
<------ realm information is just only hostname, not FQDN so "New Registry Endpoint - TEST CONNECTION" failed.

Resolution

Redeploy a new OVA harbor using the correct settings.  Hostname should be set as FQDN.

OVA harbor doesn't support changing the hostname after deployment. Follow Official Document.