Skip to content

Commit 5b74f3d

Browse files
committed
fix kubelet config bug for kubeadm init phase
1 parent 33f907a commit 5b74f3d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/kubeadm/app/componentconfigs/defaults.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ limitations under the License.
1717
package componentconfigs
1818

1919
import (
20+
"path/filepath"
21+
2022
kubeproxyconfigv1alpha1 "k8s.io/kube-proxy/config/v1alpha1"
2123
kubeletconfigv1beta1 "k8s.io/kubelet/config/v1beta1"
2224
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
@@ -88,7 +90,7 @@ func DefaultKubeletConfiguration(internalcfg *kubeadmapi.ClusterConfiguration) {
8890
// Enforce security-related kubelet options
8991

9092
// Require all clients to the kubelet API to have client certs signed by the cluster CA
91-
externalkubeletcfg.Authentication.X509.ClientCAFile = kubeadmapiv1beta1.DefaultCACertPath
93+
externalkubeletcfg.Authentication.X509.ClientCAFile = filepath.Join(internalcfg.CertificatesDir, constants.CACertName)
9294
externalkubeletcfg.Authentication.Anonymous.Enabled = utilpointer.BoolPtr(false)
9395

9496
// On every client request to the kubelet API, execute a webhook (SubjectAccessReview request) to the API server

0 commit comments

Comments
 (0)