Merge pull request #115750 from saschagrunert/otel-beta

Graduate `KubeletTracing` feature to beta
This commit is contained in:
Kubernetes Prow Robot 2023-03-14 16:34:33 -07:00 committed by GitHub
commit 1586138519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 5 deletions

View File

@ -1280,7 +1280,7 @@ func newTracerProvider(s *options.KubeletServer) (oteltrace.TracerProvider, erro
}
hostname, err := nodeutil.GetHostname(s.HostnameOverride)
if err != nil {
return nil, fmt.Errorf("could not determine hostname for tracer provider: %v", err)
return nil, fmt.Errorf("could not determine hostname for tracer provider: %w", err)
}
resourceOpts := []otelsdkresource.Option{
otelsdkresource.WithAttributes(
@ -1290,7 +1290,7 @@ func newTracerProvider(s *options.KubeletServer) (oteltrace.TracerProvider, erro
}
tp, err := tracing.NewProvider(context.Background(), s.KubeletConfiguration.Tracing, []otlptracegrpc.Option{}, resourceOpts)
if err != nil {
return nil, fmt.Errorf("could not configure tracer provider: %v", err)
return nil, fmt.Errorf("could not configure tracer provider: %w", err)
}
return tp, nil
}

View File

@ -93,6 +93,7 @@ STORAGE_BACKEND=${STORAGE_BACKEND:-"etcd3"}
STORAGE_MEDIA_TYPE=${STORAGE_MEDIA_TYPE:-"application/vnd.kubernetes.protobuf"}
# preserve etcd data. you also need to set ETCD_DIR.
PRESERVE_ETCD="${PRESERVE_ETCD:-false}"
ENABLE_TRACING=${ENABLE_TRACING:-false}
# enable Kubernetes-CSI snapshotter
ENABLE_CSI_SNAPSHOTTER=${ENABLE_CSI_SNAPSHOTTER:-false}
@ -753,7 +754,7 @@ staticPodPath: "${POD_MANIFEST_PATH}"
resolvConf: "${KUBELET_RESOLV_CONF}"
EOF
if [[ "$FEATURE_GATES" == *KubeletTracing=true* ]]; then
if [[ "$ENABLE_TRACING" = true ]]; then
cat <<EOF >> "${TMP_DIR}"/kubelet.yaml
tracing:
endpoint: localhost:4317 # the default value

View File

@ -460,6 +460,7 @@ const (
// owner: @sallyom
// kep: https://kep.k8s.io/2832
// alpha: v1.25
// beta: v1.27
//
// Add support for distributed tracing in the kubelet
KubeletTracing featuregate.Feature = "KubeletTracing"
@ -1013,7 +1014,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
KubeletPodResourcesGetAllocatable: {Default: true, PreRelease: featuregate.Beta},
KubeletTracing: {Default: false, PreRelease: featuregate.Alpha},
KubeletTracing: {Default: true, PreRelease: featuregate.Beta},
LegacyServiceAccountTokenNoAutoGeneration: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.29

View File

@ -58380,7 +58380,7 @@ func schema_k8sio_kubelet_config_v1beta1_KubeletConfiguration(ref common.Referen
},
"tracing": {
SchemaProps: spec.SchemaProps{
Description: "Tracing specifies the versioned configuration for OpenTelemetry tracing clients. See https://kep.k8s.io/2832 for more details.",
Description: "Tracing specifies the versioned configuration for OpenTelemetry tracing clients. See https://kep.k8s.io/2832 for more details. Default: nil",
Ref: ref("k8s.io/component-base/tracing/api/v1.TracingConfiguration"),
},
},

View File

@ -798,6 +798,7 @@ type KubeletConfiguration struct {
RegisterNode *bool `json:"registerNode,omitempty"`
// 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"`