Skip to content

Commit 0d97207

Browse files
authored
Merge pull request #244762 from johnmarco/jm-aro-kubeconfig
ARO Admin Kubeconfig article
2 parents a25b642 + c01a2f2 commit 0d97207

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: Use Admin Kubeconfig to access an Azure Red Hat OpenShift (ARO) cluster
3+
description: Learn how to use Admin Kubeconfig to access an Azure Red Hat OpenShift (ARO) cluster.
4+
author: johnmarco
5+
ms.author: johnmarc
6+
ms.service: azure-redhat-openshift
7+
keywords: openshift, red hat, kubeconfig, cluster
8+
ms.topic: how-to
9+
ms.date: 07/12/2023
10+
ms.custom: template-how-to
11+
---
12+
13+
# Use Admin Kubeconfig to access an Azure Red Hat OpenShift (ARO) cluster
14+
15+
This article shows you how to regain access to an ARO cluster using the Admin Kubeconfig feature. The Admin Kubeconfig feature lets you download and log in with the Admin Kubconfig file using the OpenShift CLI rather than the ARO console, thus bypassing components that may not be functioning properly. This can be helpful in the following instances:
16+
17+
- The Azure Red Hat OpenShift (ARO) console isn't responding, or not allowing a login.
18+
- The OpenShift CLI isn't responding to requests.
19+
- Cluster operators may not be available or accessible.
20+
- An alternate cluster login method is required in order to fix the above issues.
21+
22+
The Admin Kubeconfig feature allows cluster access in scenarios where the kube-apiserver is available, but `openshift-ingress`, `openshift-console`, or `openshift-authentication` aren't allowing login.
23+
24+
> [!NOTE]
25+
> When using the Admin Kubeconfig feature in an environment with multiple clusters, make sure you are working in the correct context. For more information about contexts, see the [Red Hat OpenShift documentation](https://docs.openshift.com/container-platform/4.12/cli_reference/openshift_cli/managing-cli-profiles.html).
26+
>
27+
28+
## Before you begin
29+
30+
Ensure you're running Azure CLI version 2.50.0 or later.
31+
32+
To check the version of Azure CLI run:
33+
```azurecli-interactive
34+
# Azure CLI version
35+
az --version
36+
```
37+
To install or upgrade Azure CLI, see [Install Azure
38+
CLI](/cli/azure/install-azure-cli).
39+
40+
## Retrieve Admin Kubeconfig
41+
42+
Run the following to retrieve Admin Kubeconfig:
43+
44+
```
45+
export SUBSCRIPTION_ID=<your-subscription-ID>
46+
export RESOURCE_GROUP=<your-resource-group-name>
47+
export CLUSTER=<name-of-ARO-cluster>
48+
49+
az aro get-admin-kubeconfig --subscription $SUBSCRIPTION_ID --resource-group $RESOURCE_GROUP --name $CLUSTER
50+
```
51+
52+
## Source and use the Kubeconfig
53+
54+
By default, the command used previously to retrieve Admin Kubeconfig saves it to the local directory under the name *kubeconfig*. To use it, set the environment variable `KUBECONFIG` to the path of that file:
55+
56+
```
57+
export KUBECONFIG=/path/to/kubeconfig
58+
oc get nodes
59+
[output will show up here]
60+
```
61+
62+
Now there's no need to use the OpenShift CLI (`oc`) login because the admin user is already logged in and the kubeconfig file is present.

articles/openshift/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
href: howto-segregate-machinesets.md
3939
- name: Manually update cluster certificates
4040
href: howto-update-certificates.md
41+
- name: Use Admin Kubeconfig
42+
href: howto-kubeconfig.md
4143
- name: Networking
4244
items:
4345
- name: Create a private Azure Red Hat OpenShift cluster

0 commit comments

Comments
 (0)