oci-series

A git repo with Oracle Cloud Infrastructure recipes, tips and tricks.

This project is maintained by luisw19

Quick install of Oracle Kubernetes Engine

Following a summary of the steps to provision an OKE cluster based on the quick create option.

The steps assume that there is an OCI account available. If this is not the case, click here for options on creating one.

1) Install and configure the OCI CLI.

For Unix/Linux based OS this can be done quickly by running:

bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"

Follow the steps as prompted. Then to configure it:

oci setup config

Note that during the configuration you’ll have to use the OCI web console to obtain your user and tenancy OCID and also add the generated public to your OCI user.

2) Click here for the steps to grant the Container Engine access to all resources in the tenancy.

3) Click here for the steps on creating the Kubernetes Cluster using the quick cluster option.

If you hit a service limits error, create a service request to increase the limits.

4) From the Container Cluster main page, click on the cluster recently created and copy the cluster id.

mkdir -p $HOME/.kube
oci ce cluster create-kubeconfig --cluster-id <cluster ID> --file $HOME/.kube/config --region us-ashburn-1

5) Export the KUBECONFIG environment variable:

export KUBECONFIG=$HOME/.kube/config

6) Verify that the configuration works by running a kubectl command such as:

kubectl get nodes

7) Refer to the kubectl cheat sheet for tips on how to use the command line. For example:

First create the alias, e.g. k

alias k=kubectl
brew install bash-completion

Then add the following to the $HOME/.bash_profile:

if [ -f $(brew --prefix)/etc/bash_completion ]; then
    . $(brew --prefix)/etc/bash_completion
fi

source <(kubectl completion bash)
alias k=kubectl
complete -F __start_kubectl k

Re-source:

source $HOME/.bash_profile

Then try it out:

k get nodes