> ## 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.

# Openshift

> Openshift provider to perform rollout restart action on specific resources.

## Authentication

This provider requires authentication.

* **api\_server**: The openshift api server url (required: True, sensitive: False)
* **token**: The openshift token (required: True, sensitive: True)
* **insecure**: Skip TLS verification (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:

* **connect\_to\_openshift**: Check if the provided token can connect to the openshift server (mandatory)

## In workflows

This provider can be used in workflows.

As "step" to query data, example:

```yaml theme={null}
steps:
    - name: Query openshift
      provider: openshift
      config: "{{ provider.my_provider_name }}"
      with:
        command_type: {value}  # The type of query to perform. Supported queries are:
- get_logs: Get logs from a pod  
- get_events: Get events for a namespace or pod
- get_pods: List pods in a namespace or across all namespaces
- get_node_pressure: Get node pressure conditions
- get_pvc: List persistent volume claims
- get_routes: List OpenShift routes
- get_deploymentconfigs: List OpenShift deployment configs
- get_projects: List OpenShift projects
        # Additional arguments for the query.
```

As "action" to make changes or update data, example:

```yaml theme={null}
actions:
    - name: Query openshift
      provider: openshift
      config: "{{ provider.my_provider_name }}"
      with:
        action: {value}  # The action to perform. Supported actions are:
- rollout_restart: Restart a deployment, statefulset, or daemonset
- restart_pod: Restart a pod by deleting it
- scale_deployment: Scale a deployment to specified replicas
- scale_deploymentconfig: Scale a deployment config to specified replicas
        # Additional arguments for the action.
```

Check the following workflow examples:

* [openshift\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/openshift_basic.yml)
* [openshift\_monitoring\_and\_remediation.yml](https://github.com/keephq/keep/blob/main/examples/workflows/openshift_monitoring_and_remediation.yml)
* [openshift\_pod\_restart.yml](https://github.com/keephq/keep/blob/main/examples/workflows/openshift_pod_restart.yml)

## Connecting with the Provider

To connect to Openshift, follow below steps:

1. Log in to your Openshift cluster and create a new service account with required roles.
2. Get the token of the service account.
3. Use the token to authenticate with Openshift.

## Notes

* This provider allows you to interact with Openshift to perform rollout restart actions.
