Java and C# CD agents

Integrating Sealights using CD agents and init-containers

CD agents

CD agents are used because they are simpler to use and because they can be implemented outside the dockerfile. However, since they only run when running the code it means that they scan right before running the code which delays the deployment time.

Init-container

We use something called init-container which is a container that runs right before the main container. We use it to download the latest agent and put it in a file that is later used.

You can find the init-containers' files in the initContainers folder.

The implementation of the CD agent is done in the helm-chart/templates/[service-name].yaml file

  1. You insert the init-container in the yaml:

Init-container in file
  1. You add the shared volume where the agent is saved.

Shared volumes mount
  1. Now adding the actual agent to the container

In java simple java agent

The agent (There is a continuation to the right)

In dotnet a little trickier, here we have to add environment variables and then overwrite the cmd command.

Adding the environment variables
Overwriting the cmd command

The parameters are in the helm-chart/values.yaml file, this file contains default values that can be changed when running helm.

Last updated