Switch registry hostname to Contour ingress (harbor.192.168.1.7.nip.io)

demo-go-app's Deployment failed to pull: "dial tcp: lookup
harbor-core.harbor.svc.cluster.local on 127.0.0.53:53: server
misbehaving". docker push worked from the Jenkins build pod because
it has pod-network DNS (CoreDNS); pulling for a real Deployment
happens via containerd on the node itself, using the node's host-level
resolver, which has no route to *.svc.cluster.local at all. Switches
buildDocker.groovy's push target and dind-pod.yaml's
--insecure-registry flag to the Contour ingress hostname instead,
which resolves via normal public DNS (nip.io) from both pods and the
host.
This commit is contained in:
Mukul Sharma
2026-09-02 23:54:11 +05:30
parent dad5d9f9f2
commit 3ffa2d8444
2 changed files with 19 additions and 10 deletions
+9 -1
View File
@@ -20,7 +20,15 @@ import com.homelab.utilities.constructTemplate
def run(Map config) {
def tag = "${env.BUILD_NUMBER}-${env.GIT_COMMIT?.take(7) ?: 'dev'}"
env.TAG = tag
def image = "harbor-core.harbor.svc.cluster.local/${config.harbor_project}/${config.repo_name}:${tag}"
// Was harbor-core.harbor.svc.cluster.local (cluster-internal Service
// DNS) — worked for this push, since it runs inside a pod with
// pod-network DNS (CoreDNS). But the actual Deployment's image PULL
// happens via containerd running on the node itself, using the
// node's host-level DNS resolver, which has no route to
// *.svc.cluster.local at all. Using the Contour ingress hostname
// instead makes the same reference resolvable from both contexts
// (nip.io resolves via normal public DNS, reachable from the host).
def image = "harbor.192.168.1.7.nip.io/${config.harbor_project}/${config.repo_name}:${tag}"
try {
stage(stageName('Build & push image')) {
container('docker-cli') {