Set up Agent Operator with Helm charts
Helm is a package manager for Kubernetes that helps manage Kubernetes applications. Helm uses charts to configure, install, and upgrade Kubernetes Operators. This is the recommended method of installation.
Before you begin
Make sure you have everything you need before you start:
Steps
Note
The default configuration from the YAML file deploys AgentInjectors
only to the default
namespace. If other namespaces are used, these can be added to the agentInjectors.namespaces
array in the YAML file.
Create a values file based on the latest version of the YAML file found here.
Name it
contrast-agent-operator.yaml
.Add agent keys to the
clusterDefaults
section of the YAML file. You will also need to set theenabled:
property totrue
.clusterDefaults: enabled: true url: YOUR_CONTRAST_URL apiKeyValue: YOUR_API_KEY serviceKeyValue: YOUR_AGENT_SERVICE_KEY userNameValue: YOUR_AGENT_USERNAME yaml: |- enable: true
Label your deployments by using the values from the table.
Tip
Run the
kubectl get deployments
command to also find the deployment names.Example commands for labeling a deployment:
Run:
kubectl get deployments
Get an output (for example):
NAME READY UP-TO-DATE AVAILABLE AGE app1-deployment 0/3 0 0 1s
Then run the following command:
kubectl label deployment app1-deployment contrast-agent=java
Run the following Helm commands:
helm repo add contrast https://contrastsecurity.dev/helm-charts helm repo update contrast helm upgrade --install -f contrast-agent-operator.yaml contrast-agent-operator contrast/contrast-agent-operator
Note
If the YAML file is edited any time after this setup, you will need to repeat the helm upgrade command from step 5 to update the Operator configuration.