Skip to content

Commit

Permalink
feat: define env vars to login to private registry
Browse files Browse the repository at this point in the history
  • Loading branch information
capuche2412 committed Jan 29, 2024
1 parent 9bbfd0c commit 834d3b5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
5 changes: 5 additions & 0 deletions docker/24-dind/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
3 changes: 2 additions & 1 deletion docker/24-dind/kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 834d3b5

Please sign in to comment.