What should I do if the dependent image cannot be pulled, or the inner environment cannot access ghcr.io?
Answer: here are three solutions to solve this problem
- Solution 1: In the network that can access ghcr.io, transfer the image in the command
kubevpn versionto your own private image registry, and then add option--imageto specify the image when starting the command. Example:
kubevpn version
Look for the Image: line in the output, which will show something like ghcr.io/kubenetworks/kubevpn:v2.x.x — transfer this image to your private docker registry:
docker pull ghcr.io/kubenetworks/kubevpn:v2.x.x
docker tag ghcr.io/kubenetworks/kubevpn:v2.x.x [docker registry]/[namespace]/[repo]:[tag]
docker push [docker registry]/[namespace]/[repo]:[tag]
Then you can use this image, as follows:
kubevpn connect --image [docker registry]/[namespace]/[repo]:[tag]
Starting connect
Detected cluster CIDRs: 172.29.0.0/16, 172.21.0.0/16
...
- Solution 2: Use options
--transfer-image, enable this flag will transfer image from default image to--imagespecified address automatically. Example
kubevpn connect --transfer-image --image registry.example.org/kubevpn/kubevpn:latest
Starting connect
Detected cluster CIDRs: 172.29.0.0/16, 172.21.0.0/16 (cached)
Using traffic manager in namespace "default"
Forwarded ports (TCP/UDP/xDS)
Allocated TUN IP 198.18.0.100
Created TUN device "utun4"
Configured DNS
Now you can access resources in the kubernetes cluster !
- Solution 3: Use the
kubevpn image copycommand to copy the image to your private registry:
kubevpn image copy ghcr.io/kubenetworks/kubevpn:latest registry.example.org/kubevpn/kubevpn:latest
Then use --image to specify the private registry image:
kubevpn connect --image registry.example.org/kubevpn/kubevpn:latest
If your private registry requires authentication, you can create a Kubernetes secret and reference it:
kubevpn connect --image registry.example.org/kubevpn/kubevpn:latest --image-pull-secret-name my-registry-secret