vcluster icon indicating copy to clipboard operation
vcluster copied to clipboard

there is no way to modify coredns image loation at enviromnet there is no internet connection.

Open opensource438 opened this issue 3 years ago • 2 comments

I tried to deploy vcluster at an cluster where there is no internent connection.

I did :

  1. 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

  2. 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

  3. 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 avatar Dec 10 '21 15:12 opensource438

@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

FabianKramm avatar Dec 13 '21 08:12 FabianKramm

Thank you so much.

opensource438 avatar Dec 29 '21 05:12 opensource438

Also, since v0.7.0 it is possible to set the CoreDNS image with the .coredns.image helm value.

matskiv avatar Oct 14 '22 13:10 matskiv