Tutorial: Getting Started with OKS Using OKS CLI
The aim of this tutorial is to present the main operations possible with OKS using OKS CLI.
|
To use OKS, you need to send a request to our Support team at support@outscale.com. |
Adding an OKS Profile to Your OUTSCALE Account Using OKS CLI
Before you begin: Install and configure OKS CLI. For more information, see Installing and Configuring OKS CLI. |
The profile add command allows you to set an existing OUTSCALE root account as an OKS profile:
$ oks-cli profile add \
--profile-name "default" \
--username "MY_LOGIN" \
--password "MY_ACOUNT_PASSWORD" \
--region "eu-west-2" \
--jwt false
$ oks-cli profile add \
--profile-name "default" \
--access-key "MY_ACCESS_KEY" \
--secret-key "MY_SECRET_KEY" \
--region "eu-west-2" \
--jwt false
|
For more information, see Adding an OKS Profile to Your OUTSCALE Account. |
Creating a Project Using OKS CLI
Before you begin: Install and configure OKS CLI. For more information, see Installing and Configuring OKS CLI. |
The project create command allows you to create a project:
$ oks-cli project create \
--project-name NAME_OF_PROJECT \
--description "DESCRIPTION_OF_PROJECT" \
--tags "tag1=this,tag2=that"
|
For more information, see Creating a Project. |
Creating a Cluster Using OKS CLI
Before you begin: Install and configure OKS CLI. For more information, see Installing and Configuring OKS CLI. |
To create a cluster, use the cluster create command following this syntax:
$ oks-cli cluster create \
--project-name NAME_OF_PROJECT \
--cluster-name NAME_OF_CLUSTER \
--admin "1.2.3.4/32,5.6.7.8/32" \
--control-plane "cp.mono.master" \
--version 1.30
|
For more information, see Creating a Cluster. |
Accessing a Cluster Using kubectl
Before you begin: Install and configure OKS CLI. For more information, see Installing and Configuring OKS CLI. |
You can use OKS CLI to execute any kubectl command directly on your cluster. To do so, use the oks-cli cluster kubectl command, followed by your OKS CLI parameters and a kubectl command. OKS CLI will connect to the desired cluster, retrieve its configuration file, encrypt, and launch the requested command:
$ oks-cli cluster kubectl \
--project-name NAME_OF_PROJECT \
--cluster-name NAME_OF_CLUSTER \
get nodes
|
For more information, see Accessing a Cluster > Using kubectl. |
Creating a Node Pool Using OKS CLI
Before you begin: Install and configure OKS CLI. For more information, see Installing and Configuring OKS CLI. |
The cluster nodepool create command creates an OKS node pool and attaches it to the given cluster.
$ oks-cli cluster \
--project-name NAME_OF_PROJECT \
--cluster-name NAME_OF_CLUSTER \
nodepool create \
--nodepool-name NAME_OF_NODEPOOL \
--count 2 \
--type tinav6.c1r1p2
|
For more information, see Creating a Node Pool. |
Related Pages