Skip to content

Conversation

@emmanuel-quevillon-outscale
Copy link
Contributor

@emmanuel-quevillon-outscale emmanuel-quevillon-outscale commented Oct 31, 2025

Hi guys,

This Pull Request introduces a new subcommands netpeering to manage (create, list, get, delete) NetPeering between 2 OKS projects only at the moment. It could be possible to extends this feature to also manage NetPeering between an OKS project and an OUTSCALE VPC account.

Global options

Usage: oks-cli netpeering [OPTIONS] COMMAND [ARGS]...

  NetPeering related commands.

Options:
  --profile TEXT           Configuration profile to use
  -p, --project-name TEXT  Project Name
  -c, --cluster-name TEXT  Cluster Name
  --user TEXT              User
  --group TEXT             Group
  --help                   Show this message and exit.

Commands:
  create  Create a NetPeering between 2 projects
  delete  Delete a NetPeering from a project/cluster
  get     Get information about a NetPeering
  list    List NetPeering from a project/cluster

Delete a netpeering

Usage: oks-cli netpeering delete [OPTIONS]

  Delete a NetPeering from a project/cluster

Options:
  --netpeering-id TEXT  NetPeering to remove  [required]
  --dry-run             Run without any action
  --force               Force deletion without confirmation
  --help                Show this message and exit.

List netpeering

Usage: oks-cli netpeering list [OPTIONS]

  List NetPeering from a project/cluster

Options:
  --status [active|deleted|all]  List NetPeering with this status, default
                                 'active'. Not supported with wide output
  -o, --output [json|yaml|wide]  Specify output format, default json
  --help                         Show this message and exit.

Create a netpeering

Usage: oks-cli netpeering create [OPTIONS]

  Create a NetPeering between 2 projects

Options:
  --from-project TEXT       Source project name to create netpeering from
                            [required]
  --from-cluster TEXT       Source cluster to create netpeering from
                            [required]
  --to-project TEXT         Project name to create netpeering to  [required]
  --to-cluster TEXT         Target cluster to create netpeering to  [required]
  --netpeering-name TEXT    Name of the NetPeeringRequest, default to '{from-
                            project}-to-{to-project}
  --auto-approve            Automatically confirm NetPeering acceptance
  --user TEXT               User
  --group TEXT              Group
  --dry-run                 Client dry-run, only print the object that would
                            be sent, without sending it
  -o, --output [json|yaml]  Specify output format, by default is json
  --profile TEXT            Configuration profile to use
  --help                    Show this message and exit.

Available to discuss about this PR if needed.

Copy link

@anton-kutin anton-kutin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error received during test
for test

  • create two projects with different cidr
  • create cluster in each project
  • do not create nodepools on clusters
  • try to create netpeering via oks-cli - error message:
    line 186, in netpeering_create
    source.update({'network_id': source_nodepool['items'][0]['metadata']['labels']['oks.network_id'],

@emmanuel-quevillon-outscale
Copy link
Contributor Author

error received during test for test

  • create two projects with different cidr
  • create cluster in each project
  • do not create nodepools on clusters
  • try to create netpeering via oks-cli - error message:
    line 186, in netpeering_create
    source.update({'network_id': source_nodepool['items'][0]['metadata']['labels']['oks.network_id'],

Hi @anton-kutin

This error is normal as to create a netpeering between 2 projects we need to get the netword_id (a.k.a vpc-id). So, if you create a cluster without a nodepool, we cannot retrieve the required network_id, and then we cannot create a netpeering.
This test case is an extreme case, why create a netpeering to a cluster without nodepool?
But I can add a test to check this case and throw an error if network_id is not available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants