Skip to content

adds datacrunch provider #8351

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions cluster-autoscaler/cloudprovider/builder/builder_all.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import (
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/civo"
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/cloudstack"
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/clusterapi"
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/datacrunch"

"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/digitalocean"
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/equinixmetal"
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/exoscale"
Expand Down Expand Up @@ -65,6 +67,7 @@ var AvailableCloudProviders = []string{
cloudprovider.BaiducloudProviderName,
cloudprovider.MagnumProviderName,
cloudprovider.DigitalOceanProviderName,
cloudprovider.DatacrunchProviderName,
cloudprovider.ExoscaleProviderName,
cloudprovider.ExternalGrpcProviderName,
cloudprovider.HuaweicloudProviderName,
Expand Down Expand Up @@ -115,6 +118,8 @@ func buildCloudProvider(opts config.AutoscalingOptions,
return brightbox.BuildBrightbox(opts, do, rl)
case cloudprovider.DigitalOceanProviderName:
return digitalocean.BuildDigitalOcean(opts, do, rl)
case cloudprovider.DatacrunchProviderName:
return datacrunch.BuildDatacrunch(opts, do, rl)
case cloudprovider.ExoscaleProviderName:
return exoscale.BuildExoscale(opts, do, rl)
case cloudprovider.ExternalGrpcProviderName:
Expand Down
46 changes: 46 additions & 0 deletions cluster-autoscaler/cloudprovider/builder/builder_datacrunch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//go:build datacrunch
// +build datacrunch

/*
Copyright 2024 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package builder

import (
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider"
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/datacrunch"
"k8s.io/autoscaler/cluster-autoscaler/config"
)

// AvailableCloudProviders returns list of available cloud providers in this build.
func AvailableCloudProviders() []string {
return []string{cloudprovider.DatacrunchProviderName}
}

// DefaultCloudProvider returns the default cloud provider name.
func DefaultCloudProvider() string {
return cloudprovider.DatacrunchProviderName
}

// BuildCloudProvider builds the requested cloud provider implementation with
// the provided node group discovery options.
func BuildCloudProvider(cloudProvider string, opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider {
switch cloudProvider {
case cloudprovider.DatacrunchProviderName:
return datacrunch.BuildDatacrunch(opts, do, rl)
}
return nil
}
2 changes: 2 additions & 0 deletions cluster-autoscaler/cloudprovider/cloud_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ const (
ClusterAPIProviderName = "clusterapi"
// DigitalOceanProviderName gets the provider name of digitalocean
DigitalOceanProviderName = "digitalocean"
// DatacrunchProviderName gets the provider name of datacrunch
DatacrunchProviderName = "datacrunch"
// ExoscaleProviderName gets the provider name of exoscale
ExoscaleProviderName = "exoscale"
// GceProviderName gets the provider name of gce
Expand Down
Loading
Loading