Created
January 25, 2019 11:24
-
-
Save zedtux/1de0dae2f7b8de764d04ee26eb86064e to your computer and use it in GitHub Desktop.
Kubernetes command to generate the docker-registry secret for Gitlab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Creating the gitlab-registry secret ..." | |
# Save the JSON to create the gitlab-registry docker-registry secret | |
GITLAB_REGISTRY_SECRET_JSON=$( | |
kubectl create secret --namespace=$KUBE_NAMESPACE \ | |
docker-registry gitlab-registry \ | |
--docker-server="$CI_REGISTRY" \ | |
--docker-username="${CI_DEPLOY_USER:-$CI_REGISTRY_USER}" \ | |
--docker-password="${CI_DEPLOY_PASSWORD:-$CI_REGISTRY_PASSWORD}" \ | |
--docker-email="$GITLAB_USER_EMAIL" \ | |
--output json \ | |
--dry-run | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment