Configuring a secret for the container registry

You can host your container images on Docker Hub or any other registry out there. Most of the time, the following procedure will be enough to create a secret credentials and let Camel K access privately to a container registry.

How to create a registry secret

In some cases, you might already have a push/pull secret for your container registry in your current namespace. If it’s not the case, you can use the following command to create one:

kubectl create secret docker-registry your-secret-name --docker-username your-user --docker-password your-pass

Another possibility is to upload to the cluster your entire list of push/pull secrets:

# First login to your registry and provide credentials
docker login
# Then create a secret from your credentials file (may contain passwords for other registries)
kubectl create secret generic your-secret-name --from-file ~/.docker/config.json

After you’ve created the secret, you can provide it to your IntegrationPlatform resource:

apiVersion: camel.apache.org/v1
kind: IntegrationPlatform
metadata:
  name: camel-k
spec:
  build:
    registry:
      address: <my-registry-address>
      organization: <my-organization>
      secret: <my-secret-credentials>
make sure any credential contains the valid authentication servers: docker.io is used by Jib. Other publishing strategies may instead require to use a different endpoint, ie, https://index.docker.io/v1/.