Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Deploy a Kubernetes cluster on OUTSCALE with OKS

34 min read
Improve this page

Logo Dassault Systèmes

OKS (OUTSCALE Kubernetes as a Service) provides a Kubernetes cluster whose control plane is managed by OUTSCALE. You drive it from the command line with oks-cli, a Python tool. This page walks you through creating a cluster end to end: profile, project, cluster, nodepools, then access with kubectl. It ends with the deletion of the cluster and the project and with checks on what is left.

It works in two stages. The first part needs no OUTSCALE account: in a practice folder, you install oks-cli, create dummy profiles and read the errors it returns before any API call. The second part needs an account and creates billed resources: it starts with a warning about cost.

What you will learn

  • Install oks-cli and check its version
  • Isolate your tests in a throwaway folder and home directory, without touching ~/.oks_cli
  • Predict what oks-cli checks (profile, project) before it calls the API
  • Create a project, a cluster and nodepools
  • Get a kubeconfig and use kubectl
  • Delete the cluster, then the project, and check what is still billed

Prerequisites

You can use a Linux or macOS terminal and run a Python command. You know the words pod and node and you have already run kubectl get nodes: see Kubernetes key concepts and kubectl. The part without an account only needs Python 3.11 or newer. The second part needs an OUTSCALE account on which OKS is enabled. OUTSCALE vocabulary is covered in OUTSCALE and AWS vocabulary (in French). An OKS cluster cannot be emulated locally: learning without an account (in French) explains what the emulator covers.

Project, cluster, nodepool, profile: how OKS is organised

Four objects come into play, and oks-cli handles them in this order. The diagram shows where each one lives: the profile on your machine; at OUTSCALE, the project contains the cluster, which contains the nodepools.

Your machine, with oks-cli and a profile (keys and region). At OUTSCALE, a project (CIDR) contains a cluster (control plane) and its nodepools (worker nodes).     oks-cli     profile: keys, regionProject networkone CIDR block API of the region Control planerun by OUTSCALE     Nodes, machines     that run your podsYour machineOKS projectClusterNodepoolcommand and its profilenetwork chosen when the project is createdcluster control planecluster nodescontrolshosts
Source · SVG
Esc to close, + and − to zoom, scroll to move around. 100 %
  • The profile is local to your machine: a name, access keys (or a login and password) and a region. It decides which account each command acts on.
  • The project reserves a network, defined by a CIDR block (a range of private IP addresses, for example 10.60.0.0/16), and groups the clusters.
  • The cluster is the Kubernetes cluster. Creating it only produces the control plane, the components that run the cluster (API server, scheduling, state).
  • The nodepool is a group of worker nodes of the same type. Without a nodepool, the cluster runs no pod.

The worker nodes are neither visible nor accessible in your OUTSCALE account: you manage them through nodepools.

Install oks-cli

oks-cli is a Python package that requires Python 3.11 or newer. Install it in a virtual environment, with a pinned version, from your home directory (cd ~): the oks-env folder will be created there. On Debian or Ubuntu, the venv module is a separate package.

Terminal window
python3 --version
sudo apt install python3-venv
python3 -m venv oks-env
source oks-env/bin/activate
pip install oks-cli==1.22

With an older Python, install a recent one with pyenv (in French) or Homebrew (in French). pipx (in French) (pipx install oks-cli==1.22) gives an isolated global installation, with no environment to activate.

Terminal window
oks-cli version
Output of oks-cli version
1.22

The command prints the version number only. The outputs in this part are those of version 1.22, on Debian 13 (Python 3.13.5). With a newer version, read the command help (oks-cli cluster --help) if an option is missing.

Create the practice folder

oks-cli stores its profiles in $HOME/.oks_cli/config.json. To learn without risk, you give it another, throwaway home directory. The variables below only apply in a subshell, a second shell started inside your terminal: exit takes you back to the original, and your real ~/.oks_cli is neither read nor modified. The first block ends with bash: wait for the new prompt before pasting the next block, which must run in that second shell.

Terminal window
command -v oks-cli
mkdir -p ~/oks-lab && cd ~/oks-lab
bash

In this new shell, HOME points to the practice folder. The proxy variables aim at 127.0.0.1:9, a port where nothing listens: no request can leave your machine, even with real keys. The unset commands remove any oks-cli and proxy variables your terminal may already carry: OKS_PROFILE selects a profile, and OKS_ENDPOINT replaces the API address of the profile.

Terminal window
export HOME=$PWD
unset OKS_PROFILE OKS_ENDPOINT OKS_ACCESS_KEY OKS_SECRET_KEY OKS_USERNAME OKS_PASSWORD NO_PROXY no_proxy
export https_proxy=http://127.0.0.1:9 HTTPS_PROXY=http://127.0.0.1:9 http_proxy=http://127.0.0.1:9
echo $HOME

The last line must end with oks-lab. If not, do not go on: you would still be in your original terminal. If oks-cli is no longer found after this change (possible with pyenv or mise shims), call it by the path that command -v oks-cli printed before bash. The folder remains after an exit: to resume, open a new terminal, then repeat cd ~, source oks-env/bin/activate, cd ~/oks-lab, bash, the export commands and the unset command.

In a new practice folder, oks-cli knows no profile. Each command below fails without calling the network. The -p option gives the project name.

Terminal window
oks-cli profile list
oks-cli project list
oks-cli cluster list
oks-cli cluster list -p demo
Outputs (tested version: 1.22)
There are no profiles
Error: No authentication profiles were found. Please set a user profile to proceed
Usage: oks-cli cluster list [OPTIONS]
Try 'oks-cli cluster list --help' for help.
Error: Invalid value: --project-name must be specified, or a default project must be set
Error: No authentication profiles were found. Please set a user profile to proceed

profile list succeeds and reports that there is no profile. project list stops with exit code 1: it needs a profile. cluster list alone stops with exit code 2: with no profile, it asks for the project first. With -p demo, it asks for the profile (code 1). The order of the checks therefore depends on the starting state: the rule that follows applies once at least one profile exists.

The oks-cli command in detail

An oks-cli command is written oks-cli resource action [options]. The resource says what you act on (profile, project, cluster), the action says what you do with it (list, create, get, delete). The --profile option (the profile) and -p (the project) are added to almost every command. Read the line from left to right: each number points to the explanation of that piece.

Anatomy of the command

Syntaxoks-cli resource action [options]

  1. oks-cli the programThe OKS command line.
  2. cluster the resourceprofile, project or cluster.
  3. list the actionlist, create, get, delete…
  4. --profile recette the profileoptionalThe keys and the region.
  5. -p demo the projectoptionalThe one that holds the clusters.

Outputthe call that would go out

Profiles, region and project: what oks-cli reads

A profile is created with oks-cli profile add. It asks for a name, a pair of access keys (--access-key and --secret-key) or a login and password (--username and --password), and a region. The keys below are dummy: they give access to nothing (the literal value FACTICE is French for "dummy").

Terminal window
oks-cli profile add --profile-name essai --access-key FACTICE --secret-key FACTICE --region eu-west-2
oks-cli profile list
Outputs
Profile essai has been successfully added
Profile: essai Account type: ak/sk Region: eu-west-2 Endpoint: https://api.eu-west-2.oks.outscale.com/api/v2/ Enabled JWT auth: False

In profile list, look at Region and Endpoint: the region of the profile sets the address of the API that is called, and no cluster or project command takes a region. Without keys, adding fails with Error: --access-key and --secret-key or --username and --password must be specified. The $HOME/.oks_cli/config.json file created in the practice folder has mode 600: it holds your keys, and only your account can read it.

Without a --profile option, oks-cli looks for a profile named default, or the one designated by the OKS_PROFILE variable. With at least one profile, it checks the profile, then the project, then calls the API.

How oks-cli checks the profile and the project, step by step

The map follows oks-cli cluster list with a profile recette and a project demo (on your side, essai and demo). Predict the result in four cases: the command alone, with --profile only, with -p demo only, with both. Then tick or untick each option, move forward one check at a time and compare.

Mental model

What oks-cli checks before calling OUTSCALE

find the profilefind the projectcall the API for each command, in this order

$ oks-cli cluster list 2>&1 | tail -1

  1. Without --profile, oks-cli looks for a profile named default. There is none: the command stops, even though recette exists.
  2. The command stopped before any call: nothing was sent.

What the animation shows

  1. As soon as a profile exists, it is read first: without --profile, it must be named default.
  2. The project next: -p, or a project chosen with project login.
  3. The region comes from the profile, not from the command.
  4. For `cluster list`, nothing goes out as long as one check fails.

Golden rules

See your profiles

Their names and regions:

oks-cli profile list

Name the profile on each command

Above all before creating or deleting:

oks-cli cluster list --profile recette -p demo

Essential vocabulary

Profiles · local, without a call

profile list
The known profilesoks-cli profile list | cut -c1-16 → recette
--region
An unknown regionoks-cli profile add --profile-name x --access-key A --secret-key B --region mars > /dev/null 2>&1; echo $? → code 2
profile add
A forgotten optionoks-cli profile add --profile-name x > /dev/null 2>&1; echo $? → code 2
profile add
Forgotten keysoks-cli profile add --profile-name x --region eu-west-2 > /dev/null 2>&1; echo $? → code 2

Failures · before the call

--profile
An unknown profileoks-cli cluster list -p demo --profile absent > /dev/null 2>&1; echo $? → code 1
-p
The forgotten projectoks-cli cluster list --profile recette > /dev/null 2>&1; echo $? → code 2
project list
The call that would go outoks-cli project list --profile recette → the address called
cluste
A misspelled commandoks-cli cluste list > /dev/null 2>&1; echo $? → code 2

Now replay three of these cases in your practice folder, with the essai profile, then one case with an unknown profile.

Terminal window
oks-cli cluster list
oks-cli cluster list --profile essai
oks-cli cluster list -p demo --profile essai
oks-cli cluster list -p demo --profile absent
Outputs
Error: Profile default does not exist
Usage: oks-cli cluster list [OPTIONS]
Try 'oks-cli cluster list --help' for help.
Error: Invalid value: --project-name must be specified, or a default project must be set
{"Error": "Failed to reach the endpoint https://api.eu-west-2.oks.outscale.com/api/v2/projects (ProxyError)"}
Error: Profile absent does not exist

The first message names default although essai exists. The second shows the profile found and the project requested. The third gives the address that would be called, the one for the region of the profile: the call fails on the dummy proxy, which proves that the profile and the project were accepted. The last one shows that an unknown profile stops the command before any call, and that --profile goes after the action as well as before it (oks-cli --profile absent project list gives the same error).

Validate your input before creating Exercise 1 of 2 · ~8 min · terminal

You want to check your input before creating a project and then a cluster, from a machine with no network. The help of oks-cli project create --help says that --dry-run prints the object that would be sent, without sending it. Check what the command really does.

Create the recette profile

Add a recette profile to your practice folder, with dummy keys and the eu-west-2 region.

Run the project dry run

Run oks-cli project create -p demo --cidr 10.50.0.0/18 --dry-run with the recette profile, then print the exit code with echo $?.

Run the cluster dry run

Run oks-cli cluster create -p demo -c essai --dry-run with the recette profile, then without -p with the essai profile, and read the address in each error.

A hint 1 / 1

The profile is chosen with an option you have already used. Compare the address in the error with the one from cluster list: it is not the same.

I have tried: show the solution
Terminal window
oks-cli profile add --profile-name recette --access-key FACTICE --secret-key FACTICE --region eu-west-2
oks-cli --profile recette project create -p demo --cidr 10.50.0.0/18 --dry-run; echo $?
oks-cli cluster create -p demo -c essai --profile recette --dry-run
oks-cli cluster create -c essai --dry-run --profile essai
Outputs, in order
Profile recette has been successfully added
{"Error": "Failed to reach the endpoint https://api.eu-west-2.oks.outscale.com/api/v2/templates/project (ProxyError)"}
1
{"Error": "Failed to reach the endpoint https://api.eu-west-2.oks.outscale.com/api/v2/templates/cluster (ProxyError)"}
{"Error": "Failed to reach the endpoint https://api.eu-west-2.oks.outscale.com/api/v2/templates/cluster (ProxyError)"}

In every case, --dry-run tries to reach the API: the address ends with templates/project, then templates/cluster. With no network, it fails with exit code 1: it validates nothing offline. It does not reject a missing or invalid --cidr before that call (without --cidr, or with 10.50.0.0/33, the project gives the same error), and cluster create without -p calls the API even with a profile, whereas cluster list asked for the project. The dry run is useful with an account, and it does not replace reading the parameters.

Which region should you choose?

oks-cli accepts two regions, and exercise 2 has you read them. For a test, use eu-west-2, the region of the examples on this page. For data subject to SecNumCloud, do not rely on this page: confirm the region and the scope of OKS with OUTSCALE before any commitment.

Add a profile and read its region Exercise 2 of 2 · ~10 min · terminal

You are preparing a prod profile for a region other than eu-west-2. You do not know which regions oks-cli accepts: the tool will tell you.

Trigger the error

Run oks-cli profile add --profile-name prod --access-key FACTICE --secret-key FACTICE with nothing else, and read the error.

Add prod in the other region

Run the command again with the missing option and the region that the error offers besides eu-west-2, then print the list of profiles.

Look for the option that deletes without confirmation

Read the help of oks-cli profile delete, without deleting any profile.

A hint 1 / 1

The error in step 1 gives the list of values accepted by the missing option. The help in step 3 describes each option in one line.

I have tried: show the solution
Terminal window
oks-cli profile add --profile-name prod --access-key FACTICE --secret-key FACTICE
oks-cli profile add --profile-name prod --access-key FACTICE --secret-key FACTICE --region cloudgouv-eu-west-1
oks-cli profile list
oks-cli profile delete --help
Outputs, in order
Usage: oks-cli profile add [OPTIONS]
Try 'oks-cli profile add --help' for help.
Error: Missing option '--region'. Choose from:
eu-west-2,
cloudgouv-eu-west-1
Profile prod has been successfully added
Profile: essai Account type: ak/sk Region: eu-west-2 Endpoint: https://api.eu-west-2.oks.outscale.com/api/v2/ Enabled JWT auth: False
Profile: recette Account type: ak/sk Region: eu-west-2 Endpoint: https://api.eu-west-2.oks.outscale.com/api/v2/ Enabled JWT auth: False
Profile: prod Account type: ak/sk Region: cloudgouv-eu-west-1 Endpoint: https://api.cloudgouv-eu-west-1.oks.outscale.com/api/v2/ Enabled JWT auth: False
Usage: oks-cli profile delete [OPTIONS]
Delete a profile by name
Options:
--profile-name, --profile TEXT Name of profile [required]
-f, --force Force deletion without confirmation
--help Show this message and exit.

The missing option is --region, and the error lists the two accepted regions. The API address changes with the region of the profile: the one for prod contains cloudgouv-eu-west-1. A region outside the list, mars for example, is refused with exit code 2. The option that deletes without confirmation is -f or --force: keep it for test profiles, never for a profile whose content you do not know.

SecNumCloud: what the qualification covers

The ANSSI SecNumCloud 3.2 qualification covers the OUTSCALE IaaS offer, and the ANSSI catalogue gave an end of validity of 30 November 2026: read it again before any commitment. OUTSCALE presents OKS as available on its public cloud qualified SecNumCloud 3.2, but the OKS documentation mentions neither SecNumCloud nor the region concerned, and nothing says that cloudgouv-eu-west-1 is the qualified region. This match has to be checked with OUTSCALE, like the exact scope of OKS.

Switch to a real OUTSCALE account

Everything below acts on a real account. The outputs in this part come from an OUTSCALE test account and from a version of oks-cli older than 1.22: your values (identifiers, dates, durations) will differ, and the text of the outputs may have changed. If you opened the practice folder subshell, close it first with exit: the proxy variables and the throwaway home directory disappear, and oks-cli finds your real ~/.oks_cli again.

Create the working profile. Access keys suit automation, login and password suit interactive use. To avoid writing the keys in clear text in your history, read them without echo. The value still goes to oks-cli as an argument, so it is visible in the process list while the command runs: on a shared machine, create this profile elsewhere.

Terminal window
printf 'Access key : '; read -rs AK; echo
printf 'Secret key : '; read -rs SK; echo
oks-cli profile add --profile-name "production" --access-key "$AK" --secret-key "$SK" --region "eu-west-2"
unset AK SK
Output (values from a test account)
Profile production has been successfully added

Check the quotas before creating anything: they give the number of projects and clusters, and the Kubernetes versions on offer.

Terminal window
oks-cli quotas --profile production
Output (values from a test account)
{
"Projects": 2,
"ClustersPerProject": 2,
"KubeVersions": [
"1.30",
"1.31",
"1.32",
"1.28",
"1.29"
],
"CPSubregions": [
"2a",
"2b",
"2c"
]
}

This account allows 2 projects, 2 clusters per project and versions 1.28 to 1.32. The outscale Terraform provider (in French) can also manage OKS projects, clusters and nodepools.

Create and manage OKS projects

The project reserves the network of the clusters. Choose a wide CIDR: /16 (65,536 addresses) leaves room to grow, and the CIDR cannot be changed after creation. It must be a private block in the sense of RFC 1918, with a size between /23 and /16, and 172.31.0.0/16 is reserved. Before creating, print your profiles to be sure you target the right account.

Terminal window
oks-cli profile list
oks-cli project create \
--project-name "demo-guide" \
--cidr "10.60.0.0/16" \
--profile production
Output (values from a test account)
{
"id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"name": "demo-guide",
"description": "",
"cidr": "10.60.0.0/16",
"region": "eu-west-2",
"status": "pending",
"tags": {},
"disable_api_termination": false,
"created_at": "2026-01-29T08:43:42.672702Z",
"updated_at": "2026-01-29T08:43:42.672702Z"
}

The status field is pending while the network is being created, a few minutes on this account. Query the project with oks-cli project get --project-name demo-guide --profile production until status is ready: the rest of the object does not change, only updated_at moves. Wait for ready before creating the cluster.

oks-cli project list --profile production prints the profile's projects in a table (project, profile, region, age, state pending, ready or deleting, and a DEFAULT column). oks-cli project login --project-name demo-guide --profile production sets the default project of this profile, which makes -p optional for it from then on. oks-cli project update changes the description (--description), the tags (--tags) and --disable-api-termination, which forbids deleting the project through the API as long as it is true.

Create and manage OKS clusters

The cluster is created with the control plane type you choose, with no worker node. The type sets the memory of the masters, high availability and the recommended maximum size of the cluster, calculated for a light load.

TypeMastersRAM per masterHigh availabilityRecommended max sizeUse
cp.mono.master14 GiBno10 nodestest, short-lived cluster
cp.3.masters.small34 GiByes50 nodessmall production environment
cp.3.masters.medium38 GiByes200 nodesmedium production
cp.3.masters.large316 GiByes400 nodeslarge production

cp.mono.master has no applicable SLA (no availability commitment from OUTSCALE). A cluster created with this type can later move to a three-master type, but not the other way round. Without --control-plane, OKS creates a cp.3.masters.small.

The --admin option lists the addresses allowed to reach the cluster API: with no address, the cluster is unreachable, and a private address (RFC 1918) is refused with a 422 error. my-ip detects your public address, and several addresses are separated by commas.

For --version, take a value from the KubeVersions list of oks-cli quotas, and replace VERSION below (the OUTSCALE documentation announces versions 1.32 to 1.36 in November 2026).

Terminal window
oks-cli profile list
oks-cli cluster create \
--project-name "demo-guide" \
--cluster-name "test-cluster" \
--admin my-ip \
--control-plane "cp.mono.master" \
--version "VERSION" \
--profile production
Output, start of the deployment, with version 1.31 (values from a test account)
{
"project_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"id": "11111111-2222-3333-4444-555555555555",
"name": "test-cluster",
"description": "",
"cp_multi_az": false,
"cp_subregions": [
"2a"
],
"version": "1.31",
"cni": "cilium",
"admin_whitelist": [
"203.0.113.100/32"
],
"statuses": {
"created_at": "2026-01-29T08:49:01.097530Z",
"updated_at": "2026-01-29T08:49:01.097530Z",
"status": "pending",
"available_upgrade": ""
},
"control_planes": "cp.mono.master",
"cidr_pods": "10.91.0.0/16",
"cidr_service": "10.92.0.0/16",
"cluster_dns": "10.92.0.10"
}

In the output, my-ip was replaced by the public address of the machine (203.0.113.100/32), the pod and service CIDRs were assigned automatically, and status is pending: on this account, the state goes through deploying then ready in 10 to 15 minutes. The cluster name is 1 to 40 characters long: lowercase letters, digits and hyphens, starting with a lowercase letter and not ending with a hyphen.

--dry-run prints the cluster that would be created; it calls the API (exercise 1), so it only works with an account.

oks-cli cluster list -p demo-guide --profile production prints a table of the project's clusters. cluster get gives the details; check that status is ready before adding a nodepool: the rest of the object is the one from creation (version, control plane type, allowed addresses, CIDRs).

Terminal window
oks-cli cluster get --cluster-name test-cluster \
--project-name "demo-guide" --profile production

cluster update changes a property of a ready cluster, which goes to updating for one to two minutes. For --admin, the value replaces the list: writing only the new address removes yours, and the API becomes unreachable from your machine. So give again all the addresses to keep, my-ip included. The project and the profile of a cluster cannot be changed after creation.

The example adds the address 203.0.113.42/32: replace it with an address to allow in addition to yours, or skip this command if you do not need it.

Terminal window
oks-cli cluster update \
--project-name "demo-guide" \
--cluster-name "test-cluster" \
--admin "my-ip,203.0.113.42/32" \
--profile production

Create and manage OKS nodepools

A nodepool is a group of nodes with the same OUTSCALE machine type (a TINA type), in the form tinavW.cXrYpZ (for example tinav6.c1r1p2, or tinav6.c1r1p2.gpu for a nodepool with GPU). To mix types, create several nodepools. The cluster must be ready, and the address of your machine must be in --admin. The --zone option gives the subregion of the nodes, and you must provide it: since August 2025, oks-cli stops when it finds no zone, neither through the option nor in a file passed with -f.

Terminal window
oks-cli cluster \
--project-name "demo-guide" \
--cluster-name "test-cluster" \
--profile production \
nodepool create \
--nodepool-name "workers" \
--count 2 \
--type "tinav6.c2r4p2" \
--zone "eu-west-2a"
Output (values from a test account)
nodepool.oks.dev/workers created

Without a zone, the command fails with Missing option '--zone' / '-z'.: oks-cli checks this option after finding the project and the cluster, so offline you first get the network failure on /projects. The list gives the state of each nodepool. Read the PENDING (nodes being created), RUNNING and READY (available nodes) columns: the nodepool is usable when READY reaches DESIRED NODES.

Terminal window
oks-cli cluster nodepool list \
--project-name "demo-guide" \
--cluster-name "test-cluster" \
--profile production
Ready output, about 5 minutes after creation (values from a test account)
NAME TYPE MIN NODES MAX NODES DESIRED NODES ATTACHED READY RUNNING PENDING STOPPING STOPPED SHUTTING DOWN CURRENT PROCESSING PHASE LAST ERROR
workers tinav6.c2r4p2 n/a n/a 2 2 2 2 0 0 0 0 idle None

A nodepool is deleted with oks-cli cluster nodepool delete --nodepool-name NAME, and takes 2 to 3 minutes on the test account. OKS refuses to delete the last nodepool of a cluster: create a second one first, or delete the cluster.

Access the Kubernetes cluster

The shortest way goes through oks-cli: it fetches the kubeconfig and runs kubectl for you, with the authentication of the profile.

Terminal window
oks-cli cluster kubectl \
--project-name "demo-guide" \
--cluster-name "test-cluster" \
--profile production \
get nodes
Output (values from a test account)
NAME STATUS ROLES AGE VERSION
ip-10-60-35-89 Ready <none> 5m v1.31.13
ip-10-60-59-231 Ready <none> 5m v1.31.13

The two nodes of the nodepool are Ready. For daily use, generate a kubeconfig file: --print-path prints its path, stored under ~/.oks_cli/cache.

Terminal window
oks-cli cluster kubeconfig \
--project-name "demo-guide" \
--cluster-name "test-cluster" \
--profile production \
--print-path
Output (values from a test account)
/home/user/.oks_cli/cache/PROJECT_ID-CLUSTER_ID/default/default/kubeconfig

The client certificate of the kubeconfig is valid for 7 days by default; after that, kubectl refuses access, often with error: You must be logged in to the server (Unauthorized). oks-cli cluster kubectl renews an expired certificate by itself. --ttl 2h chooses another duration (formats 3h, 2d, 1w), --refresh and its synonym --force download a new file, and --user with --group produce a file attached to that user and group for the cluster RBAC.

To use the file with kubectl, point the KUBECONFIG variable at it (for context management, see Kubeconfig and contexts). kubectl get nodes should then answer like oks-cli cluster kubectl above.

Terminal window
export KUBECONFIG="$(oks-cli cluster kubeconfig --project-name "demo-guide" --cluster-name "test-cluster" --profile production --print-path)"
kubectl get nodes

The file contains your access credentials for the cluster and it is stored in clear text on your disk. oks-cli gives it mode 600: check with ls -l, and restore it if needed with chmod 600 on the printed path.

Add a nodepool with a manifest

The nodepool also exists as a Kubernetes object: kubectl can create it, which opens settings that the command line does not offer (several zones, volumes, automatic node replacement, scheduled upgrade, autoscaling). This step is optional. This second nodepool adds one billed node; delete it before moving on to the cleanup. Write nodepool.yaml, then apply it with the KUBECONFIG exported above.

nodepool.yaml
apiVersion: oks.dev/v1beta2
kind: NodePool
metadata:
name: workers-yaml
spec:
desiredNodes: 1
nodeType: tinav6.c1r1p2
zones:
- eu-west-2a
autoHealing: true
Terminal window
kubectl apply -f nodepool.yaml
oks-cli cluster nodepool list --project-name "demo-guide" --cluster-name "test-cluster" --profile production

desiredNodes counts the nodes in each zone: with two zones, it creates twice as many. With autoHealing: true, OKS restarts the VM of a node 5 minutes after its last signal, and replaces it if the node is not Ready 5 minutes after that restart. The list should show workers-yaml next to workers. When the workers-yaml line shows READY at 1, delete it: workers remains, so OKS does not refuse.

Terminal window
oks-cli cluster nodepool delete --nodepool-name workers-yaml \
--project-name "demo-guide" --cluster-name "test-cluster" --profile production

Diagnostic commands

To understand a blockage, query each level in order, from the project down to the nodes: oks-cli project get, oks-cli cluster get, then oks-cli cluster nodepool list, each with --profile and the project and cluster names as above, and finally kubectl cluster-info. If the problem persists, give OUTSCALE support the project and cluster identifiers, the region, the version of oks-cli (oks-cli version) and the output of the command run with --debug.

Troubleshooting

SymptomLikely causeSolution
Error: Profile default does not exist although your profile existsNo --profile, so oks-cli looks for default (or OKS_PROFILE)Add --profile NAME, or create a default profile
Invalid value: --project-name must be specified..., code 2No project given and no default project-p NAME, or oks-cli project login
Failed to reach the endpoint ... (ProxyError)No network, the dummy proxy of the practice folder, or OKS_ENDPOINTexit the subshell to reach OUTSCALE; unset OKS_ENDPOINT
Every command refused despite valid keysOKS may not be enabled on the accountAsk OUTSCALE support to enable it
Missing option '--zone' / '-z'. when creating a nodepoolNo zone given, neither by --zone nor in a file--zone eu-west-2a
422 error when creating the clusterPrivate address in --admin--admin my-ip, or a public address as a /32
API unreachable after cluster update --adminThe new value replaced the list, your address is goneFrom an allowed machine, run it again with --admin my-ip
kubectl answers Unauthorized after several daysKubeconfig older than 7 daysoks-cli cluster kubeconfig ... --refresh --print-path

Clean up

A cluster, its nodes and the associated addresses or volumes stay billed as long as they exist. Delete the cluster first, then the project. Before each deletion, read the profile, the name and the identifier again: they must be those of your test, not those of another account or another cluster.

If you created persistent volumes or LoadBalancer Services in the cluster (this test creates none), delete them first with kubectl: they appear in no oks-cli list, and you have to check them in Cockpit, the OUTSCALE web console.

Terminal window
oks-cli profile list
oks-cli project list --profile production
oks-cli cluster list -p demo-guide --profile production
oks-cli cluster delete \
--project-name "demo-guide" \
--cluster-name "test-cluster" \
--profile production
Output, with confirmation (values from a test account)
Are you sure you want to delete the cluster with name test-cluster? [y/N]: y
{
"Details": "Cluster 11111111-2222-3333-4444-555555555555 successfully deleted"
}

Deletion takes a few minutes, and the cluster must be ready. When oks-cli cluster list -p demo-guide --profile production no longer shows it, check what the project keeps: public IP addresses and snapshots.

Terminal window
oks-cli project publicips -p demo-guide --profile production
oks-cli project snapshots -p demo-guide --profile production

Then delete the project, after setting --disable-api-termination back to false if it was true.

Terminal window
oks-cli profile list
oks-cli project delete \
--project-name "demo-guide" \
--profile production
Output, with confirmation (values from a test account)
Are you sure you want to delete the project with name demo-guide? [y/N]: y
{
"Details": "Project aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee successfully deleted"
}

Check that oks-cli project list --profile production no longer lists the project. Then clean up your machine from your home directory (cd ~), where you created oks-env: remove KUBECONFIG, the profile and the local files. Replace PROJECT_ID-CLUSTER_ID with the name of your cluster's folder under ~/.oks_cli/cache.

Terminal window
unset KUBECONFIG
oks-cli profile delete --profile-name production
rm -r ~/.oks_cli/cache/PROJECT_ID-CLUSTER_ID
deactivate
rm -r oks-env

To check the machine, the first command below should print nothing any more (unless you had installed oks-cli elsewhere, with pipx for example) and the second should print vide (French for "empty").

Terminal window
command -v oks-cli
echo "${KUBECONFIG:-vide}"

If you only did the part without an account, close the subshell with exit, then run only cd ~, deactivate and rm -r oks-env. In every case, finish by deleting the practice folder: cd ~ then rm -r ~/oks-lab.

Key points

  • oks-cli resource action [options]: with at least one profile, it checks the profile, then the project, then calls the API.
  • Without --profile, oks-cli looks for a profile named default: an existing profile under another name is not enough.
  • The region comes from the profile. --dry-run calls the API: it validates nothing offline.
  • The CIDR of a project cannot be changed after creation: take a /16.
  • The cluster only creates the control plane: without a nodepool, it runs no pod, and creating a nodepool requires a zone.
  • cluster update --admin replaces the list of addresses, and the kubeconfig expires after 7 days by default.
  • A cluster is billed as long as it exists: read the profile, the name and the identifier you target, then delete the cluster, then the project.

Knowledge check

Check what you have learned with this interactive quiz

6 questions
6 min
70% to pass

How it works

  • The timer starts when you click Start
  • Multiple choice, true/false and short answer questions
  • You can move between questions
  • Detailed results are shown at the end

Starts the quiz and the timer