mirror of
https://github.com/outbackdingo/kubernetes.git
synced 2026-01-27 10:19:35 +00:00
Merge pull request #132341 from dashpole/graduate_kubelet_tracing
Promote KubeletTracing featuregate to GA
This commit is contained in:
@@ -1404,73 +1404,6 @@
|
||||
],
|
||||
"version": "v1"
|
||||
},
|
||||
{
|
||||
"freshness": "Current",
|
||||
"resources": [
|
||||
{
|
||||
"categories": [
|
||||
"api-extensions"
|
||||
],
|
||||
"resource": "validatingadmissionpolicies",
|
||||
"responseKind": {
|
||||
"group": "",
|
||||
"kind": "ValidatingAdmissionPolicy",
|
||||
"version": ""
|
||||
},
|
||||
"scope": "Cluster",
|
||||
"singularResource": "validatingadmissionpolicy",
|
||||
"subresources": [
|
||||
{
|
||||
"responseKind": {
|
||||
"group": "",
|
||||
"kind": "ValidatingAdmissionPolicy",
|
||||
"version": ""
|
||||
},
|
||||
"subresource": "status",
|
||||
"verbs": [
|
||||
"get",
|
||||
"patch",
|
||||
"update"
|
||||
]
|
||||
}
|
||||
],
|
||||
"verbs": [
|
||||
"create",
|
||||
"delete",
|
||||
"deletecollection",
|
||||
"get",
|
||||
"list",
|
||||
"patch",
|
||||
"update",
|
||||
"watch"
|
||||
]
|
||||
},
|
||||
{
|
||||
"categories": [
|
||||
"api-extensions"
|
||||
],
|
||||
"resource": "validatingadmissionpolicybindings",
|
||||
"responseKind": {
|
||||
"group": "",
|
||||
"kind": "ValidatingAdmissionPolicyBinding",
|
||||
"version": ""
|
||||
},
|
||||
"scope": "Cluster",
|
||||
"singularResource": "validatingadmissionpolicybinding",
|
||||
"verbs": [
|
||||
"create",
|
||||
"delete",
|
||||
"deletecollection",
|
||||
"get",
|
||||
"list",
|
||||
"patch",
|
||||
"update",
|
||||
"watch"
|
||||
]
|
||||
}
|
||||
],
|
||||
"version": "v1beta1"
|
||||
},
|
||||
{
|
||||
"freshness": "Current",
|
||||
"resources": [
|
||||
|
||||
@@ -192,10 +192,6 @@
|
||||
"groupVersion": "admissionregistration.k8s.io/v1",
|
||||
"version": "v1"
|
||||
},
|
||||
{
|
||||
"groupVersion": "admissionregistration.k8s.io/v1beta1",
|
||||
"version": "v1beta1"
|
||||
},
|
||||
{
|
||||
"groupVersion": "admissionregistration.k8s.io/v1alpha1",
|
||||
"version": "v1alpha1"
|
||||
|
||||
@@ -11,10 +11,6 @@
|
||||
"groupVersion": "admissionregistration.k8s.io/v1",
|
||||
"version": "v1"
|
||||
},
|
||||
{
|
||||
"groupVersion": "admissionregistration.k8s.io/v1beta1",
|
||||
"version": "v1beta1"
|
||||
},
|
||||
{
|
||||
"groupVersion": "admissionregistration.k8s.io/v1alpha1",
|
||||
"version": "v1alpha1"
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
{
|
||||
"apiVersion": "v1",
|
||||
"groupVersion": "admissionregistration.k8s.io/v1beta1",
|
||||
"kind": "APIResourceList",
|
||||
"resources": [
|
||||
{
|
||||
"categories": [
|
||||
"api-extensions"
|
||||
],
|
||||
"kind": "ValidatingAdmissionPolicy",
|
||||
"name": "validatingadmissionpolicies",
|
||||
"namespaced": false,
|
||||
"singularName": "validatingadmissionpolicy",
|
||||
"storageVersionHash": "6OxvlMmQ6is=",
|
||||
"verbs": [
|
||||
"create",
|
||||
"delete",
|
||||
"deletecollection",
|
||||
"get",
|
||||
"list",
|
||||
"patch",
|
||||
"update",
|
||||
"watch"
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "ValidatingAdmissionPolicy",
|
||||
"name": "validatingadmissionpolicies/status",
|
||||
"namespaced": false,
|
||||
"singularName": "",
|
||||
"verbs": [
|
||||
"get",
|
||||
"patch",
|
||||
"update"
|
||||
]
|
||||
},
|
||||
{
|
||||
"categories": [
|
||||
"api-extensions"
|
||||
],
|
||||
"kind": "ValidatingAdmissionPolicyBinding",
|
||||
"name": "validatingadmissionpolicybindings",
|
||||
"namespaced": false,
|
||||
"singularName": "validatingadmissionpolicybinding",
|
||||
"storageVersionHash": "v9715VZqakg=",
|
||||
"verbs": [
|
||||
"create",
|
||||
"delete",
|
||||
"deletecollection",
|
||||
"get",
|
||||
"list",
|
||||
"patch",
|
||||
"update",
|
||||
"watch"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
2014
api/openapi-spec/swagger.json
generated
2014
api/openapi-spec/swagger.json
generated
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -494,13 +494,9 @@ func UnsecuredDependencies(s *options.KubeletServer, featureGate featuregate.Fea
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var tp oteltrace.TracerProvider
|
||||
tp = noopoteltrace.NewTracerProvider()
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.KubeletTracing) {
|
||||
tp, err = newTracerProvider(s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tp, err := newTracerProvider(s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &kubelet.Dependencies{
|
||||
Auth: nil, // default does not enforce auth[nz]
|
||||
@@ -1048,9 +1044,7 @@ func buildKubeletClientConfig(ctx context.Context, s *options.KubeletServer, tp
|
||||
utilnet.CloseIdleConnectionsFor(clientConfig.Transport)
|
||||
}
|
||||
}
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.KubeletTracing) {
|
||||
clientConfig.Wrap(tracing.WrapperFor(tp))
|
||||
}
|
||||
clientConfig.Wrap(tracing.WrapperFor(tp))
|
||||
return clientConfig, onHeartbeatFailure, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1324,6 +1324,7 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
|
||||
KubeletTracing: {
|
||||
{Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha},
|
||||
{Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta},
|
||||
{Version: version.MustParse("1.34"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.37
|
||||
},
|
||||
|
||||
LegacySidecarContainers: {
|
||||
|
||||
@@ -503,7 +503,6 @@ type KubeletConfiguration struct {
|
||||
|
||||
// Tracing specifies the versioned configuration for OpenTelemetry tracing clients.
|
||||
// See https://kep.k8s.io/2832 for more details.
|
||||
// +featureGate=KubeletTracing
|
||||
// +optional
|
||||
Tracing *tracingapi.TracingConfiguration
|
||||
|
||||
|
||||
@@ -334,12 +334,8 @@ func ValidateKubeletConfiguration(kc *kubeletconfig.KubeletConfiguration, featur
|
||||
allErrors = append(allErrors, errs.ToAggregate().Errors()...)
|
||||
}
|
||||
|
||||
if localFeatureGate.Enabled(features.KubeletTracing) {
|
||||
if errs := tracingapi.ValidateTracingConfiguration(kc.Tracing, localFeatureGate, field.NewPath("tracing")); len(errs) > 0 {
|
||||
allErrors = append(allErrors, errs.ToAggregate().Errors()...)
|
||||
}
|
||||
} else if kc.Tracing != nil {
|
||||
allErrors = append(allErrors, fmt.Errorf("invalid configuration: tracing should not be configured if KubeletTracing feature flag is disabled."))
|
||||
if errs := tracingapi.ValidateTracingConfiguration(kc.Tracing, localFeatureGate, field.NewPath("tracing")); len(errs) > 0 {
|
||||
allErrors = append(allErrors, errs.ToAggregate().Errors()...)
|
||||
}
|
||||
|
||||
if localFeatureGate.Enabled(features.MemoryQoS) && kc.MemoryThrottlingFactor == nil {
|
||||
|
||||
@@ -568,20 +568,10 @@ func TestValidateKubeletConfiguration(t *testing.T) {
|
||||
return conf
|
||||
},
|
||||
errMsg: "invalid configuration: taint.TimeAdded is not nil",
|
||||
}, {
|
||||
name: "specify tracing with KubeletTracing disabled",
|
||||
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
||||
samplingRate := int32(99999)
|
||||
conf.FeatureGates = map[string]bool{"KubeletTracing": false}
|
||||
conf.Tracing = &tracingapi.TracingConfiguration{SamplingRatePerMillion: &samplingRate}
|
||||
return conf
|
||||
},
|
||||
errMsg: "invalid configuration: tracing should not be configured if KubeletTracing feature flag is disabled.",
|
||||
}, {
|
||||
name: "specify tracing invalid sampling rate",
|
||||
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
||||
samplingRate := int32(-1)
|
||||
conf.FeatureGates = map[string]bool{"KubeletTracing": true}
|
||||
conf.Tracing = &tracingapi.TracingConfiguration{SamplingRatePerMillion: &samplingRate}
|
||||
return conf
|
||||
},
|
||||
@@ -590,7 +580,6 @@ func TestValidateKubeletConfiguration(t *testing.T) {
|
||||
name: "specify tracing invalid endpoint",
|
||||
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
||||
ep := "dn%2s://localhost:4317"
|
||||
conf.FeatureGates = map[string]bool{"KubeletTracing": true}
|
||||
conf.Tracing = &tracingapi.TracingConfiguration{Endpoint: &ep}
|
||||
return conf
|
||||
},
|
||||
|
||||
@@ -391,17 +391,11 @@ func PreInitRuntimeService(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
||||
remoteImageEndpoint = kubeCfg.ContainerRuntimeEndpoint
|
||||
}
|
||||
var err error
|
||||
|
||||
var tp trace.TracerProvider
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.KubeletTracing) {
|
||||
tp = kubeDeps.TracerProvider
|
||||
}
|
||||
|
||||
logger := klog.Background()
|
||||
if kubeDeps.RemoteRuntimeService, err = remote.NewRemoteRuntimeService(kubeCfg.ContainerRuntimeEndpoint, kubeCfg.RuntimeRequestTimeout.Duration, tp, &logger); err != nil {
|
||||
if kubeDeps.RemoteRuntimeService, err = remote.NewRemoteRuntimeService(kubeCfg.ContainerRuntimeEndpoint, kubeCfg.RuntimeRequestTimeout.Duration, kubeDeps.TracerProvider, &logger); err != nil {
|
||||
return err
|
||||
}
|
||||
if kubeDeps.RemoteImageService, err = remote.NewRemoteImageService(remoteImageEndpoint, kubeCfg.RuntimeRequestTimeout.Duration, tp, &logger); err != nil {
|
||||
if kubeDeps.RemoteImageService, err = remote.NewRemoteImageService(remoteImageEndpoint, kubeCfg.RuntimeRequestTimeout.Duration, kubeDeps.TracerProvider, &logger); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -179,10 +179,7 @@ func ListenAndServeKubeletServer(
|
||||
port := uint(kubeCfg.Port)
|
||||
klog.InfoS("Starting to listen", "address", address, "port", port)
|
||||
handler := NewServer(host, resourceAnalyzer, checkers, flagz, auth, kubeCfg)
|
||||
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.KubeletTracing) {
|
||||
handler.InstallTracingFilter(tp)
|
||||
}
|
||||
handler.InstallTracingFilter(tp)
|
||||
|
||||
s := &http.Server{
|
||||
Addr: net.JoinHostPort(address.String(), strconv.FormatUint(uint64(port), 10)),
|
||||
@@ -219,10 +216,7 @@ func ListenAndServeKubeletReadOnlyServer(
|
||||
tp oteltrace.TracerProvider) {
|
||||
klog.InfoS("Starting to listen read-only", "address", address, "port", port)
|
||||
s := NewServer(host, resourceAnalyzer, checkers, nil, nil, nil)
|
||||
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.KubeletTracing) {
|
||||
s.InstallTracingFilter(tp, otelrestful.WithPublicEndpoint())
|
||||
}
|
||||
s.InstallTracingFilter(tp, otelrestful.WithPublicEndpoint())
|
||||
|
||||
server := &http.Server{
|
||||
Addr: net.JoinHostPort(address.String(), strconv.FormatUint(uint64(port), 10)),
|
||||
|
||||
@@ -888,7 +888,6 @@ type KubeletConfiguration struct {
|
||||
// Tracing specifies the versioned configuration for OpenTelemetry tracing clients.
|
||||
// See https://kep.k8s.io/2832 for more details.
|
||||
// Default: nil
|
||||
// +featureGate=KubeletTracing
|
||||
// +optional
|
||||
Tracing *tracingapi.TracingConfiguration `json:"tracing,omitempty"`
|
||||
|
||||
|
||||
@@ -789,6 +789,10 @@
|
||||
lockToDefault: false
|
||||
preRelease: Beta
|
||||
version: "1.27"
|
||||
- default: true
|
||||
lockToDefault: true
|
||||
preRelease: GA
|
||||
version: "1.34"
|
||||
- name: LegacySidecarContainers
|
||||
versionedSpecs:
|
||||
- default: true
|
||||
|
||||
Reference in New Issue
Block a user