mirror of
https://github.com/rancher/rke.git
synced 2025-09-15 22:49:13 +00:00
add the parsing for eventRateLimit
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
eventratelimitapi "k8s.io/kubernetes/plugin/pkg/admission/eventratelimit/apis/eventratelimit"
|
||||
"strings"
|
||||
|
||||
"github.com/blang/semver"
|
||||
@@ -242,7 +243,7 @@ func (c *Cluster) setClusterDefaults(ctx context.Context, flags ExternalFlags) e
|
||||
if len(c.Monitoring.Provider) == 0 {
|
||||
c.Monitoring.Provider = DefaultMonitoringProvider
|
||||
}
|
||||
//set docker private registry URL
|
||||
// set docker private registry URL
|
||||
for _, pr := range c.PrivateRegistries {
|
||||
if pr.URL == "" {
|
||||
pr.URL = docker.DockerRegistryURL
|
||||
@@ -298,7 +299,7 @@ func (c *Cluster) setNodeUpgradeStrategy() {
|
||||
IgnoreDaemonSets: &DefaultNodeDrainIgnoreDaemonsets,
|
||||
// default to 120 seems to work better for controlplane nodes
|
||||
Timeout: DefaultNodeDrainTimeout,
|
||||
//Period of time in seconds given to each pod to terminate gracefully.
|
||||
// Period of time in seconds given to each pod to terminate gracefully.
|
||||
// If negative, the default value specified in the pod will be used
|
||||
GracePeriod: DefaultNodeDrainGracePeriod,
|
||||
}
|
||||
@@ -437,7 +438,7 @@ func newDefaultAuditLogConfig() *v3.AuditLogConfig {
|
||||
return c
|
||||
}
|
||||
|
||||
func getEventRateLimitPluginFromConfig(c *v3.Configuration) (apiserverv1.AdmissionPluginConfiguration, error) {
|
||||
func getEventRateLimitPluginFromConfig(c *eventratelimitapi.Configuration) (apiserverv1.AdmissionPluginConfiguration, error) {
|
||||
plugin := apiserverv1.AdmissionPluginConfiguration{
|
||||
Name: EventRateLimitPluginName,
|
||||
Configuration: &runtime.Unknown{
|
||||
@@ -454,15 +455,15 @@ func getEventRateLimitPluginFromConfig(c *v3.Configuration) (apiserverv1.Admissi
|
||||
return plugin, nil
|
||||
}
|
||||
|
||||
func newDefaultEventRateLimitConfig() *v3.Configuration {
|
||||
return &v3.Configuration{
|
||||
func newDefaultEventRateLimitConfig() *eventratelimitapi.Configuration {
|
||||
return &eventratelimitapi.Configuration{
|
||||
TypeMeta: v1.TypeMeta{
|
||||
Kind: "Configuration",
|
||||
APIVersion: "eventratelimit.admission.k8s.io/v1alpha1",
|
||||
},
|
||||
Limits: []v3.Limit{
|
||||
Limits: []eventratelimitapi.Limit{
|
||||
{
|
||||
Type: v3.ServerLimitType,
|
||||
Type: eventratelimitapi.ServerLimitType,
|
||||
QPS: 5000,
|
||||
Burst: 20000,
|
||||
},
|
||||
|
Reference in New Issue
Block a user