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:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user