Skip to content

Commit c3208e9

Browse files
maaftmaaft
authored andcommitted
adds datacrunch provider
1 parent 9a256e5 commit c3208e9

23 files changed

+3869
-0
lines changed

cluster-autoscaler/cloudprovider/builder/builder_all.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ import (
3131
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/civo"
3232
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/cloudstack"
3333
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/clusterapi"
34+
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/datacrunch"
35+
3436
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/digitalocean"
3537
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/equinixmetal"
3638
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/exoscale"
@@ -65,6 +67,7 @@ var AvailableCloudProviders = []string{
6567
cloudprovider.BaiducloudProviderName,
6668
cloudprovider.MagnumProviderName,
6769
cloudprovider.DigitalOceanProviderName,
70+
cloudprovider.DatacrunchProviderName,
6871
cloudprovider.ExoscaleProviderName,
6972
cloudprovider.ExternalGrpcProviderName,
7073
cloudprovider.HuaweicloudProviderName,
@@ -115,6 +118,8 @@ func buildCloudProvider(opts config.AutoscalingOptions,
115118
return brightbox.BuildBrightbox(opts, do, rl)
116119
case cloudprovider.DigitalOceanProviderName:
117120
return digitalocean.BuildDigitalOcean(opts, do, rl)
121+
case cloudprovider.DatacrunchProviderName:
122+
return datacrunch.BuildDatacrunch(opts, do, rl)
118123
case cloudprovider.ExoscaleProviderName:
119124
return exoscale.BuildExoscale(opts, do, rl)
120125
case cloudprovider.ExternalGrpcProviderName:
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//go:build datacrunch
2+
// +build datacrunch
3+
4+
/*
5+
Copyright 2024 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/datacrunch"
25+
"k8s.io/autoscaler/cluster-autoscaler/config"
26+
)
27+
28+
// AvailableCloudProviders returns list of available cloud providers in this build.
29+
func AvailableCloudProviders() []string {
30+
return []string{cloudprovider.DatacrunchProviderName}
31+
}
32+
33+
// DefaultCloudProvider returns the default cloud provider name.
34+
func DefaultCloudProvider() string {
35+
return cloudprovider.DatacrunchProviderName
36+
}
37+
38+
// BuildCloudProvider builds the requested cloud provider implementation with
39+
// the provided node group discovery options.
40+
func BuildCloudProvider(cloudProvider string, opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider {
41+
switch cloudProvider {
42+
case cloudprovider.DatacrunchProviderName:
43+
return datacrunch.BuildDatacrunch(opts, do, rl)
44+
}
45+
return nil
46+
}

cluster-autoscaler/cloudprovider/cloud_provider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ const (
4848
ClusterAPIProviderName = "clusterapi"
4949
// DigitalOceanProviderName gets the provider name of digitalocean
5050
DigitalOceanProviderName = "digitalocean"
51+
// DatacrunchProviderName gets the provider name of datacrunch
52+
DatacrunchProviderName = "datacrunch"
5153
// ExoscaleProviderName gets the provider name of exoscale
5254
ExoscaleProviderName = "exoscale"
5355
// GceProviderName gets the provider name of gce

0 commit comments

Comments
 (0)