# Kubernetes Cluster

Self-managed Kubernetes cluster target.

## YAML Parameters

```typescript
interface YAMLParameters {
  /** The ID of the cluster or fully qualified identifier for the cluster */
  cluster: string;
  /** The human-readable ID of the target */
  target: string;
  /** Kubernetes cluster authentication configuration */
  auth?: K8sAuthYaml;
  /** Access permissions for the target */
  permissions?: PermissionsYaml;
  /** The name of the target */
  name?: string;
  /** The integration. Required when adding GKE/EKS/AKS/DOKS */
  integration?: string;
  /** Cloud region, e.g. eu-central-1 */
  region?: string;
  /** The ID of the application/project */
  application_id?: string;
  /** The ID of the Google Cloud project */
  project?: string;
  /** Type of AKS subscription */
  subscription?: string;
  /** Azure resource group containing the AKS cluster */
  resource_group?: string;
  /** GKE zone. E.g., europe-west3-a */
  zone?: string;
  /** Proxy configuration to route K8s API traffic through (for private clusters) */
  proxy?: string;
  /** Indicates if this target is disabled (default: false) */
  disabled?: boolean;
  /** The list of tags associated with the target */
  tags?: string[];
  /** Defines how the target can be used (as deployment target, proxy, or both) */
  use_as?: UseAsYaml;
  /** Note for this resource */
  note?: string;
  /** YAML note for AI agents operating on this resource */
  agent_note?: string;
  type?: "K8S_CLUSTER";
}
```

## Type Definitions

```typescript
interface K8sAuthYaml {
  /** Authentication method */
  method?: "PASS" | "CERT" | "TOKEN";
  /** Username to the Kubernetes cluster. Required if auth.method is BASIC */
  username?: string;
  /** Password to the Kubernetes cluster. Required if auth.method is BASIC */
  password?: string;
  /** Kubernetes certificate authority. Required if auth.method is CERT */
  certificate_authority?: string;
  /** Kubernetes client certificate. Required if auth.method is CERT */
  client_certificate?: string;
  /** Kubernetes client key. Required if auth.method is CERT */
  client_key?: string;
  /** Token for the Kubernetes cluster. Required if auth.method is TOKEN */
  token?: string;
}

interface PermissionsYaml {
  /** Access level for other workspace members */
  others?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
  /** List of specific users with their access levels */
  users?: object;
  /** List of user groups with their access levels */
  groups?: object;
  /** List of pipelines allowed to access this resource */
  pipelines?: AllowedPipelineYaml[];
  /** List of sandboxes allowed to access this resource */
  sandboxes?: AllowedSandboxYaml[];
}

interface AllowedPipelineYaml {
  /** When true, allow all pipelines to access this resource */
  all?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
  /** Project name containing the allowed pipeline */
  project?: string;
  /** Pipeline identifier that is allowed to access this resource */
  pipeline?: string;
  /** Access level granted to the pipeline */
  access?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
}

interface AllowedSandboxYaml {
  /** When true, allow all sandboxes to access this resource */
  all?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
  /** Project name containing the allowed sandbox */
  project?: string;
  /** Sandbox identifier that is allowed to access this resource */
  sandbox?: string;
  /** Access level granted to the sandbox */
  access?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
}

interface UseAsYaml {
  /** Whether the target can be used as a deployment target (default: on) */
  target?: boolean | "on" | "off";
  /** Whether the target can be used as a proxy (default: on) */
  proxy?: boolean | "on" | "off";
}

```

## YAML Examples

### Kubernetes cluster with password authentication

```yaml
- target: myTarget
  type: K8S_CLUSTER
  cluster: https://my-cluster-url:6443
  auth:
    method: PASS
    username: my_user
    password: my_password

```

### Password Auth

```yaml
- target: myTarget
  type: K8S_CLUSTER
  cluster: https://my-cluster-url:6443
  auth:
    method: PASS
    username: my_user
    password: my_password

```

### Cert Auth

```yaml
- target: myTarget2
  type: K8S_CLUSTER
  cluster: https://my-cluster-url:6443
  auth:
    method: CERT
    certificate_authority: ccc
    client_certificate: vvv
    client_key: xxx

```

### Token Auth

```yaml
- target: myTarget3
  type: K8S_CLUSTER
  cluster: https://my-cluster-url:6443
  auth:
    method: TOKEN
    token: my_token

```


---
Original source: https://buddy.works/docs/yaml/yaml-targets/k8s-cluster