> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.method.security/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.method.security/_mcp/server.

# Integrate with Kubernetes

> Integrating with Kubernetes regardless of the Cluster deployment method in Method.

This guide will walk you through the process of creating Kubernetes Credentials, regardless of how your Kubernetes Cluster is deployed, to authenticate with Kubernetes Tools in the Method Platform.

---

**Summary**: The Method Platform enables authenticated scans of your Kubernetes Clusters in 2 ways. The first pertains to AWS hosted Kubernetes Clusters (EKS) and the second is via a Kubernetes Service Account. Read below for further instructions.

## Authenticating with an AWS EKS Cluster using AWS Credentials

1. Follow the workflow outlined under **credentials/aws** to create an AWS Credential in the Method Platform.

2. Now that you have an AWS Credential created, whenever running a task that involves a K8s Tool, place the **AWS EKS Creds** tool at the top of the task to enable the creation of a short lived K8s Cluster Token that will allow authenticated enumeration of the K8s Cluster.

> **AWS Credential Scope**
>
> The AWS Credential that enables the generation of the short lived K8s token
> must be scoped to view the EKS Cluster Resources in order to enable this
> workflow.

![](/_fern-files/_img/b8d5fdc84fd237e283964b04fa85647de3cd8fdd7a03b84d75b3b0882ba23db9.webp)

## Authenticating with a K8s Cluster using a Service Account

If your Cluster is deployed on-prem or you don't want to use the AWS Credential authentication functionality, Method provides straightforward steps to generate a Service Account and Service Account Token via the MethodK8s CLI.

### Download the MethodK8s CLI

1. Navigate to the Method-Security GitHub Organization and click on the [methodk8s](https://github.com/Method-Security/methodk8s) repository.

2. Follow the **Quick Start** steps in the [README.md](https://github.com/Method-Security/methodk8s?tab=readme-ov-file) to get up and running.

### Create a K8s Service Account

0. If you don't want to use the MethodK8s CLI to create a Service Account or already have one created with a Cluster-wide read-only scope, skip to the next section.

1. Ensure your `.kube/config` is set to the K8s Cluster you want to enumerate and that you have the correct permissions necessary to create a Service Account with a Cluster wide read-only scope.

2. Run the below command to print the `.yml` config files to the console. Don't worry, this only prints the configuration files and doesn't perform any actions (yet)!

`methodk8s serviceaccount configure apply`

3. Now if you want the CLI to apply the `yml` files for you run the same command with the appended flag.

`methodk8s serviceaccount configure apply --run`

> **MethodK8s Namespace Flag**
>
> Method enables you to set the namespace you want to Service Account deployed
> in via the `--namespace` flag. By default it configured in the default
> namespace.

### Create a K8s Credential in the Method Platform

1. Ensure your `.kube/config` is set to the K8s Cluster you want to enumerate.

2. Using the CLI you downloaded in the above section run the below command. This will print to the command line the values to input into the Method Platform.

`methodk8s serviceaccount configure creds`

3. Once you have those values. Navigate to the Method Platform.

4. Go to Environments, and select the desired Environment.

5. In the top right click on **Add Credential**.

6. Click the drop down menu and select **Create K8s Credential**.

![](/_fern-files/_img/f2111ea0f42023058d78815ec059c6a1ba3b4715491b2b312418b4a7b311a6c1.webp)

7. Input the values that where printed to the command line.

8. You're all set!