Without this permission, you get the following error:
Failed to regenerate ASG cache: cannot autodiscover ASGs: AccessDenied: User: <arn> is not authorized to perform: autoscaling:DescribeTags because no identity-based policy allows the autoscaling:DescribeTags action.
This is also mentionned by AWS doc: https://docs.aws.amazon.com/eks/latest/userguide/autoscaling.html
Azure VMSS tags allowed character set isn't the exact same as the Kubernetes labels' character set.
In particular "/" aren't supported as VMSS tags, but are allowed for Kubernetes labels.
To support reflecting label values containing "/" to VMSS tags, the cluster-autoscaler evaluates underscores ("_") in VMSS tags keys as slashes ("/") in nodes labels keys.
But due to that substitution, a node label containing "_" (also a valid character for a k8s label) can't be reflected to VMSS tags (as it will be mis-read as a "/").
This PR takes inspiration from rfc6901's JSON escaping (rather hideous, but possibly familiar as it's used by kubectl-patch), by using ("~2") as a replacement for "_".
The tilde (~) character isn't allowed in k8s labels (and taints) keys so there's no possible ambiguities or regressions (a VMSS tag key having a ~ is currently evaluated to an impossible k8s label).
Labels and taints supported character sets:
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-sethttps://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#taint
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.
Reference: https://pkg.go.dev/testing#T.Setenv
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
implementation of kamatera autoscaler "glue code" based on linode
add more implementations + tests
finalized implementation + tests, need to do manual tests
finalize the implementation
manual testing
fixes and improvements with manual testing on Rancher
allow 0 size node group, update node provider id
update tests
add deployment example and documentation
add kamatera cloudprovider OWNERS file
commented user name in OWNERS
fix golint errors
fix gofmt
fix boilerplate error on example scripts
this change adds logic to create informers for the infrastructure
machine templates that are discovered during the scale from zero checks.
it also adds tests and a slight change to the controller structure to
account for the dynamic informer creation.