> For the complete documentation index, see [llms.txt](https://docs.opsmx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opsmx.com/ssd/security-risk-and-prioritization/getting-started/integration-with-kubernetes-cluster/integrating-kube-detector.md).

# Integrating Kube Detector

The following steps provide instructions on how to integrate kube-detector in the cluster. Kube-detector can be integrated in two ways as listed below: &#x20;

* [In-cluster](#in-cluster)
* [Remote](#remote)

### **In-cluster:**&#x20;

In this method, you need to install the Kube Detector service in the cluster where the applications are running.&#x20;

{% hint style="info" %}
Choose this option if you do not wish to share your Kubernetes cluster’s kubeconfig file with Delivery Shield.
{% endhint %}

1. Create a new namespace in the target cluster by executing the command given below:

```
kubectl create ns <namespace>
```

2. Navigate to **Setup** > **Clusters**.
3. Click on the three vertical dots in the cluster details page as shown below:

<figure><img src="/files/h0DiqFQ5aGaenAaWT6y9" alt=""><figcaption></figcaption></figure>

4. Download the **In-cluster** file.
5. Edit the downloaded incluster file and update the new namespace value in the **ClusterRoleBinding** section as shown below:

![](https://lh7-us.googleusercontent.com/docsz/AD_4nXdp7b5zqjP03hWO95kopLNCs-pcL8708Fv5I34A1Hi7gdcTi4StY7OiyhY0pJ6GxYUDKxE3tGA7HEe0CxuSTmrwZLK_nAOM6ZXqzyIYrrc03vDitvqb_ox8aciRTTilUZNPUR14ZxmlL2VAaklPlGZC6PA?key=kukZZ60M_tCuFA03ihGwWw)

6. Add the namespace values that you want to monitor, in the kube-detector secret section of the downloaded remote file.&#x20;

<figure><img src="/files/6OOwV4uAToZsgc77QvIt" alt=""><figcaption></figcaption></figure>

7. Apply the file in the target cluster namespace by executing the command given below:

```
kubectl apply -f <Path to file> -n <namespace>
```

8. The Kubernetes cluster is successfully integrated with SSD. It starts collecting data for the services that are added in the namespaces and the applications appear in the Delivery Shield UI.

### **Remote:**&#x20;

In this method, you can install the Kube-detector service in the Delivery Shield namespace. If you select this method, your target cluster's kubeconfig file will be shared with Delivery Shield.

1. Navigate to **Setup** > **Clusters**.
2. Click on the three vertical dots in the cluster details page as shown below:

<figure><img src="/files/lA9m7iWQ6oeIAz79Usmw" alt=""><figcaption></figcaption></figure>

3. Click on the three vertical dots in the cluster details below and download the remote file.
4. Next, create a Kubernetes secret in the SSD namespace and store your target cluster's kubeconfig file in it using the following command:

{% code overflow="wrap" %}

```
kubectl create secret generic <Secret name> --from-file=<Path to Kubeconfig> -n <SSD Namespace>
```

{% endcode %}

5. Open the downloaded remote file, and update the following fields.&#x20;

* **secretName** - The name of the secret created in the previous step.
* **key** - The key in the secret that points to the kubeconfig data.&#x20;
* **path** - The value in the secret that points to the kubeconfig.

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXfhINlNpET3mIO298rkF5CYuYPOyqXL_b0UZnXI0Dce-HRRm2YeVfKQG5F20mBTC7RxnpyKyx4ltGWbeg_Kbsh7A_yfdMMXKZGHfQ3G0GUuUgXDIwQQ64j8X-DfSHY8ji1o32-VkD366LVr9Vtqd5rgreFg?key=kukZZ60M_tCuFA03ihGwWw" alt=""><figcaption></figcaption></figure>

4. Add the namespace values that you want to monitor, in the kube-detector secret section of the downloaded remote file.&#x20;

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXeaxTdtrakHO1ssFU8K8JWP4SbYe4t0q0TNxJb13DEJANBQ5yfjm9MKGUaIihpmby5uhdLvbcnzRr86DFH-1E15FM_V0JLnCeAswKhuy18cqdSudDP8W5hglxUu-Q8--EwuXU-lRZIhUmmDSBoKZa16uyI?key=kukZZ60M_tCuFA03ihGwWw" alt=""><figcaption></figcaption></figure>

5. Apply the kube-detector file in the SSD namespace by executing the command given below:

```
kubectl apply -f <Path to file> -n <namespace>
```

The Kubernetes cluster is now successfully integrated with SSD.
