Skip to content

Instantly share code, notes, and snippets.

@zedtux
Created January 25, 2019 11:24
Show Gist options
  • Save zedtux/1de0dae2f7b8de764d04ee26eb86064e to your computer and use it in GitHub Desktop.
Save zedtux/1de0dae2f7b8de764d04ee26eb86064e to your computer and use it in GitHub Desktop.
Kubernetes command to generate the docker-registry secret for Gitlab
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