Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Commit

Permalink
fix kubelet.conf generation
Browse files Browse the repository at this point in the history
  • Loading branch information
preved911 committed Feb 25, 2020
1 parent f3e7f01 commit bc154de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Expand All @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

// AppVersion current build application version.
const AppVersion = "0.0.15"
const AppVersion = "0.0.16"

func main() {
var (
Expand Down

0 comments on commit bc154de

Please sign in to comment.