Install the Prerequisites

Because the Kubernetes artifacts required are deployed as Helm charts in Kubernetes to run the stacks, you need kubectl, as well as Helm, installed. Furthermore you will need the Oracle Cloud Infrastructure Command-line Interface (CLI), which is required for kubectl and will be helpful for other tasks.

In this step, you will install these components:
  1. The OCI Command-line Interface.
  2. If it's not already present, kubectl version 1.18 or greater.
  3. Helm 3.x.

Install the Oracle Cloud Infrastructure Command-Line Interface

First, you will install the Oracle Cloud Infrastructure Command-line Interface (CLI).

  1. To install the OCI CLI on Linux or Mac OS X, run the command:
    bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"

    Press Enter to accept the defaults for all options.

  2. Restart your shell.
    exec -l $SHELL
  3. Gather the Tenancy and User OCIDs:
    1. Get the tenancy OCID from the Oracle Cloud Console by clicking your User icon (top right corner) and then Tenancy. Copy the OCID of the tenancy (Tenancy field).
    2. Get the User OCID from the console by clicking User then User Settings. Then copy the user's OCID.
  4. Configure the OCI CLI.
    oci setup config
    You will be prompted for:
    • Location of the configuration: press Enter.
    • user_ocid: enter your user OCID.
    • tenancy_ocid: enter your tenancy OCID.
    • region: enter your region from the list provided.
    • Generate a RSA key pair: press Enter for Yes (default).
    • Directory for keys: press Enter for the default.
    • Name for the key: press Enter for the default.
    • Passphrase: press Enter for no passphrase.
    You should see an output like:
    Private key written to: /home/oracle/.oci/oci_api_key.pem
    Fingerprint: 21:d4:f1:a0:55:a5:c2:ce:...
    Config written to ~/.oci/config
  5. In order to use the CLI, you need to upload the public key generated to your user account. Get the key content by entering:
    cat ~/.oci/oci_api_key_public.pem 

    Optionally, you can open the file with your preferred editor and copy the full printed output to the clipboard.

  6. On the OCI Web Console, add the key generated in the previous step:
    1. Under click User then User Settings.
    2. Click API Keys.
    3. Click Add Public Key.
    4. Click Paste Public Key.
    5. Paste the key copied above.
    6. Click Add.
    7. Verify that the Fingerprint generated matches the fingerprint output of the configuration.
  7. Test your CLI by entering:
    oci os ns get
    This command should output the namespace of your tenancy (usually the name of the tenancy or a randomized string); for example:
    {
        "data": "your-tenancy-namespace"
    }
    

Install kubectl

Next, install the Kubernetes command-line tool, kubectl.

Note:

If you are using Docker Desktop on Mac OS X or Windows, kubectl should already be installed, and you can skip this step.

The following is a high-level procedure for installing kubectl. For more detailed instructions specific to your O/S, see "Install Tools" in the Kubernetes online documentation, listed in the "Before You Begin" topic.

  1. To install kubectl run this command:
    PLATFORM=$(uname)
    curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/${PLATFORM,,}/amd64/kubectl"
    chmod +x ./kubectl
    sudo mv ./kubectl /usr/local/bin/kubectl
    
    On Windows use:
    curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/windows/amd64/kubectl.exe
  2. Add the binary to your PATH.
  3. Verify that you are using a kubectl version that is 1.18 or later by entering:
    kubectl version --client

Install Helm

Now, you'll install the Helm CLI.

The following is a high-level procedure for installing Helm. For more detailed instructions specific to your O/S, see "Installing Helm" , listed in the "Before You Begin" topic.

To install helm on Mac OS X and Linux, enter:
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash

Install Terraform

Finally, if it's not already installed, you need to install Terraform.

Note:

You will find links to the installation documentation referenced in this topic in the "Before You Begin" topic.
If you are on a Linux-based machine or Mac OS X, we recommend you install Terraform by using tfswitch, as described in Install in tfswitch documentation, as it allows easy switching between Terraform versions. If you installed tfswitch, select a version with:
tfswitch

This playbook was tested with Terraform version 0.14.11

Otherwise, if you need guidance to setup Terraform, please visit the Terraform installation documentation and select the path corresponding to your environment.