diff --git a/README.md b/README.md index 3a99732..0ea53a0 100644 --- a/README.md +++ b/README.md @@ -93,8 +93,13 @@ curl -k https://127.0.0.1:8443 Define the environment variable : ```bash -CLUSTER_EXTRA_NODES=" #Mind the EOL +CLUSTER_EXTRA_NODES=" - role: worker - role: worker - role: worker" ``` + +## Private Registry + +An access to a private registry is possible with the environment variables :` $CI_REGISTRY` `$CI_REGISTRY_USER` and `$CI_REGISTRY_PASSWORD`. +For GitLab, the variables are predifined. \ No newline at end of file diff --git a/docker/24-dind/entrypoint.sh b/docker/24-dind/entrypoint.sh index 3e48cbf..88ba568 100644 --- a/docker/24-dind/entrypoint.sh +++ b/docker/24-dind/entrypoint.sh @@ -19,6 +19,11 @@ if [ -n "$DOCKER_USER" ] && [ -n "$DOCKER_PASSWORD" ]; then docker login -u "${DOCKER_USER}" -p "${DOCKER_PASSWORD}" fi +if [ -n "$CI_REGISTRY" ] && [ -n "$CI_REGISTRY_USER" ] && [ -n "$CI_REGISTRY_PASSWORD" ]; then + echo "Logging to ${CI_REGISTRY} with user ${CI_REGISTRY_USER}" + docker login $CI_REGISTRY -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" +fi + if [ -z "$CLUSTER_NAME" ]; then export CLUSTER_NAME="kind" echo "Defaulting cluster name to ${CLUSTER_NAME}" diff --git a/docker/24-dind/kind.yaml b/docker/24-dind/kind.yaml index ef84e4f..6574d58 100644 --- a/docker/24-dind/kind.yaml +++ b/docker/24-dind/kind.yaml @@ -16,7 +16,8 @@ nodes: # Propagate (hopefully) images cache - containerPath: /var/lib/docker/image/overlay2 hostPath: /var/lib/docker/image/overlay2 - #Extra Nodes (if needed) ${CLUSTER_EXTRA_NODES} + #Extra Nodes (if needed) +${CLUSTER_EXTRA_NODES} kubeadmConfigPatchesJSON6902: - group: kubeadm.k8s.io version: v1beta2