From e360de48b2dab4bd5669e9101edefd6a18c74992 Mon Sep 17 00:00:00 2001 From: Sergey Kanzhelev Date: Thu, 2 Mar 2023 22:07:59 +0000 Subject: [PATCH] GRPCContainerProbe is GA --- api/openapi-spec/swagger.json | 2 +- api/openapi-spec/v3/api__v1_openapi.json | 2 +- api/openapi-spec/v3/apis__apps__v1_openapi.json | 2 +- api/openapi-spec/v3/apis__batch__v1_openapi.json | 2 +- pkg/apis/core/types.go | 2 -- pkg/features/kube_features.go | 3 ++- pkg/generated/openapi/zz_generated.openapi.go | 4 ++-- pkg/kubelet/prober/prober.go | 4 +--- staging/src/k8s.io/api/core/v1/generated.proto | 2 -- staging/src/k8s.io/api/core/v1/types.go | 2 -- staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go | 2 +- 11 files changed, 10 insertions(+), 17 deletions(-) diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index 6d5d618c96d..6d00cfdad78 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -8192,7 +8192,7 @@ }, "grpc": { "$ref": "#/definitions/io.k8s.api.core.v1.GRPCAction", - "description": "GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate." + "description": "GRPC specifies an action involving a GRPC port." }, "httpGet": { "$ref": "#/definitions/io.k8s.api.core.v1.HTTPGetAction", diff --git a/api/openapi-spec/v3/api__v1_openapi.json b/api/openapi-spec/v3/api__v1_openapi.json index c78d4d62fc4..c24b3aea79e 100644 --- a/api/openapi-spec/v3/api__v1_openapi.json +++ b/api/openapi-spec/v3/api__v1_openapi.json @@ -5687,7 +5687,7 @@ "$ref": "#/components/schemas/io.k8s.api.core.v1.GRPCAction" } ], - "description": "GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate." + "description": "GRPC specifies an action involving a GRPC port." }, "httpGet": { "allOf": [ diff --git a/api/openapi-spec/v3/apis__apps__v1_openapi.json b/api/openapi-spec/v3/apis__apps__v1_openapi.json index 70b5962db53..1e9667a4fdd 100644 --- a/api/openapi-spec/v3/apis__apps__v1_openapi.json +++ b/api/openapi-spec/v3/apis__apps__v1_openapi.json @@ -3891,7 +3891,7 @@ "$ref": "#/components/schemas/io.k8s.api.core.v1.GRPCAction" } ], - "description": "GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate." + "description": "GRPC specifies an action involving a GRPC port." }, "httpGet": { "allOf": [ diff --git a/api/openapi-spec/v3/apis__batch__v1_openapi.json b/api/openapi-spec/v3/apis__batch__v1_openapi.json index 7d30b66fbef..756b1655679 100644 --- a/api/openapi-spec/v3/apis__batch__v1_openapi.json +++ b/api/openapi-spec/v3/apis__batch__v1_openapi.json @@ -3065,7 +3065,7 @@ "$ref": "#/components/schemas/io.k8s.api.core.v1.GRPCAction" } ], - "description": "GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate." + "description": "GRPC specifies an action involving a GRPC port." }, "httpGet": { "allOf": [ diff --git a/pkg/apis/core/types.go b/pkg/apis/core/types.go index a235034eaf1..ebaa41f9c93 100644 --- a/pkg/apis/core/types.go +++ b/pkg/apis/core/types.go @@ -2326,8 +2326,6 @@ type ProbeHandler struct { TCPSocket *TCPSocketAction // GRPC specifies an action involving a GRPC port. - // This is a beta field and requires enabling GRPCContainerProbe feature gate. - // +featureGate=GRPCContainerProbe // +optional GRPC *GRPCAction } diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go index efc73fe71c4..7f57eb5a326 100644 --- a/pkg/features/kube_features.go +++ b/pkg/features/kube_features.go @@ -298,6 +298,7 @@ const ( // kep: https://kep.k8s.io/2727 // alpha: v1.23 // beta: v1.24 + // stable: v1.27 // // Enables GRPC probe method for {Liveness,Readiness,Startup}Probe. GRPCContainerProbe featuregate.Feature = "GRPCContainerProbe" @@ -934,7 +935,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS ExperimentalHostUserNamespaceDefaultingGate: {Default: false, PreRelease: featuregate.Beta}, - GRPCContainerProbe: {Default: true, PreRelease: featuregate.Beta}, + GRPCContainerProbe: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, //remove in 1.29 GracefulNodeShutdown: {Default: true, PreRelease: featuregate.Beta}, diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 3c9bca19fe1..3ab362d2965 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -24174,7 +24174,7 @@ func schema_k8sio_api_core_v1_Probe(ref common.ReferenceCallback) common.OpenAPI }, "grpc": { SchemaProps: spec.SchemaProps{ - Description: "GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.", + Description: "GRPC specifies an action involving a GRPC port.", Ref: ref("k8s.io/api/core/v1.GRPCAction"), }, }, @@ -24255,7 +24255,7 @@ func schema_k8sio_api_core_v1_ProbeHandler(ref common.ReferenceCallback) common. }, "grpc": { SchemaProps: spec.SchemaProps{ - Description: "GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.", + Description: "GRPC specifies an action involving a GRPC port.", Ref: ref("k8s.io/api/core/v1.GRPCAction"), }, }, diff --git a/pkg/kubelet/prober/prober.go b/pkg/kubelet/prober/prober.go index 4d8e7903203..65a9320ac47 100644 --- a/pkg/kubelet/prober/prober.go +++ b/pkg/kubelet/prober/prober.go @@ -23,9 +23,7 @@ import ( "time" v1 "k8s.io/api/core/v1" - utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/tools/record" - kubefeatures "k8s.io/kubernetes/pkg/features" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/events" "k8s.io/kubernetes/pkg/kubelet/prober/results" @@ -170,7 +168,7 @@ func (pb *prober) runProbe(ctx context.Context, probeType probeType, p *v1.Probe return pb.tcp.Probe(host, port, timeout) } - if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.GRPCContainerProbe) && p.GRPC != nil { + if p.GRPC != nil { host := status.PodIP service := "" if p.GRPC.Service != nil { diff --git a/staging/src/k8s.io/api/core/v1/generated.proto b/staging/src/k8s.io/api/core/v1/generated.proto index d5943de9adc..f381799fd2f 100644 --- a/staging/src/k8s.io/api/core/v1/generated.proto +++ b/staging/src/k8s.io/api/core/v1/generated.proto @@ -4170,8 +4170,6 @@ message ProbeHandler { optional TCPSocketAction tcpSocket = 3; // GRPC specifies an action involving a GRPC port. - // This is a beta field and requires enabling GRPCContainerProbe feature gate. - // +featureGate=GRPCContainerProbe // +optional optional GRPCAction grpc = 4; } diff --git a/staging/src/k8s.io/api/core/v1/types.go b/staging/src/k8s.io/api/core/v1/types.go index 414ebccdc71..da0a8161c0b 100644 --- a/staging/src/k8s.io/api/core/v1/types.go +++ b/staging/src/k8s.io/api/core/v1/types.go @@ -2548,8 +2548,6 @@ type ProbeHandler struct { TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty" protobuf:"bytes,3,opt,name=tcpSocket"` // GRPC specifies an action involving a GRPC port. - // This is a beta field and requires enabling GRPCContainerProbe feature gate. - // +featureGate=GRPCContainerProbe // +optional GRPC *GRPCAction `json:"grpc,omitempty" protobuf:"bytes,4,opt,name=grpc"` } diff --git a/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go index 40c9f6d9b56..da65717e71e 100644 --- a/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go @@ -1856,7 +1856,7 @@ var map_ProbeHandler = map[string]string{ "exec": "Exec specifies the action to take.", "httpGet": "HTTPGet specifies the http request to perform.", "tcpSocket": "TCPSocket specifies an action involving a TCP port.", - "grpc": "GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.", + "grpc": "GRPC specifies an action involving a GRPC port.", } func (ProbeHandler) SwaggerDoc() map[string]string {