Agent update
You may need to upgrade your CDC agent to the most recent version from time to time. The agent will be forced to upgrade to the newest version if the agent container is restarted.
AWS Container Update
Note
The required steps to update the container will vary according to the version of the UI you are using. The newest version of the UI is referred to as the New ECS Experience and is enabled/disabled using the slider at the top-left of the window. Where applicable, we have accounted for the different steps in the instructions below.
- From the navigation bar, choose the region that contains your agent image.
- Open the console at Management Console and select Elastic Container Service.
- Click Clusters from the left-hand side menu.
The below instructions then fork, depending on your ECS experience.
If you are using the new ECS Experience:
- On the Clusters page, select the name of the cluster in which your agent resides.
- On the cluster details page for your cluster, select the service where your agent is running.
- Click the Edit Service button in the top-right of the page.
- Within the Deployment Options section, check the Force new deployment checkbox.
- Click Update. The container will now be deployed and no further action is required.
If you are not using the new ECS Experience:
- On the Clusters page, select the name of the cluster in which your agent resides.
- On the cluster details page for your cluster, select the service where your agent is running.
- Click the Update button in the top-right of the page.
- On the Update service page, select the Force new deployment checkbox.
- Click on Next step for this page and for the remaining Configure Network and Set Auto Scaling pages.
- On the Review page, click Update Service to finish and redeploy the agent.
For more information, please refer to Amazon's Update AWS Service documentation.
Azure Container Update
Restarting an Azure container does not trigger the container to pull the latest agent image version and so does not update the agent. To update an Azure container, you must manually stop and then start the container as detailed below. When a container image is updated, the new image is retrieved, and the CDC agent is upgraded automatically. Where required, a container group can be restarted with the command: az container restart
. All containers in the container group are restarted by this action.
Stop and start the Microsoft Azure container using the console:
- Sign in to the Azure portal, and navigate to Container Instances.
- Select the container instance in which your agent resides.
- Click Stop at the top of the Container Instance page.
- Wait for the container instance to stop, then click Start.
For more information, please read Manually stop or start containers in Azure Container Instances.
Kubernetes
To upgrade the CDC agent's container image in Kubernetes, delete the pod deployment and recreate it. This pulls the updated container image.
For a more in-depth look at how deployments manage rolling updates, read the commands below:
- Get the pod name:
$ kubectl get pod --namespace matillion-cdc
NAME READY STATUS RESTARTS AGE
matillion-cdc 1/1 Running 0 58s
- Delete the pod:
$ kubectl delete pod matillion-cdc --namespace matillion-cdc
pod "matillion-cdc" deleted
- Recreate the pod (deploy the latest version):
$ kubectl create -f xyz.yaml --namspace matillion-cdc
pod/matillion-cdc created
- Check the pod is running again:
$ kubectl --namespace matillion-cdc get all
NAME READY STATUS RESTARTS AGE
pod/matillion-cdc 1/1 Running 0 58s
For more information, please refer to the Kubernetes Pod Deployment.
Google Compute Engine
To upgrade the CDC agent's container image in Google Compute Engine, follow the commands below:
- SSH into the Compute Engine Instance via gcloud CLI:
gcloud compute ssh "<compute-intance-name>" \
--project "<google-cloud-project-id>" \
--zone "<compute-instance-zone>"
See: gcloud compute ssh for more information.
- Find the agent container you would like to upgrade:
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
031e193c0e8d public.ecr.aws/matillion/cdc-agent:2 "/bin/sh -c 'java -j…" 17 hours ago Up 17 hours klt-dev-cdc-agent-lpgq
3e23101372fd gcr.io/stackdriver-agents/stackdriver-logging-agent:1.9.4 "/entrypoint.sh /usr…" 4 days ago Up 4 days stackdriver-logging-agent
Note
Make note of the CDC agent's container id. In the above example it is 031e193c0e8d
.
See: docker ps for more information.
- Stop the running agent container:
docker stop <container_id_from_step_2>
See: docker stop for more information.
- Remove the agent container:
docker rm <container_id_from_step_2>
See: docker rm for more information.
- Pull the updated image:
docker pull public.ecr.aws/matillion/cdc-agent:2
See: docker pull for more information.
- Launch a new agent container with the updated image using Compute Engine Container Startup Agent
konlet-startup
.
sudo systemctl start konlet-startup
- The service
konlet-startup
will create a new Docker container instance using the container metadata (configuration) defined.