Skip to content

Commit

Permalink
Don't specify require-kubeconfig from 1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed Feb 11, 2018
1 parent bd4475f commit e5850e4
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions pkg/model/components/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,21 @@ func (b *KubeletOptionsBuilder) BuildOptions(o interface{}) error {
}
}

if kubernetesVersion.Major == 1 && kubernetesVersion.Minor <= 5 {
clusterSpec.Kubelet.APIServers = "https://" + clusterSpec.MasterInternalName
clusterSpec.MasterKubelet.APIServers = "http://127.0.0.1:8080"
} else if kubernetesVersion.Major == 1 { // for 1.6+ use kubeconfig instead of api-servers
if b.Context.IsKubernetesGTE("1.6") {
// for 1.6+ use kubeconfig instead of api-servers
const kubeconfigPath = "/var/lib/kubelet/kubeconfig"
clusterSpec.Kubelet.KubeconfigPath = kubeconfigPath
clusterSpec.Kubelet.RequireKubeconfig = fi.Bool(true)

clusterSpec.MasterKubelet.KubeconfigPath = kubeconfigPath
clusterSpec.MasterKubelet.RequireKubeconfig = fi.Bool(true)

// Only pass require-kubeconfig to versions prior to 1.10; deprecated & being removed
if b.Context.IsKubernetesLT("1.10") {
clusterSpec.Kubelet.RequireKubeconfig = fi.Bool(true)
clusterSpec.MasterKubelet.RequireKubeconfig = fi.Bool(true)
}
} else {
// Legacy behaviour for <= 1.5
clusterSpec.Kubelet.APIServers = "https://" + clusterSpec.MasterInternalName
clusterSpec.MasterKubelet.APIServers = "http://127.0.0.1:8080"
}

// IsolateMasters enables the legacy behaviour, where master pods on a separate network
Expand Down

0 comments on commit e5850e4

Please sign in to comment.