> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keephq.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Kubernetes Engine

> Google Kubernetes Engine provider allows managing Google Kubernetes Engine clusters and related resources.

## Authentication

This provider requires authentication.

* **service\_account\_json**: The service account JSON with container.viewer role (required: True, sensitive: True)
* **cluster\_name**: The name of the cluster (required: True, sensitive: False)
* **region**: The GKE cluster region (required: False, sensitive: False)

Certain scopes may be required to perform specific actions or queries via the provider. Below is a summary of relevant scopes and their use cases:

* **roles/container.viewer**: Read access to GKE resources (mandatory)
* **pods:delete**: Required to delete/restart pods  ([Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/))
* **deployments:scale**: Required to scale deployments  ([Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/))
* **pods:list**: Required to list pods  ([Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/))
* **pods:get**: Required to get pod details  ([Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/))
* **pods:logs**: Required to get pod logs  ([Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/))

## In workflows

This provider can be used in workflows.

As "step" to query data, example:

```yaml theme={null}
steps:
    - name: Query gke
      provider: gke
      config: "{{ provider.my_provider_name }}"
      with:
        command_type: {value}  # Type of query to execute
        # Additional arguments will be passed to the query method
```

Check the following workflow example:

* [gke.yml](https://github.com/keephq/keep/blob/main/examples/workflows/gke.yml)

## Provider Methods

The provider exposes the following [Provider Methods](/providers/provider-methods#via-ai-assistant). They are available in the [AI Assistant](/overview/ai-incident-assistant).

* **get\_pods** List all pods in a namespace or across all namespaces (view, scopes: pods:list, pods:get)

* **get\_pvc** List all PVCs in a namespace or across all namespaces (view, scopes: pods:list)

* **get\_node\_pressure** Get pressure metrics for all nodes (view, scopes: pods:list)

* **exec\_command** Execute a command in a pod (action, scopes: pods:exec)

* **restart\_pod** Restart a pod by deleting it (action, scopes: pods:delete)

* **get\_deployment** Get deployment information (view, scopes: pods:list)

* **scale\_deployment** Scale a deployment to specified replicas (action, scopes: deployments:scale)

* **get\_pod\_logs** Get logs from a pod (view, scopes: pods:logs)

## Connecting with the Provider

1. Obtain Google Cloud credentials by following the steps in [Google Cloud's service account guide](https://cloud.google.com/iam/docs/creating-managing-service-account-keys).
2. Ensure your service account has the necessary permissions to manage GKE clusters (`roles/container.admin`).
3. Provide the `gcp_credentials`, `project_id`, and `zone` in your provider configuration.

## Usefull Links

-[Google Kubernetes Engine Documentation](https://cloud.google.com/kubernetes-engine/docs)
