mirror of https://github.com/kubernetes/kops.git
Merge pull request #7487 from tioxy/add_event_ttl_flag
Add event ttl flag
This commit is contained in:
commit
c8d9c707b0
|
|
@ -944,6 +944,9 @@ spec:
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
|
eventTTL:
|
||||||
|
description: Amount of time to retain Kubernetes events
|
||||||
|
type: string
|
||||||
experimentalEncryptionProviderConfig:
|
experimentalEncryptionProviderConfig:
|
||||||
description: ExperimentalEncryptionProviderConfig enables encryption
|
description: ExperimentalEncryptionProviderConfig enables encryption
|
||||||
at rest for secrets.
|
at rest for secrets.
|
||||||
|
|
|
||||||
|
|
@ -450,6 +450,9 @@ type KubeAPIServerConfig struct {
|
||||||
|
|
||||||
// CPURequest, cpu request compute resource for api server. Defaults to "150m"
|
// CPURequest, cpu request compute resource for api server. Defaults to "150m"
|
||||||
CPURequest string `json:"cpuRequest,omitempty"`
|
CPURequest string `json:"cpuRequest,omitempty"`
|
||||||
|
|
||||||
|
// Amount of time to retain Kubernetes events
|
||||||
|
EventTTL *metav1.Duration `json:"eventTTL,omitempty" flag:"event-ttl"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// KubeControllerManagerConfig is the configuration for the controller
|
// KubeControllerManagerConfig is the configuration for the controller
|
||||||
|
|
|
||||||
|
|
@ -450,6 +450,9 @@ type KubeAPIServerConfig struct {
|
||||||
|
|
||||||
// CPURequest, cpu request compute resource for api server. Defaults to "150m"
|
// CPURequest, cpu request compute resource for api server. Defaults to "150m"
|
||||||
CPURequest string `json:"cpuRequest,omitempty"`
|
CPURequest string `json:"cpuRequest,omitempty"`
|
||||||
|
|
||||||
|
// Amount of time to retain Kubernetes events
|
||||||
|
EventTTL *metav1.Duration `json:"eventTTL,omitempty" flag:"event-ttl"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// KubeControllerManagerConfig is the configuration for the controller
|
// KubeControllerManagerConfig is the configuration for the controller
|
||||||
|
|
|
||||||
|
|
@ -3231,6 +3231,7 @@ func autoConvert_v1alpha1_KubeAPIServerConfig_To_kops_KubeAPIServerConfig(in *Ku
|
||||||
out.ServiceAccountIssuer = in.ServiceAccountIssuer
|
out.ServiceAccountIssuer = in.ServiceAccountIssuer
|
||||||
out.APIAudiences = in.APIAudiences
|
out.APIAudiences = in.APIAudiences
|
||||||
out.CPURequest = in.CPURequest
|
out.CPURequest = in.CPURequest
|
||||||
|
out.EventTTL = in.EventTTL
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3328,6 +3329,7 @@ func autoConvert_kops_KubeAPIServerConfig_To_v1alpha1_KubeAPIServerConfig(in *ko
|
||||||
out.ServiceAccountIssuer = in.ServiceAccountIssuer
|
out.ServiceAccountIssuer = in.ServiceAccountIssuer
|
||||||
out.APIAudiences = in.APIAudiences
|
out.APIAudiences = in.APIAudiences
|
||||||
out.CPURequest = in.CPURequest
|
out.CPURequest = in.CPURequest
|
||||||
|
out.EventTTL = in.EventTTL
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2004,6 +2004,11 @@ func (in *KubeAPIServerConfig) DeepCopyInto(out *KubeAPIServerConfig) {
|
||||||
*out = make([]string, len(*in))
|
*out = make([]string, len(*in))
|
||||||
copy(*out, *in)
|
copy(*out, *in)
|
||||||
}
|
}
|
||||||
|
if in.EventTTL != nil {
|
||||||
|
in, out := &in.EventTTL, &out.EventTTL
|
||||||
|
*out = new(v1.Duration)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -450,6 +450,9 @@ type KubeAPIServerConfig struct {
|
||||||
|
|
||||||
// CPURequest, cpu request compute resource for api server. Defaults to "150m"
|
// CPURequest, cpu request compute resource for api server. Defaults to "150m"
|
||||||
CPURequest string `json:"cpuRequest,omitempty"`
|
CPURequest string `json:"cpuRequest,omitempty"`
|
||||||
|
|
||||||
|
// Amount of time to retain Kubernetes events
|
||||||
|
EventTTL *metav1.Duration `json:"eventTTL,omitempty" flag:"event-ttl"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// KubeControllerManagerConfig is the configuration for the controller
|
// KubeControllerManagerConfig is the configuration for the controller
|
||||||
|
|
|
||||||
|
|
@ -3501,6 +3501,7 @@ func autoConvert_v1alpha2_KubeAPIServerConfig_To_kops_KubeAPIServerConfig(in *Ku
|
||||||
out.ServiceAccountIssuer = in.ServiceAccountIssuer
|
out.ServiceAccountIssuer = in.ServiceAccountIssuer
|
||||||
out.APIAudiences = in.APIAudiences
|
out.APIAudiences = in.APIAudiences
|
||||||
out.CPURequest = in.CPURequest
|
out.CPURequest = in.CPURequest
|
||||||
|
out.EventTTL = in.EventTTL
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3598,6 +3599,7 @@ func autoConvert_kops_KubeAPIServerConfig_To_v1alpha2_KubeAPIServerConfig(in *ko
|
||||||
out.ServiceAccountIssuer = in.ServiceAccountIssuer
|
out.ServiceAccountIssuer = in.ServiceAccountIssuer
|
||||||
out.APIAudiences = in.APIAudiences
|
out.APIAudiences = in.APIAudiences
|
||||||
out.CPURequest = in.CPURequest
|
out.CPURequest = in.CPURequest
|
||||||
|
out.EventTTL = in.EventTTL
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2075,6 +2075,11 @@ func (in *KubeAPIServerConfig) DeepCopyInto(out *KubeAPIServerConfig) {
|
||||||
*out = make([]string, len(*in))
|
*out = make([]string, len(*in))
|
||||||
copy(*out, *in)
|
copy(*out, *in)
|
||||||
}
|
}
|
||||||
|
if in.EventTTL != nil {
|
||||||
|
in, out := &in.EventTTL, &out.EventTTL
|
||||||
|
*out = new(v1.Duration)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2257,6 +2257,11 @@ func (in *KubeAPIServerConfig) DeepCopyInto(out *KubeAPIServerConfig) {
|
||||||
*out = make([]string, len(*in))
|
*out = make([]string, len(*in))
|
||||||
copy(*out, *in)
|
copy(*out, *in)
|
||||||
}
|
}
|
||||||
|
if in.EventTTL != nil {
|
||||||
|
in, out := &in.EventTTL, &out.EventTTL
|
||||||
|
*out = new(v1.Duration)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -220,6 +220,12 @@ func TestBuildAPIServerFlags(t *testing.T) {
|
||||||
},
|
},
|
||||||
Expected: "--authorization-webhook-cache-unauthorized-ttl=10s --insecure-port=0 --secure-port=0",
|
Expected: "--authorization-webhook-cache-unauthorized-ttl=10s --insecure-port=0 --secure-port=0",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Config: &kops.KubeAPIServerConfig{
|
||||||
|
EventTTL: &metav1.Duration{Duration: 3 * time.Hour},
|
||||||
|
},
|
||||||
|
Expected: "--event-ttl=3h0m0s --insecure-port=0 --secure-port=0",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range grid {
|
for _, test := range grid {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue