Tagging and Pushing Images

Step 1: Set Environment Variables

First, export the VERSION and CUSTOM-DOCKER-REGISTRY environment variables in your shell:

export VERSION=<YOUR-DESIRED-VERSION>
export CUSTOM_DOCKER_REGISTRY=<YOUR-CUSTOM-DOCKER-REGISTRY>

Replace <YOUR-DESIRED-VERSION> with the version of the Odigos images you want to use, and <YOUR-CUSTOM-DOCKER-REGISTRY> with the URL of your custom Docker registry.

Step 2: Pull the Images

Start by pulling the required images from the official Docker Hub onto your local machine or CI environment:

docker pull keyval/odigos-scheduler:$VERSION
docker pull keyval/odigos-instrumentor:$VERSION
docker pull keyval/odigos-ui:$VERSION
docker pull keyval/odigos-autoscaler:$VERSION
docker pull keyval/odigos-odiglet:$VERSION
docker pull keyval/odigos-collector:$VERSION

Step 3: Tag the Images

Next, Tag each image with your custom Docker registry prefix:

docker tag keyval/odigos-scheduler:$VERSION $CUSTOM_DOCKER_REGISTRY/keyval/odigos-scheduler:$VERSION
docker tag keyval/odigos-instrumentor:$VERSION $CUSTOM_DOCKER_REGISTRY/keyval/odigos-instrumentor:$VERSION
docker tag keyval/odigos-ui:$VERSION $CUSTOM_DOCKER_REGISTRY/keyval/odigos-ui:$VERSION
docker tag keyval/odigos-autoscaler:$VERSION $CUSTOM_DOCKER_REGISTRY/keyval/odigos-autoscaler:$VERSION
docker tag keyval/odigos-odiglet:$VERSION $CUSTOM_DOCKER_REGISTRY/keyval/odigos-odiglet:$VERSION
docker tag keyval/odigos-collector:$VERSION $CUSTOM_DOCKER_REGISTRY/keyval/odigos-collector:$VERSION

Step 4: Push the Images

Now, push the tagged images to your custom Docker registry:

docker push $CUSTOM_DOCKER_REGISTRY/keyval/odigos-scheduler:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/keyval/odigos-instrumentor:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/keyval/odigos-ui:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/keyval/odigos-autoscaler:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/keyval/odigos-odiglet:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/keyval/odigos-collector:$VERSION

Step 5: Configure Access for Private Registries

If your Docker registry is private, configure your Kubernetes cluster to pull images from it. Refer to the official Kubernetes documentation for guidance: Pull an Image from a Private Registry.

Note: To ensure your Odigos deployments and daemonsets can pull images from a private registry, patch them to add the image pull secret.

Use the following commands:

export ODIGOS_NAMESPACE=<NAMESPACE-WHERE-ODIGOS-IS-INSTALLED>
export IMAGE_PULL_SECRET=<NAME-OF-IMAGE-PULL-SECRET>
kubectl patch deployment odigos-ui -n $ODIGOS_NAMESPACE \
--type='json' -p='[{"op": "add", "path": "/spec/template/spec/imagePullSecrets", "value": [{"name": '$IMAGE_PULL_SECRET'}]}]'
kubectl patch deployment odigos-scheduler -n $ODIGOS_NAMESPACE \
--type='json' -p='[{"op": "add", "path": "/spec/template/spec/imagePullSecrets", "value": [{"name": '$IMAGE_PULL_SECRET'}]}]'
kubectl patch deployment odigos-instrumentor -n $ODIGOS_NAMESPACE \
--type='json' -p='[{"op": "add", "path": "/spec/template/spec/imagePullSecrets", "value": [{"name": '$IMAGE_PULL_SECRET'}]}]'
kubectl patch deployment odigos-autoscaler -n $ODIGOS_NAMESPACE \
--type='json' -p='[{"op": "add", "path": "/spec/template/spec/imagePullSecrets", "value": [{"name": '$IMAGE_PULL_SECRET'}]}]'
kubectl patch deployment odigos-gateway -n $ODIGOS_NAMESPACE \
--type='json' -p='[{"op": "add", "path": "/spec/template/spec/imagePullSecrets", "value": [{"name": '$IMAGE_PULL_SECRET'}]}]'
kubectl patch daemonset odiglet -n $ODIGOS_NAMESPACE \
--type='json' -p='[{"op": "add", "path": "/spec/template/spec/imagePullSecrets", "value": [{"name": '$IMAGE_PULL_SECRET'}]}]'
kubectl patch daemonset odigos-data-collection -n $ODIGOS_NAMESPACE \
--type='json' -p='[{"op": "add", "path": "/spec/template/spec/imagePullSecrets", "value": [{"name": '$IMAGE_PULL_SECRET'}]}]'

Step 6: Install Odigos Using Custom Images

Finally, install Odigos using the images from your custom Docker registry:

odigos install --image-prefix=$CUSTOM_DOCKER_REGISTRY