TheKoguryo's Tech Blog

 Version 2023.11.20

Warning

This content has been generated by machine translation. The translations are automated and have not undergone human review or validation.

1.3.1 Connecting to a Cluster with Cloud Shell

Cloud Shell

[Cloud Shell] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/cloudshellintro.htm) is a web browser-based Linux terminal provided by Oracle Cloud Console as described in the official documentation. no see. You can understand that it runs as a small virtual machine, and it provides pre-authenticated OCI CLI for users who access the Oracle Cloud console, and provides additional cli and settings by default.

It is provided by default as kubectl, the Kubernetes CLI, for connecting to the OKE cluster.

It is free to use, and comes with authentication and basic tools, so you can use it right out of the box.

Connect to OKE cluster with Cloud Shell

  1. Go to the details page of the OKE cluster you created.

  2. Click Access Cluster.

    image-20211108113956411

  3. Choose Cloud Shell Access from the two approaches.

    • Cloud Shell: Access through Cloud Shell provided by OCI. Basic settings and related clis for the currently connected user to work with the current OCI Tenacy environment are configured.
    • Local Access: This is a method that starts with the tasks required to access the local PC for the first time.

    image-20211108114610000

  4. Step #1. Launch Cloud Shell

    Click Launch Cloud Shell or click the link in the upper right corner to access Cloud Shell.

    image-20211108114837056

  5. If you run the following command in the connected environment, you can see that oci cli is installed and connection is possible.

    oci -v
    oci os get ns
    

    image-20211108120911701

  6. Step #2. Creating a kubeconfig file

    Execute the contents of the second step of Access Your Cluster in Cloud Shell to create kubeconfig for connecting to the created OKE cluster.

    • As shown in the command, in Cloud Shell, Kubernetes API can be accessed only when a public endpoint is provided.

    image-20211108124557642

  7. Check OKE Cluster Connection

    If you run kubectl cluster-info, you can check that you are connected to the cluster through the kubeconfig created.

    image-20211108124716828



As an individual, this article was written with my personal time. There may be errors in the content of the article, and the opinions in the article are personal opinions.

Last updated on 7 Nov 2021