Set an external Docker registry
By default, you install Kyma with Serverless that uses the internal Docker registry running on a cluster. This tutorial shows how to override this default setup with an external Docker registry from one of these cloud providers:
CAUTION: Function images are not cached in the Docker Hub. The reason is that this registry is not compatible with the caching logic defined in Kaniko that Serverless uses for building images.
Prerequisites
- Docker Hub
- GCR
- ACR
Steps
Create required cloud resources
- Docker Hub
- GCR
- ACR
Run the
export {VARIABLE}={value}
command to set up these environment variables, where:- USERNAME is the name of the account in the Docker Hub.
- PASSWORD is the password for the account in the Docker Hub.
- SERVER_ADDRESS is the server address of the Docker Hub. At the moment, Kyma only supports the
https://index.docker.io/v1/
server address. - REGISTRY_ADDRESS is the registry address in the Docker Hub.
TIP: Usually, the Docker registry address is the same as the account name.
Example:
Click to copyexport USERNAME=kyma-rocksexport PASSWORD=admin123export SERVER_ADDRESS=https://index.docker.io/v1/export REGISTRY_ADDRESS=kyma-rocks
Override Serverless configuration
Prepare yaml file with overrides that match your Docker registry provider:
- Docker Hub
- GCR
- ACR
cat > docker-registry-overrides.yaml <<EOFserverless: dockerRegistry: enableInternal: false username: "${USERNAME}" password: "${PASSWORD}" serverAddress: "${SERVER_ADDRESS}" registryAddress: "${REGISTRY_ADDRESS}"EOF
CAUTION: If you want to set an external Docker registry before you install Kyma, manually apply the Secret to the cluster before you run the installation script.
Apply configuration
Deploy Kyma with different configuration for Docker registry . Run:
kyma deploy --values-file docker-registry-overrides.yaml
NOTE: To learn more, read about changing kyma configuration.