-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add activation feature for CPU/Memory scaler
Signed-off-by: kunwooy <[email protected]>
- Loading branch information
Showing
42 changed files
with
6,951 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package k8s | ||
|
||
import ( | ||
"fmt" | ||
|
||
"k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1beta1" | ||
ctrl "sigs.k8s.io/controller-runtime" | ||
) | ||
|
||
var metricsClientLog = ctrl.Log.WithName("metricsclient") | ||
|
||
// InitPodMetricsClient initializes the client for pod metrics. It is used to fetch pod metrics from the metrics server. | ||
func InitPodMetricsClient(mgr ctrl.Manager) (v1beta1.PodMetricsesGetter, error) { | ||
clientset, err := v1beta1.NewForConfig(mgr.GetConfig()) | ||
if err != nil { | ||
metricsClientLog.Error(err, "not able to create metrics client") | ||
return nil, fmt.Errorf("failed to create metrics clientset: %w", err) | ||
} | ||
|
||
return clientset, nil | ||
} |
Oops, something went wrong.