Tutoriel: Démarrer avec OKS via la CLI OKS
Cette page est à ce jour disponible en anglais uniquement. |
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 Installer et configurer OKS CLI. |
The profile add
command allows you to set an existing Outscale account as an OKS profile:
oks-cli profile add \
--profile-name "default" \
--username "MY_LOGIN" // --access-key "MY_ACCESS_KEY" \
--password "MY_ACOUNT_PASSWORD" // --secret-key "MY_SECRET_KEY" \
--region "eu-west-2" \
--jwt false
For more information, see Ajouter un profil OKS à votre compte Outscale. |
Creating a Project Using OKS CLI
Before you begin: Install and configure OKS CLI. For more information, see Installer et configurer 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 Créer un projet. |
Creating a Cluster Using OKS CLI
Before you begin: Install and configure OKS CLI. For more information, see Installer et configurer 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 Créer un cluster. |
Using kubectl
Before you begin: Install and configure OKS CLI. For more information, see Installer et configurer 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 Accéder-à-un-cluster.adoc#_using_kubectl. |
Creating a Node Pool Using OKS CLI
Before you begin: Install and configure OKS CLI. For more information, see Installer et configurer 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 NODEPOOL-NAME \
--count 2 \
--type tinav6.c1r1p2
For more information, see Créer un node pool. |
Related pages