diff --git a/kubelet.go b/kubelet.go index 7fcdc63..ad278af 100644 --- a/kubelet.go +++ b/kubelet.go @@ -188,6 +188,13 @@ func kubeletKubeConfigCreate(certificatesDir string) error { return err } + caCertPemBlock := &pem.Block{ + Type: "CERTIFICATE", + Bytes: caCertData.Bytes, + } + + caCertPem := pem.EncodeToMemory(caCertPemBlock) + clientConfig := &restclient.Config{ Host: "https://127.0.0.1:6443", } @@ -197,7 +204,7 @@ func kubeletKubeConfigCreate(certificatesDir string) error { // Define a cluster stanza based on the bootstrap kubeconfig. Clusters: map[string]*clientcmdapi.Cluster{"default-cluster": { Server: clientConfig.Host, - CertificateAuthorityData: caCertData.Bytes, + CertificateAuthorityData: caCertPem, }}, // Define auth based on the obtained client cert. AuthInfos: map[string]*clientcmdapi.AuthInfo{"default-auth": { diff --git a/main.go b/main.go index d494b1b..68fb817 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,7 @@ import ( ) // AppVersion current build application version. -const AppVersion = "0.0.15" +const AppVersion = "0.0.16" func main() { var (