Kubernetes
In Kubernetes, the ThreatMapper sensors are deployed as a daemonset in the Kubernetes cluster, using a helm chart.
Quick Installation of ThreatMapper Sensors
Install and start the latest release of the deepfence sensor. Replace x.x.x.x
with the IP address of the Management Console and 73f6f3d0-9931-4b31-8967-fd6adf475f80
with the API key.
clusterName
is the name / identifier of the cluster. It should be different for different kubernetes clusters. Example: prod-cluster-1, test-cluster.- To get container runtime in the k8s cluster, run the following command
kubectl get nodes -o=custom-columns=NAME:.metadata.name,Runtime:.status.nodeInfo.containerRuntimeVersion
- To get container runtime socket path in the k8s cluster, run the following commands and search for
--container-runtime-endpoint
orcontainerd
kubectl apply -f https://deepfence-public.s3.amazonaws.com/kubernetes/deepfence-cluster-config-job.yaml
kubectl wait --for=condition=complete --timeout=30s job/deepfence-cluster-config
kubectl logs $(kubectl get pod -l job-name=deepfence-cluster-config -o jsonpath="{.items[0].metadata.name}")
kubectl delete -f https://deepfence-public.s3.amazonaws.com/kubernetes/deepfence-cluster-config-job.yaml
- Deploy deepfence-agent helm chart
helm repo add deepfence https://deepfence-helm-charts.s3.amazonaws.com/threatmapper
helm show readme deepfence/deepfence-agent --version 1.5.0
helm show values deepfence/deepfence-agent --version 1.5.0
helm install deepfence-agent deepfence/deepfence-agent \
--set managementConsoleUrl=x.x.x.x \
--set deepfenceKey=73f6f3d0-9931-4b31-8967-fd6adf475f80 \
--set image.tag=1.5.0 \
--set image.clusterAgentImageTag=1.5.0 \
--set clusterName=prod-cluster \
--set mountContainerRuntimeSocket.containerdSock=true \
--set mountContainerRuntimeSocket.dockerSock=false \
--set mountContainerRuntimeSocket.crioSock=false \
--set mountContainerRuntimeSocket.containerdSockPath="/run/containerd/containerd.sock" \
--namespace deepfence \
--create-namespace \
--version 1.5.0
Delete the ThreatMapper Sensor
helm delete deepfence-agent -n deepfence
Fine-tune the Helm deployment
helm repo add deepfence https://deepfence-helm-charts.s3.amazonaws.com/threatmapper
helm show values deepfence/deepfence-agent --version 1.5.0 > deepfence_agent_values.yaml
# You will need to update the following values:
# managementConsoleUrl and deepfenceKey - specify your URL/IP and API key value
# You may wish to update other values, including:
# image:name and image:clusterAgentImageName - change to point to custom images
# containerdSock - set to false if agent fails to start on some Kubernetes platforms e.g. Minikube
vim deepfence_agent_values.yaml
helm install -f deepfence_agent_values.yaml deepfence-agent deepfence/deepfence-agent \
--namespace deepfence \
--create-namespace \
--version 1.5.0