Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(k8s): add new autoscaler flag and add kubelet_args #1566

Merged
merged 2 commits into from
Nov 30, 2020
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
82 changes: 42 additions & 40 deletions cmd/scw/testdata/test-all-usage-k8s-cluster-create-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,48 @@ EXAMPLES:
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:
[project-id] Project ID to use. If none is passed the default project ID will be used
name The name of the cluster
[description] The description of the cluster
[tags.{index}] The tags associated with the cluster
version The Kubernetes version of the cluster
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 | traefik2)
[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)
[autoscaler-config.expander] Type of node group expander to be used in scale up (unknown_expander | random | most_pods | least_waste | priority)
[autoscaler-config.ignore-daemonsets-utilization] Ignore DaemonSet pods when calculating resource utilization for scaling down
[autoscaler-config.balance-similar-node-groups] Detect similar node groups and balance the number of nodes between them
[autoscaler-config.expendable-pods-priority-cutoff] Pods with priority below cutoff will be expendable
[autoscaler-config.scale-down-unneeded-time] How long a node should be unneeded before it is eligible for scale down
[auto-upgrade.enable] Whether or not auto upgrade is enabled for the cluster
[auto-upgrade.maintenance-window.start-hour] The start hour of the 2-hour maintenance window
[auto-upgrade.maintenance-window.day] The day of the week for the maintenance window (any | monday | tuesday | wednesday | thursday | friday | saturday | sunday)
[feature-gates.{index}] List of feature gates to enable
[admission-plugins.{index}] List of admission plugins to enable
[open-id-connect-config.issuer-url] URL of the provider which allows the API server to discover public signing keys
[open-id-connect-config.client-id] A client id that all tokens must be issued for
[open-id-connect-config.username-claim] JWT claim to use as the user name
[open-id-connect-config.username-prefix] Prefix prepended to username
[open-id-connect-config.groups-claim.{index}] JWT claim to use as the user's group
[open-id-connect-config.groups-prefix] Prefix prepended to group claims
[open-id-connect-config.required-claim.{index}] Multiple key=value pairs that describes a required claim in the ID Token
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)
[project-id] Project ID to use. If none is passed the default project ID will be used
name The name of the cluster
[description] The description of the cluster
[tags.{index}] The tags associated with the cluster
version The Kubernetes version of the cluster
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 | traefik2)
[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
[pools.{index}.kubelet-args.{key}]
[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)
[autoscaler-config.expander] Type of node group expander to be used in scale up (unknown_expander | random | most_pods | least_waste | priority)
[autoscaler-config.ignore-daemonsets-utilization] Ignore DaemonSet pods when calculating resource utilization for scaling down
[autoscaler-config.balance-similar-node-groups] Detect similar node groups and balance the number of nodes between them
[autoscaler-config.expendable-pods-priority-cutoff] Pods with priority below cutoff will be expendable
[autoscaler-config.scale-down-unneeded-time] How long a node should be unneeded before it is eligible for scale down
[autoscaler-config.scale-down-utilization-threshold] Node utilization level, defined as sum of requested resources divided by capacity, below which a node can be considered for scale down
[auto-upgrade.enable] Whether or not auto upgrade is enabled for the cluster
[auto-upgrade.maintenance-window.start-hour] The start hour of the 2-hour maintenance window
[auto-upgrade.maintenance-window.day] The day of the week for the maintenance window (any | monday | tuesday | wednesday | thursday | friday | saturday | sunday)
[feature-gates.{index}] List of feature gates to enable
[admission-plugins.{index}] List of admission plugins to enable
[open-id-connect-config.issuer-url] URL of the provider which allows the API server to discover public signing keys
[open-id-connect-config.client-id] A client id that all tokens must be issued for
[open-id-connect-config.username-claim] JWT claim to use as the user name
[open-id-connect-config.username-prefix] Prefix prepended to username
[open-id-connect-config.groups-claim.{index}] JWT claim to use as the user's group
[open-id-connect-config.groups-prefix] Prefix prepended to group claims
[open-id-connect-config.required-claim.{index}] Multiple key=value pairs that describes a required claim in the ID Token
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)

FLAGS:
-h, --help help for create
Expand Down
55 changes: 28 additions & 27 deletions cmd/scw/testdata/test-all-usage-k8s-cluster-update-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,34 @@ EXAMPLES:
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
[name] The new name of the cluster
[description] The new description of the cluster
[tags.{index}] The new tags associated with the cluster
[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)
[autoscaler-config.expander] Type of node group expander to be used in scale up (unknown_expander | random | most_pods | least_waste | priority)
[autoscaler-config.ignore-daemonsets-utilization] Ignore DaemonSet pods when calculating resource utilization for scaling down
[autoscaler-config.balance-similar-node-groups] Detect similar node groups and balance the number of nodes between them
[autoscaler-config.expendable-pods-priority-cutoff] Pods with priority below cutoff will be expendable
[autoscaler-config.scale-down-unneeded-time] How long a node should be unneeded before it is eligible for scale down
[enable-dashboard] The new value of the Kubernetes Dashboard enablement
[ingress] The new Ingress Controller for the cluster (unknown_ingress | none | nginx | traefik | traefik2)
[auto-upgrade.enable] Whether or not auto upgrade is enabled for the cluster
[auto-upgrade.maintenance-window.start-hour] The start hour of the 2-hour maintenance window
[auto-upgrade.maintenance-window.day] The day of the week for the maintenance window (any | monday | tuesday | wednesday | thursday | friday | saturday | sunday)
[feature-gates.{index}] List of feature gates to enable
[admission-plugins.{index}] List of admission plugins to enable
[open-id-connect-config.issuer-url] URL of the provider which allows the API server to discover public signing keys
[open-id-connect-config.client-id] A client id that all tokens must be issued for
[open-id-connect-config.username-claim] JWT claim to use as the user name
[open-id-connect-config.username-prefix] Prefix prepended to username
[open-id-connect-config.groups-claim.{index}] JWT claim to use as the user's group
[open-id-connect-config.groups-prefix] Prefix prepended to group claims
[open-id-connect-config.required-claim.{index}] Multiple key=value pairs that describes a required claim in the ID Token
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)
cluster-id The ID of the cluster to update
[name] The new name of the cluster
[description] The new description of the cluster
[tags.{index}] The new tags associated with the cluster
[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)
[autoscaler-config.expander] Type of node group expander to be used in scale up (unknown_expander | random | most_pods | least_waste | priority)
[autoscaler-config.ignore-daemonsets-utilization] Ignore DaemonSet pods when calculating resource utilization for scaling down
[autoscaler-config.balance-similar-node-groups] Detect similar node groups and balance the number of nodes between them
[autoscaler-config.expendable-pods-priority-cutoff] Pods with priority below cutoff will be expendable
[autoscaler-config.scale-down-unneeded-time] How long a node should be unneeded before it is eligible for scale down
[autoscaler-config.scale-down-utilization-threshold] Node utilization level, defined as sum of requested resources divided by capacity, below which a node can be considered for scale down
[enable-dashboard] The new value of the Kubernetes Dashboard enablement
[ingress] The new Ingress Controller for the cluster (unknown_ingress | none | nginx | traefik | traefik2)
[auto-upgrade.enable] Whether or not auto upgrade is enabled for the cluster
[auto-upgrade.maintenance-window.start-hour] The start hour of the 2-hour maintenance window
[auto-upgrade.maintenance-window.day] The day of the week for the maintenance window (any | monday | tuesday | wednesday | thursday | friday | saturday | sunday)
[feature-gates.{index}] List of feature gates to enable
[admission-plugins.{index}] List of admission plugins to enable
[open-id-connect-config.issuer-url] URL of the provider which allows the API server to discover public signing keys
[open-id-connect-config.client-id] A client id that all tokens must be issued for
[open-id-connect-config.username-claim] JWT claim to use as the user name
[open-id-connect-config.username-prefix] Prefix prepended to username
[open-id-connect-config.groups-claim.{index}] JWT claim to use as the user's group
[open-id-connect-config.groups-prefix] Prefix prepended to group claims
[open-id-connect-config.required-claim.{index}] Multiple key=value pairs that describes a required claim in the ID Token
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)

FLAGS:
-h, --help help for update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ARGS:
[container-runtime] The container runtime for the nodes of the pool (unknown_runtime | docker | containerd | crio)
[autohealing] The enablement of the autohealing feature for the pool
[tags.{index}] The tags associated with the pool
[kubelet-args.{key}]
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)

FLAGS:
Expand Down
17 changes: 9 additions & 8 deletions cmd/scw/testdata/test-all-usage-k8s-pool-update-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ EXAMPLES:
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
[autoscaling] The new value for the enablement of autoscaling for the pool
[size] The new size for the pool
[min-size] The new minimun size for the pool
[max-size] The new maximum size for the pool
[autohealing] The new value for the enablement of autohealing for the pool
[tags.{index}] The new tags associated with the pool
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)
pool-id The ID of the pool to update
[autoscaling] The new value for the enablement of autoscaling for the pool
[size] The new size for the pool
[min-size] The new minimun size for the pool
[max-size] The new maximum size for the pool
[autohealing] The new value for the enablement of autohealing for the pool
[tags.{index}] The new tags associated with the pool
[kubelet-args.value.{key}]
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)

FLAGS:
-h, --help help for update
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/mattn/go-colorable v0.1.7
github.com/mattn/go-isatty v0.0.12
github.com/pkg/errors v0.9.1 // indirect
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20201117145121-3abc1efd92f7
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20201126140617-1ca79ea6cc5e
github.com/sergi/go-diff v1.1.0 // indirect
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20201117145121-3abc1efd92f7 h1:3C29wFZO2XQD+gRMDUED0pbu12dBC4TktQIzV7zmOnU=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20201117145121-3abc1efd92f7/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20201126140617-1ca79ea6cc5e h1:+KsMkDZ5rZV7REKlMCW5j3Lx+5OR/wRBtrQR6Soxv5E=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20201126140617-1ca79ea6cc5e/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
Expand Down
Loading