vcluster
vcluster copied to clipboard
there is no way to modify coredns image loation at enviromnet there is no internet connection.
I tried to deploy vcluster at an cluster where there is no internent connection.
I did :
-
downloaded the yaml file : vcluster-1.yaml downloaded the following 3 docker images , and pushed to my local docker registry. k3s_v1.22.4-k3s1-amd64.tar.gz vcluster_latest.tar.gz mirrored-coredns-coredns_1.8.4.tar.gz
-
in vcluster-1.yaml, modified the image path to the following :
image: my.local.registry/k3s:v1.22.4-k3s1-amd64 image: my.local.registry/vcluster:latest
-
kubectl apply -f vcluster-1.yaml kubectl get pod
NAME READY STATUS RESTARTS AGE coredns-85cb69466-gs2jr-x-kube-system-x-vcluster-1 0/1 ImagePullBackOff 0 12h vcluster-1-0 2/2 Running 0 12h
kubectl describe coredns-85cb69466-gs2jr-x-kube-system-x-vcluster-1
Warning Failed 36m (x97 over 12h) kubelet Failed to pull image "rancher/mirrored-coredns-coredns:1.8.4": rpc error: code = Unknown desc = Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) Normal Pulling 31m (x135 over 12h) kubelet Pulling image "rancher/mirrored-coredns-coredns:1.8.4" Warning Failed 11m (x3036 over 12h) kubelet Error: ImagePullBackOff Normal BackOff 2m1s (x3077 over 12h) kubelet Back-off pulling image "rancher/mirrored-coredns-coredns:1.8.4"
=================================== Question : how this coredns pod is deployed/created ? where can I modify the image path : rancher/mirrored-coredns-coredns:1.8.4 to my local repository ?
it seems that this coredns pod is created automatically, and I don't find anywhere I can modify the image path to my local repsitory.
Thank you so much.
@opensource438 thanks for creating this issue! In the newer v0.5.0 alpha version, we have a chart option called defaultImageRegistry, that will prepend the imageregistry (my.local.registry/) in your case to all images deployed in the vcluster control plan and coredns.
Besides that there is a syncer flag, which allows you to override synced images like this:
syncer:
extraArgs:
- --translate-image=rancher/mirrored-coredns-coredns:1.8.4=my.local.registry/rancher/mirrored-coredns-coredns:1.8.4
Thank you so much.
Also, since v0.7.0 it is possible to set the CoreDNS image with the .coredns.image helm value.