-
Notifications
You must be signed in to change notification settings - Fork 1.8k
OCPBUGS-54613: Added acessing to kubeconfig using oc CLI module #95219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
483a34d
to
3d19364
Compare
8571043
to
dce3a09
Compare
b7fa6cd
to
aae6e60
Compare
@subhtk: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
/retitle OCPBUGS-54613: Added acessing to kubeconfig using oc CLI module |
@subhtk: This pull request references Jira Issue OCPBUGS-54613, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/jira refresh |
@sairameshv: This pull request references Jira Issue OCPBUGS-54613, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, I have reviewed the changes as requested.
I would also suggest to request one more round of a review from the docs team as well.
@@ -16,3 +16,10 @@ include::modules/cli-configuring-completion.adoc[leveloffset=+2] | |||
|
|||
// Enabling tab completion for Zsh | |||
include::modules/cli-configuring-completion-zsh.adoc[leveloffset=+2] | |||
|
|||
[id="cli-configuring-kubeconfig_{context}"] | |||
== Configuring a kubeconfig file by using the oc CLI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
== Configuring a kubeconfig file by using the oc CLI | |
== Retrieving and managing `kubeconfig` data by using the openshift client i.e. `oc` |
or
== Configuring a kubeconfig file by using the oc CLI | |
Generating a kubeconfig file by logging in with the oc CLI |
Could you re-word it (similar to the suggestion) as we do not configure
the kubeconfig
file?
[id="cli-configuring-kubeconfig_{context}"] | ||
== Configuring a kubeconfig file by using the oc CLI | ||
|
||
You can use the `oc` Command-Line Interface (CLI) to log in to your OpenShift cluster and retrieve the `kubeconfig` file. The `kubeconfig` file contains the configuration information required to interact with the cluster using CLI tools such as `kubectl` or `oc`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the `oc` Command-Line Interface (CLI) to log in to your OpenShift cluster and retrieve the `kubeconfig` file. The `kubeconfig` file contains the configuration information required to interact with the cluster using CLI tools such as `kubectl` or `oc`. | |
You can use the oc command-line interface (CLI) to log in to your OpenShift cluster and generate or update a kubeconfig file. This file contains the configuration details—such as cluster, user credentials, and context—required to interact with the cluster using CLI tools like oc or kubectl. |
[id="cli-accessing-kubeconfig-using-cli_{context}"] | ||
= Accessing `kubeconfig` using the `oc` CLI | ||
|
||
You can use the `oc` CLI to log in to your OpenShift cluster and retrieve a kubeconfig file for accessing the cluster from the command line. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the `oc` CLI to log in to your OpenShift cluster and retrieve a kubeconfig file for accessing the cluster from the command line. | |
Use the `oc` command-line interface (CLI) to log in to your OpenShift cluster and generate a `kubeconfig` file. This file enables command-line access to the cluster with tools such as `oc` or `kubectl`. |
|
||
.Prerequisites | ||
|
||
* You have access to the {product-title} web console or API server endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* You have access to the {product-title} web console or API server endpoint. | |
* You have a valid user credentials to access the {product-title} web console or API server endpoint. |
$ oc login <api-server-url> -u <username> -p <password> <1> | ||
---- | ||
+ | ||
<1> Replace `<api-server-url>` with the full API server URL, such as `https://api.my-cluster.example.com:6443`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also mention/give an example of <username>
and <password>
as well?
$ export KUBECONFIG=./kubeconfig | ||
---- | ||
|
||
. You can now use `kubectl` to interact with your OpenShift cluster by running the following command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. You can now use `kubectl` to interact with your OpenShift cluster by running the following command: | |
. You can now use `kubectl` or `oc` to interact with your OpenShift cluster |
+ | ||
<1> Replace `<api-server-url>` with the full API server URL, such as `https://api.my-cluster.example.com:6443`. | ||
|
||
. Save the cluster configuration to a local file by running the following command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think by running the following command
need not be repeated on all the steps
. Save the cluster configuration to a local file by running the following command: | |
. Save the cluster configuration to a local file |
$ oc config view --raw > kubeconfig | ||
---- | ||
|
||
. Set the `KUBECONFIG` environment variable to point to the exported file by running the following command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. Set the `KUBECONFIG` environment variable to point to the exported file by running the following command: | |
. Set the `KUBECONFIG` environment variable to point to the exported file |
Version(s): 4.18+
Issue: https://issues.redhat.com/browse/OCPBUGS-54613
Link to docs preview: https://95219--ocpdocs-pr.netlify.app/openshift-enterprise/latest/cli_reference/openshift_cli/configuring-cli.html#cli-accessing-cli
QE review:
Additional information: