mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 04:54:54 +00:00
Graduate NodeLocalCRISocket to beta
This commit is contained in:
@@ -38,7 +38,7 @@ const (
|
||||
WaitForAllControlPlaneComponents = "WaitForAllControlPlaneComponents"
|
||||
// ControlPlaneKubeletLocalMode is expected to be in alpha in v1.31, beta in v1.33
|
||||
ControlPlaneKubeletLocalMode = "ControlPlaneKubeletLocalMode"
|
||||
// NodeLocalCRISocket is expected to be in alpha in v1.32, beta in v1.33, ga in v1.35
|
||||
// NodeLocalCRISocket is expected to be in alpha in v1.32, beta in v1.34, ga in v1.36
|
||||
NodeLocalCRISocket = "NodeLocalCRISocket"
|
||||
)
|
||||
|
||||
@@ -55,7 +55,7 @@ var InitFeatureGates = FeatureList{
|
||||
},
|
||||
WaitForAllControlPlaneComponents: {FeatureSpec: featuregate.FeatureSpec{Default: true, PreRelease: featuregate.Beta}},
|
||||
ControlPlaneKubeletLocalMode: {FeatureSpec: featuregate.FeatureSpec{Default: true, PreRelease: featuregate.Beta}},
|
||||
NodeLocalCRISocket: {FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Alpha}},
|
||||
NodeLocalCRISocket: {FeatureSpec: featuregate.FeatureSpec{Default: true, PreRelease: featuregate.Beta}},
|
||||
}
|
||||
|
||||
// Feature represents a feature being gated
|
||||
|
||||
@@ -46,7 +46,6 @@ import (
|
||||
kubeadmapiv1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta4"
|
||||
"k8s.io/kubernetes/cmd/kubeadm/app/componentconfigs"
|
||||
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
|
||||
"k8s.io/kubernetes/cmd/kubeadm/app/features"
|
||||
"k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient"
|
||||
"k8s.io/kubernetes/cmd/kubeadm/app/util/config/strict"
|
||||
"k8s.io/kubernetes/cmd/kubeadm/app/util/kubeconfig"
|
||||
@@ -176,30 +175,18 @@ func GetNodeRegistration(kubeconfigFile string, client clientset.Interface, node
|
||||
return errors.Wrap(err, "failed to get corresponding node")
|
||||
}
|
||||
|
||||
var (
|
||||
criSocket string
|
||||
ok bool
|
||||
missingAnnotationError = errors.Errorf("node %s doesn't have %s annotation", nodeName, constants.AnnotationKubeadmCRISocket)
|
||||
)
|
||||
if features.Enabled(clusterCfg.FeatureGates, features.NodeLocalCRISocket) {
|
||||
_, err = os.Stat(filepath.Join(constants.KubeletRunDirectory, constants.KubeletInstanceConfigurationFileName))
|
||||
criSocket, ok := node.Annotations[constants.AnnotationKubeadmCRISocket]
|
||||
if !ok {
|
||||
configFilePath := filepath.Join(constants.KubeletRunDirectory, constants.KubeletInstanceConfigurationFileName)
|
||||
_, err := os.Stat(configFilePath)
|
||||
if os.IsNotExist(err) {
|
||||
criSocket, ok = node.ObjectMeta.Annotations[constants.AnnotationKubeadmCRISocket]
|
||||
if !ok {
|
||||
return missingAnnotationError
|
||||
}
|
||||
} else {
|
||||
kubeletConfig, err := readKubeletConfig(constants.KubeletRunDirectory, constants.KubeletInstanceConfigurationFileName)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "node %q does not have a kubelet instance configuration", nodeName)
|
||||
}
|
||||
criSocket = kubeletConfig.ContainerRuntimeEndpoint
|
||||
return errors.Errorf("node %s doesn't have %s annotation, or kubelet instance config %s", nodeName, constants.AnnotationKubeadmCRISocket, configFilePath)
|
||||
}
|
||||
} else {
|
||||
criSocket, ok = node.ObjectMeta.Annotations[constants.AnnotationKubeadmCRISocket]
|
||||
if !ok {
|
||||
return missingAnnotationError
|
||||
kubeletConfig, err := readKubeletConfig(constants.KubeletRunDirectory, constants.KubeletInstanceConfigurationFileName)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "could not read kubelet instance configuration on node %q", nodeName)
|
||||
}
|
||||
criSocket = kubeletConfig.ContainerRuntimeEndpoint
|
||||
}
|
||||
|
||||
// returns the nodeRegistration attributes
|
||||
|
||||
Reference in New Issue
Block a user