https://rancher.com/ logo
#k3d
Title
# k3d
a

aloof-air-15327

04/17/2023, 1:13 PM
Hi! I am new to k3d. I tried to create a cluster, but in my environment i can not reach ghcr.io and docker.io, only over a nexus which proxy to this repos. I tried to set my nexus repo in registries.yaml, but nothing changed when i create a cluster with --registry-config. Its always try to connect to ghcr.io and docker.io. Can somebody help me on this? Thanks!
h

happy-rocket-24670

04/17/2023, 1:27 PM
So are you behind some kind of corporate proxy? Are there some logs you can provide?
Generally if you're behind a proxy you should use
k3d cluster create --config cluster-config.yaml
Copy code
# cluster-config.yaml
apiVersion: <http://k3d.io/v1alpha4|k3d.io/v1alpha4>
kind: Simple
metadata:
  name: my-cluster
env:
  - envVar: all_proxy=${all_proxy}
    nodeFilters:
      - server:*
  - envVar: ALL_PROXY=${ALL_PROXY}
    nodeFilters:
      - server:*
  - envVar: http_proxy=${http_proxy}
    nodeFilters:
      - server:*
  - envVar: HTTP_PROXY=${HTTP_PROXY}
    nodeFilters:
      - server:*
  - envVar: https_proxy=${https_proxy}
    nodeFilters:
      - server:*
  - envVar: HTTPS_PROXY=${HTTPS_PROXY}
    nodeFilters:
      - server:*
  - envVar: no_proxy=${no_proxy}
    nodeFilters:
      - server:*
  - envVar: NO_PROXY=${NO_PROXY}
    nodeFilters:
      - server:*
or if you don't want to create a config file
k3d cluster create -e "HTTPS_PROXY=${HTTPS_PROXY}@server:*" -e "HTTP_PROXY=${HTTPS_PROX}@server:*" ...
a

aloof-air-15327

04/17/2023, 1:51 PM
Thanks for the reply. I need to use the nexus repository for this, so not the proxy. So i want to see in the logs this: Trying to pull repository myownnexus/k3d-io/k3d-tools:5.4.9 instead of this: try to pull repository ghcr.io/k3d-io/k3dtools:5.4.9
h

happy-rocket-24670

04/18/2023, 9:04 AM
for this the config should look a bit like this:
Copy code
# cluster-config.yaml
apiVersion: <http://k3d.io/v1alpha4|k3d.io/v1alpha4>
kind: Simple
metadata:
  name: my-cluster
registries:
  config: |
    mirrors:
      <http://ghcr.io|ghcr.io>:
        endpoint:
          - <https://myownnexus>
note that I'm assuming
myownnexus
is a domain without a path If you do need to change the path you will need to use "rewrites" which are not supported in
k3d
right now (pending PR)
96 Views