Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ USAGE:
scw k8s cluster create [arg=value ...]

EXAMPLES:
Create a Kubernetes cluster named foo with cilium as CNI, in version 1.17.4 and with a default pool composed of 3 DEV1-M
scw k8s cluster create name=foo version=1.17.4 default-pool-config.size=3 default-pool-config.node-type=DEV1-M
Create a Kubernetes cluster named foo with cilium as CNI, in version 1.17.4 and with a pool named default composed of 3 DEV1-M
scw k8s cluster create name=foo version=1.17.4 pools.0.size=3 pools.0.node-type=DEV1-M pools.0.name=default

Create a Kubernetes cluster named bar, tagged, calico as CNI, in version 1.17.4 and with a tagged default pool composed of 2 RENDER-S and autohealing and autoscaling enabled (between 1 and 10 nodes)
scw k8s cluster create name=bar version=1.17.4 tags.0=tag1 tags.1=tag2 cni=cilium default-pool-config.size=2 default-pool-config.node-type=RENDER-S default-pool-config.min-size=1 default-pool-config.max-size=10 default-pool-config.autohealing=true default-pool-config.autoscaling=true default-pool-config.tags.0=pooltag1 default-pool-config.tags.1=pooltag2
Create a Kubernetes cluster named bar, tagged, calico as CNI, in version 1.17.4 and with a tagged pool named default composed of 2 RENDER-S and autohealing and autoscaling enabled (between 1 and 10 nodes)
scw k8s cluster create name=bar version=1.17.4 tags.0=tag1 tags.1=tag2 cni=cilium pools.0.size=2 pools.0.node-type=RENDER-S pools.0.min-size=1 pools.0.max-size=10 pools.0.autohealing=true pools.0.autoscaling=true pools.0.tags.0=pooltag1 pools.0.tags.1=pooltag2 pools.0.name=default

ARGS:
name The name of the cluster
Expand All @@ -18,15 +18,16 @@ ARGS:
cni The Container Network Interface (CNI) plugin that will run in the cluster (unknown_cni | cilium | calico | weave | flannel)
[enable-dashboard] The enablement of the Kubernetes Dashboard in the cluster
[ingress] The Ingress Controller that will run in the cluster (unknown_ingress | none | nginx | traefik)
default-pool-config.node-type The node type is the type of Scaleway Instance wanted for the pool
[default-pool-config.placement-group-id] The placement group ID in which all the nodes of the pool will be created
[default-pool-config.autoscaling] The enablement of the autoscaling feature for the pool
default-pool-config.size The size (number of nodes) of the pool
[default-pool-config.min-size] The minimun size of the pool
[default-pool-config.max-size] The maximum size of the pool
[default-pool-config.container-runtime] The container runtime for the nodes of the pool (unknown_runtime | docker | containerd | crio)
[default-pool-config.autohealing] The enablement of the autohealing feature for the pool
[default-pool-config.tags.{index}] The tags associated with the pool
[pools.{index}.name]
pools.{index}.node-type The node type is the type of Scaleway Instance wanted for the pool
[pools.{index}.placement-group-id] The placement group ID in which all the nodes of the pool will be created
[pools.{index}.autoscaling] The enablement of the autoscaling feature for the pool
pools.{index}.size The size (number of nodes) of the pool
[pools.{index}.min-size] The minimun size of the pool
[pools.{index}.max-size] The maximum size of the pool
[pools.{index}.container-runtime] The container runtime for the nodes of the pool (unknown_runtime | docker | containerd | crio)
[pools.{index}.autohealing] The enablement of the autohealing feature for the pool
[pools.{index}.tags.{index}] The tags associated with the pool
[autoscaler-config.scale-down-disabled] Disable the cluster autoscaler
[autoscaler-config.scale-down-delay-after-add] How long after scale up that scale down evaluation resumes
[autoscaler-config.estimator] Type of resource estimator to be used in scale up (unknown_estimator | binpacking | oldbinpacking)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ USAGE:

EXAMPLES:
Delete a given cluster
scw k8s cluster delete
scw k8s cluster delete 11111111-1111-1111-111111111111

ARGS:
cluster-id The ID of the cluster to delete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ USAGE:

EXAMPLES:
Get a given cluster
scw k8s cluster get cluster-id=11111111-1111-1111-111111111111
scw k8s cluster get 11111111-1111-1111-111111111111

ARGS:
cluster-id The ID of the requested cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ USAGE:

EXAMPLES:
List all available versions for a given cluster to upgrade to
scw k8s cluster list-available-versions
scw k8s cluster list-available-versions 11111111-1111-1111-111111111111

ARGS:
cluster-id The ID of the cluster which the available Kuberentes versions will be listed from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ EXAMPLES:
ARGS:
[order-by] The sort order of the returned clusters (created_at_asc | created_at_desc | updated_at_asc | updated_at_desc | name_asc | name_desc | status_asc | status_desc | version_asc | version_desc)
[name] The name on which to filter the returned clusters
[status] The status on which to filter the returned clusters (unknown | creating | ready | deleting | deleted | updating | warning | error | locked)
[status] The status on which to filter the returned clusters (unknown | creating | ready | deleting | deleted | updating | locked | pool_required)
[organization-id] The organization ID on which to filter the returned clusters
[region] Region to target. If none is passed will use default region from the config (fr-par)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ USAGE:

EXAMPLES:
Reset the admin token for a given cluster
scw k8s cluster reset-admin-token
scw k8s cluster reset-admin-token 11111111-1111-1111-111111111111

ARGS:
cluster-id The ID of the cluster of which the admin token will be renewed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ USAGE:

EXAMPLES:
Enable dashboard on a given cluster
scw k8s cluster update cluster-id=11111111-1111-1111-111111111111 enable-dashboard=true
scw k8s cluster update 11111111-1111-1111-111111111111 enable-dashboard=true

Add TTLAfterFinished and ServiceNodeExclusion as feature gates on a given cluster
scw k8s cluster update cluster-id=11111111-1111-1111-111111111111 feature-gates.0=TTLAfterFinished feature-gates.1=ServiceNodeExclusion
scw k8s cluster update 11111111-1111-1111-111111111111 feature-gates.0=TTLAfterFinished feature-gates.1=ServiceNodeExclusion

ARGS:
cluster-id The ID of the cluster to update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ USAGE:

EXAMPLES:
Upgrade a given cluster to Kubernetes version 1.17.4 (without upgrading the pools)
scw k8s cluster upgrade
scw k8s cluster upgrade 11111111-1111-1111-111111111111 version=1.17.4

Upgrade a given cluster to Kubernetes version 1.17.4 (and upgrade the pools)
scw k8s cluster upgrade
scw k8s cluster upgrade 11111111-1111-1111-111111111111 version=1.17.4 upgrade-pools=true

ARGS:
cluster-id The ID of the cluster to upgrade
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ USAGE:

EXAMPLES:
Get a given node
scw k8s node get
scw k8s node get 11111111-1111-1111-111111111111

ARGS:
node-id The ID of the requested node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ USAGE:

EXAMPLES:
List all the nodes in the given cluster
scw k8s node list
scw k8s node list 11111111-1111-1111-111111111111

List all the nodes in the pool 2222222222222-2222-222222222222 in the given cluster
scw k8s node list
scw k8s node list 11111111-1111-1111-111111111111 pool-id=2222222222222-2222-222222222222

List all ready nodes in the given cluster
scw k8s node list
scw k8s node list 11111111-1111-1111-111111111111 status=ready

ARGS:
cluster-id The cluster ID from which the nodes will be listed from
[pool-id] The pool ID on which to filter the returned nodes
[order-by] The sort order of the returned nodes (created_at_asc | created_at_desc)
[name] The name on which to filter the returned nodes
[status] The status on which to filter the returned nodes (unknown | creating | rebuilding | notready | ready | deleting | deleted | warning | error | locked | rebooting | creation_error)
[status] The status on which to filter the returned nodes (unknown | creating | not_ready | ready | deleting | deleted | locked | rebooting | creation_error)
[region] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ USAGE:

EXAMPLES:
Reboot a given node
scw k8s node reboot
scw k8s node reboot 11111111-1111-1111-111111111111

ARGS:
node-id The ID of the node to reboot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ USAGE:

EXAMPLES:
Replace a given node
scw k8s node replace
scw k8s node replace 11111111-1111-1111-111111111111

ARGS:
node-id The ID of the node to replace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ USAGE:

EXAMPLES:
Create a pool named bar with 2 DEV1-XL on a given cluster
scw k8s pool create
scw k8s pool create 11111111-1111-1111-111111111111 name=bar node-type=DEV1-XL size=2

Create a pool named fish with 5 GP1-L with autoscaling enabled within 0 and 10 nodes, autohealing enabled, and containerd as the container runtime on a given cluster
scw k8s pool create
scw k8s pool create 11111111-1111-1111-111111111111 name=fish node-type=GP1-L size=5 min-size=0 max-size=10 autoscaling=true autohealing=true container-runtime=containerd

Create a tagged pool named turtle with 1 GP1-S which is using the already created placement group 2222222222222-2222-222222222222 for all the nodes in the pool on a given cluster
scw k8s pool create
scw k8s pool create 11111111-1111-1111-111111111111 name=turtle node-type=GP1-S size=1 placement-group-id=2222222222222-2222-222222222222 tags.0=turtle tags.1=placement-group

ARGS:
cluster-id The ID of the cluster in which the pool will be created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ USAGE:

EXAMPLES:
Delete a given pool
scw k8s pool delete
scw k8s pool delete 11111111-1111-1111-111111111111

ARGS:
pool-id The ID of the pool to delete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ USAGE:

EXAMPLES:
Get a given pool
scw k8s pool get
scw k8s pool get 11111111-1111-1111-111111111111

ARGS:
pool-id The ID of the requested pool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ USAGE:

EXAMPLES:
List all pools for a given cluster
scw k8s pool list
scw k8s pool list 11111111-1111-1111-111111111111

List all scaling pools for a given cluster
scw k8s pool list
scw k8s pool list 11111111-1111-1111-111111111111 status=scaling

List all pools for a given cluster that contain the word foo in the pool name
scw k8s pool list
scw k8s pool list 11111111-1111-1111-111111111111 name=foo

List all pools for a given cluster and order them by ascending creation date
scw k8s pool list
scw k8s pool list 11111111-1111-1111-111111111111 order-by=created_at_asc

ARGS:
cluster-id The ID of the cluster from which the pools will be listed from
[order-by] The sort order of the returned pools (created_at_asc | created_at_desc | updated_at_asc | updated_at_desc | name_asc | name_desc | status_asc | status_desc | version_asc | version_desc)
[name] The name on which to filter the returned pools
[status] The status on which to filter the returned pools (unknown | creating | ready | deleting | deleted | updating | scaling | warning | error | locked | upgrading)
[status] The status on which to filter the returned pools (unknown | ready | deleting | deleted | scaling | warning | locked | upgrading)
[region] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ USAGE:

EXAMPLES:
Enable autoscaling on a given pool
scw k8s pool update
scw k8s pool update 11111111-1111-1111-111111111111 autoscaling=true

Reduce the size and max size of a given pool to 4
scw k8s pool update
scw k8s pool update 11111111-1111-1111-111111111111 size=4 max-size=4

Change the tags of the given pool
scw k8s pool update
scw k8s pool update 11111111-1111-1111-111111111111 tags.0=my tags.1=new tags.2=pool

ARGS:
pool-id The ID of the pool to update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ USAGE:

EXAMPLES:
Upgrade a given pool to the Kubernetes version 1.17.4
scw k8s pool upgrade
scw k8s pool upgrade 11111111-1111-1111-111111111111 version=1.17.4

ARGS:
pool-id The ID of the pool to upgrade
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
Get all the details about a specific Kubernetes version.
This method allows to get a specific Kubernetes version and the details about the version.

USAGE:
scw k8s version get <version> [arg=value ...]
scw k8s version get <version-name> [arg=value ...]

EXAMPLES:
Get the Kubernetes version 1.18.0
scw k8s version get 1.18.0

ARGS:
version Version from which to get details
[region] Region to target. If none is passed will use default region from the config
version-name The requested version name
[region] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ USAGE:

AVAILABLE COMMANDS:
list List all available versions
get Get a Kubernetes version
get Get details about a specific version

FLAGS:
-h, --help help for version
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6 h1:C1/pvkxkGN/H03mDxLzItaceYJDBk1HdClgR15suAzI=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200331160105-1181c3dc1bcd h1:ICQFQOSIOyt5n1RxOCAg1rq+DFLunpJpAK2ttjdGhUU=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200331160105-1181c3dc1bcd/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
Expand Down
2 changes: 1 addition & 1 deletion internal/namespaces/get_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
configNamespace "github.com/scaleway/scaleway-cli/internal/namespaces/config"
initNamespace "github.com/scaleway/scaleway-cli/internal/namespaces/init"
"github.com/scaleway/scaleway-cli/internal/namespaces/instance/v1"
k8s "github.com/scaleway/scaleway-cli/internal/namespaces/k8s/v1beta4"
k8s "github.com/scaleway/scaleway-cli/internal/namespaces/k8s/v1"
"github.com/scaleway/scaleway-cli/internal/namespaces/marketplace/v1"
versionNamespace "github.com/scaleway/scaleway-cli/internal/namespaces/version"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package k8s
import (
"github.com/scaleway/scaleway-cli/internal/core"
"github.com/scaleway/scaleway-cli/internal/human"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1beta4"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1"
)

// GetCommands returns cluster commands.
Expand All @@ -15,7 +15,6 @@ import (
func GetCommands() *core.Commands {
cmds := GetGeneratedCommands()
cmds.Merge(core.NewCommands(
k8sVersionGetCommand(),
k8sKubeconfigCommand(),
k8sKubeconfigGetCommand(),
k8sKubeconfigInstallCommand(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/fatih/color"
"github.com/scaleway/scaleway-cli/internal/core"
"github.com/scaleway/scaleway-cli/internal/human"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1beta4"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1"
"github.com/scaleway/scaleway-sdk-go/scw"
)

Expand All @@ -25,12 +25,11 @@ const (
// clusterStatusMarshalerFunc marshals a k8s.ClusterStatus.
var (
clusterStatusAttributes = human.Attributes{
k8s.ClusterStatusCreating: color.FgBlue,
k8s.ClusterStatusReady: color.FgGreen,
k8s.ClusterStatusError: color.FgRed,
k8s.ClusterStatusLocked: color.FgRed,
k8s.ClusterStatusUpdating: color.FgBlue,
k8s.ClusterStatusWarning: color.FgHiYellow,
k8s.ClusterStatusCreating: color.FgBlue,
k8s.ClusterStatusReady: color.FgGreen,
k8s.ClusterStatusPoolRequired: color.FgRed,
k8s.ClusterStatusLocked: color.FgRed,
k8s.ClusterStatusUpdating: color.FgBlue,
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"

"github.com/scaleway/scaleway-cli/internal/core"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1beta4"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1"
"github.com/scaleway/scaleway-sdk-go/scw"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/alecthomas/assert"
"github.com/scaleway/scaleway-cli/internal/core"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1beta4"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1"
)

func Test_GetKubeconfig(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"github.com/scaleway/scaleway-cli/internal/core"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1beta4"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1"
"gopkg.in/yaml.v2"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"reflect"

"github.com/scaleway/scaleway-cli/internal/core"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1beta4"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1"
"github.com/scaleway/scaleway-sdk-go/scw"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/alecthomas/assert"
"github.com/scaleway/scaleway-cli/internal/core"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1beta4"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1"
"gopkg.in/yaml.v2"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"

"github.com/scaleway/scaleway-cli/internal/core"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1beta4"
k8s "github.com/scaleway/scaleway-sdk-go/api/k8s/v1"
)

type k8sKubeconfigUninstallRequest struct {
Expand Down
Loading