Skip to content

Commit c62867a

Browse files
committed
cloudprovider: init Utho cloud provider
1 parent 3e92831 commit c62867a

File tree

7 files changed

+99
-3
lines changed

7 files changed

+99
-3
lines changed

cluster-autoscaler/FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ The following startup parameters are supported for cluster autoscaler:
990990
| `check-capacity-provisioning-request-batch-timebox` | Maximum time to process a batch of provisioning requests. | 10s |
991991
| `check-capacity-provisioning-request-max-batch-size` | Maximum number of provisioning requests to process in a single batch. | 10 |
992992
| `cloud-config` | The path to the cloud provider configuration file. Empty string for no configuration file. | |
993-
| `cloud-provider` | Cloud provider type. Available values: [aws,azure,gce,alicloud,cherryservers,cloudstack,baiducloud,magnum,digitalocean,exoscale,externalgrpc,huaweicloud,hetzner,oci,ovhcloud,clusterapi,ionoscloud,kamatera,kwok,linode,bizflycloud,brightbox,equinixmetal,vultr,tencentcloud,civo,scaleway,rancher,volcengine] | "gce" |
993+
| `cloud-provider` | Cloud provider type. Available values: [aws,azure,gce,alicloud,cherryservers,cloudstack,baiducloud,magnum,digitalocean,exoscale,externalgrpc,huaweicloud,hetzner,oci,ovhcloud,clusterapi,ionoscloud,kamatera,kwok,linode,bizflycloud,brightbox,equinixmetal,vultr,tencentcloud,civo,scaleway,rancher,volcengine,utho] | "gce" |
994994
| `cloud-provider-gce-l7lb-src-cidrs` | CIDRs opened in GCE firewall for L7 LB traffic proxy & health checks | 130.211.0.0/22,35.191.0.0/16 |
995995
| `cloud-provider-gce-lb-src-cidrs` | CIDRs opened in GCE firewall for L4 LB traffic proxy & health checks | 130.211.0.0/22,209.85.152.0/22,209.85.204.0/22,35.191.0.0/16 |
996996
| `cluster-name` | Autoscaled cluster name, if available | |

cluster-autoscaler/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ You should also take a look at the notes and "gotchas" for your specific cloud p
4040
* [Scaleway](./cloudprovider/scaleway/README.md)
4141
* [TencentCloud](./cloudprovider/tencentcloud/README.md)
4242
* [Vultr](./cloudprovider/vultr/README.md)
43+
* [Utho](./cloudprovider/utho/README.md)
4344

4445
# Releases
4546

@@ -224,3 +225,4 @@ Supported cloud providers:
224225
* Scaleway https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/scaleway/README.md
225226
* TencentCloud https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/tencentcloud/README.md
226227
* Vultr https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/vultr/README.md
228+
* Utho https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/utho/README.md

cluster-autoscaler/cloudprovider/builder/builder_all.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//go:build !gce && !aws && !azure && !kubemark && !alicloud && !magnum && !digitalocean && !clusterapi && !huaweicloud && !ionoscloud && !linode && !hetzner && !bizflycloud && !brightbox && !equinixmetal && !oci && !vultr && !tencentcloud && !scaleway && !externalgrpc && !civo && !rancher && !volcengine && !baiducloud && !cherry && !cloudstack && !exoscale && !kamatera && !ovhcloud && !kwok
2-
// +build !gce,!aws,!azure,!kubemark,!alicloud,!magnum,!digitalocean,!clusterapi,!huaweicloud,!ionoscloud,!linode,!hetzner,!bizflycloud,!brightbox,!equinixmetal,!oci,!vultr,!tencentcloud,!scaleway,!externalgrpc,!civo,!rancher,!volcengine,!baiducloud,!cherry,!cloudstack,!exoscale,!kamatera,!ovhcloud,!kwok
1+
//go:build !gce && !aws && !azure && !kubemark && !alicloud && !magnum && !digitalocean && !clusterapi && !huaweicloud && !ionoscloud && !linode && !hetzner && !bizflycloud && !brightbox && !equinixmetal && !oci && !vultr && !tencentcloud && !scaleway && !externalgrpc && !civo && !rancher && !volcengine && !baiducloud && !cherry && !cloudstack && !exoscale && !kamatera && !ovhcloud && !kwok && !utho
2+
// +build !gce,!aws,!azure,!kubemark,!alicloud,!magnum,!digitalocean,!clusterapi,!huaweicloud,!ionoscloud,!linode,!hetzner,!bizflycloud,!brightbox,!equinixmetal,!oci,!vultr,!tencentcloud,!scaleway,!externalgrpc,!civo,!rancher,!volcengine,!baiducloud,!cherry,!cloudstack,!exoscale,!kamatera,!ovhcloud,!kwok,!utho
33

44
/*
55
Copyright 2018 The Kubernetes Authors.
@@ -48,6 +48,7 @@ import (
4848
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/rancher"
4949
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/scaleway"
5050
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud"
51+
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/utho"
5152
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine"
5253
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/vultr"
5354
"k8s.io/autoscaler/cluster-autoscaler/config"
@@ -85,6 +86,7 @@ var AvailableCloudProviders = []string{
8586
cloudprovider.ScalewayProviderName,
8687
cloudprovider.RancherProviderName,
8788
cloudprovider.VolcengineProviderName,
89+
cloudprovider.UthoProviderName,
8890
}
8991

9092
// DefaultCloudProvider is GCE.
@@ -153,6 +155,8 @@ func buildCloudProvider(opts config.AutoscalingOptions,
153155
return rancher.BuildRancher(opts, do, rl)
154156
case cloudprovider.VolcengineProviderName:
155157
return volcengine.BuildVolcengine(opts, do, rl)
158+
case cloudprovider.UthoProviderName:
159+
return utho.BuildUtho(opts, do, rl)
156160
}
157161
return nil
158162
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//go:build utho
2+
// +build utho
3+
4+
/*
5+
Copyright 2022 The Kubernetes Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
*/
19+
20+
package builder
21+
22+
import (
23+
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider"
24+
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/utho"
25+
"k8s.io/autoscaler/cluster-autoscaler/config"
26+
"k8s.io/client-go/informers"
27+
)
28+
29+
// AvailableCloudProviders supported by the cloud provider builder.
30+
var AvailableCloudProviders = []string{
31+
cloudprovider.UthoProviderName,
32+
}
33+
34+
// DefaultCloudProvider for utho-only build is utho.
35+
const DefaultCloudProvider = cloudprovider.UthoProviderName
36+
37+
func buildCloudProvider(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter, _ informers.SharedInformerFactory) cloudprovider.CloudProvider {
38+
switch opts.CloudProviderName {
39+
case cloudprovider.UthoProviderName:
40+
return utho.BuildUtho(opts, do, rl)
41+
}
42+
43+
return nil
44+
}

cluster-autoscaler/cloudprovider/cloud_provider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ const (
9090
CivoProviderName = "civo"
9191
// RancherProviderName gets the provider name of rancher
9292
RancherProviderName = "rancher"
93+
// UthoProviderName gets the provider name of utho
94+
UthoProviderName = "utho"
9395
)
9496

9597
// GpuConfig contains the label, type and the resource name for a GPU.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
approvers:
2+
- uthoplatforms
3+
- m-kased
4+
reviewers:
5+
- uthoplatforms
6+
- m-kased
7+
labels:
8+
- area/provider/utho
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Cluster Autoscaler for Utho
2+
3+
The cluster autoscaler for Utho scales nodes in a Utho Kubernetes cluster.
4+
5+
## Utho Kubernetes Engine
6+
7+
Utho Kubernetes Engine https://utho.com/kubernetes is the managed kubernetes solution provided by Utho.
8+
9+
Utho Kubernetes lets users create Node Pools, i.e. groups of nodes each of the same type.
10+
11+
The size of a Node Pool can be configured at any moment. The user cannot select specific nodes to be deleted when downsizing a Node Pool, rather, Utho Kubernetes will randomly select nodes to be deleted to reach the defined size, even if a node is not healthy or has been manually deleted.
12+
13+
Nodes in a Node Pool are considered disposable: they can be deleted and recreated at any moment, deleting a single node outside of Utho Kubernetes will be recreated by Utho after a small amount of time.
14+
15+
## Configuration
16+
17+
It is mandatory to define the cloud configuration file `cloud-config`. You can see an example of the cloud config file at [examples/cluster-autoscaler-secret.yaml](examples/cluster-autoscaler-secret.yaml), it is an INI file with the following fields:
18+
19+
The (JSON) configuration file of the Utho cloud provider supports the following values:
20+
21+
- `cluster_id`: the ID of the Utho Kubernetes cluster.
22+
- `token`: the Utho API key literally defined.
23+
24+
25+
Configuring the autoscaler such as if it should be monitoring node pools or what the minimum and maximum values. Should be configured through the [Utho API](https://utho.com/api-docs/#api-Kubernetes).
26+
The autoscaler will pick up any changes and adjust accordingly.
27+
28+
## Development
29+
30+
Make sure you are inside the `cluster-autoscaler` path of the [autoscaler repository](https://github.com/kubernetes/autoscaler).
31+
32+
Create the docker image:
33+
```
34+
make container
35+
```
36+
tag the generated docker image and push it to a registry.

0 commit comments

Comments
 (0)