---
title: Context for the shared cluster
description: Kubernetes uses contexts to access Kubernetes clusters. Before you can access the shared cluster, you must create a context on your local computer if it's not already present.
component: forgeops
version: 7.4
page_id: forgeops::cdk/cloud/setup/aks/context
canonical_url: https://docs.pingidentity.com/forgeops/7.4/cdk/cloud/setup/aks/context.html
keywords: ["Kubernetes Context"]
section_ids:
  next_step: Next step
---

# Context for the shared cluster

Kubernetes uses contexts to access Kubernetes clusters. Before you can access the shared cluster, you must create a context on your local computer if it's not already present.

To create a context for the shared cluster:

1. Run the kubectx command and review the output. The current Kubernetes context is highlighted:

   * If the current context references the shared cluster, there is nothing further to do. Proceed to [Namespace](namespace.html).

   * If the context of the shared cluster is present in the kubectx command output, set the context as follows:

     ```
     $ kubectx my-context
     Switched to context "my-context".
     ```

     After you have set the context, proceed to [Namespace](namespace.html).

   * If the context of the shared cluster is not present in the kubectx command output, continue to the next step.

2. Configure the Azure CLI to use your Microsoft Azure account. Run the following command:

   ```
   $ az login
   ```

3. A browser window prompts you to log in to Azure. Log in using your Microsoft account.

   A second screen should appear with the message, "You have logged into Microsoft Azure!"

4. Return to the terminal window and run the following command. Use the resource group, cluster name, and subscription ID you [obtained from your cluster administrator](clusterinfo.html):

   ```
   $ az aks get-credentials \
    --resource-group my-fr-resource-group \
    --name my-fr-cluster \
    --subscription my-hex-azure-subscription-ID \
    --overwrite-existing
   ```

5. Run the kubectx command again and verify that the context for your Kubernetes cluster is now the current context.

## Next step

* [icon: check-square-o, set=fa][Get the forgeops repository](forgeops.html)

* [icon: check-square-o, set=fa][Install third-party software](sw.html)

* [icon: check-square-o, set=fa][Get details about the shared AKS cluster](clusterinfo.html)

* [icon: check-square-o, set=fa][Create a Kubernetes context](#)

* [icon: square-o, set=fa]*[Create a Kubernetes namespace](namespace.html)*

* [icon: square-o, set=fa][Set up hostname resolution](hostname.html)
