forked from kubernetes/autoscaler
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88287 from gab-satchi/master
Windows specific kubelet flags in kubeadm-flags.env
- Loading branch information
Showing
11 changed files
with
165 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// +build !windows | ||
|
||
/* | ||
Copyright 2020 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package images | ||
|
||
import ( | ||
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" | ||
"k8s.io/kubernetes/cmd/kubeadm/app/constants" | ||
) | ||
|
||
// GetPauseImage returns the image for the "pause" container | ||
func GetPauseImage(cfg *kubeadmapi.ClusterConfiguration) string { | ||
return GetGenericImage(cfg.ImageRepository, "pause", constants.PauseVersion) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// +build windows | ||
|
||
/* | ||
Copyright 2020 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package images | ||
|
||
import ( | ||
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" | ||
kubeadmapiv1beta2 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2" | ||
"k8s.io/kubernetes/cmd/kubeadm/app/constants" | ||
) | ||
|
||
// GetPauseImage returns the image for the "pause" container | ||
func GetPauseImage(cfg *kubeadmapi.ClusterConfiguration) string { | ||
//If user has configured the cluster to use a different image repository, use that for the Windows pause image. | ||
if cfg.ImageRepository != kubeadmapiv1beta2.DefaultImageRepository { | ||
return GetGenericImage(cfg.ImageRepository, "pause", constants.PauseVersion) | ||
} | ||
return GetGenericImage("mcr.microsoft.com/oss/kubernetes", "pause", constants.PauseVersion) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// +build !windows | ||
|
||
/* | ||
Copyright 2020 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package kubelet | ||
|
||
import ( | ||
"k8s.io/klog" | ||
"k8s.io/kubernetes/cmd/kubeadm/app/constants" | ||
kubeadmutil "k8s.io/kubernetes/cmd/kubeadm/app/util" | ||
) | ||
|
||
// buildKubeletArgMap takes a kubeletFlagsOpts object and builds based on that a string-string map with flags | ||
// that should be given to the local Linux kubelet daemon. | ||
func buildKubeletArgMap(opts kubeletFlagsOpts) map[string]string { | ||
kubeletFlags := buildKubeletArgMapCommon(opts) | ||
|
||
// TODO: Conditionally set `--cgroup-driver` to either `systemd` or `cgroupfs` for CRI other than Docker | ||
if opts.nodeRegOpts.CRISocket == constants.DefaultDockerCRISocket { | ||
driver, err := kubeadmutil.GetCgroupDriverDocker(opts.execer) | ||
if err != nil { | ||
klog.Warningf("cannot automatically assign a '--cgroup-driver' value when starting the Kubelet: %v\n", err) | ||
} else { | ||
kubeletFlags["cgroup-driver"] = driver | ||
} | ||
} | ||
|
||
ok, err := opts.isServiceActiveFunc("systemd-resolved") | ||
if err != nil { | ||
klog.Warningf("cannot determine if systemd-resolved is active: %v\n", err) | ||
} | ||
if ok { | ||
kubeletFlags["resolv-conf"] = "/run/systemd/resolve/resolv.conf" | ||
} | ||
|
||
return kubeletFlags | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// +build windows | ||
|
||
/* | ||
Copyright 2020 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package kubelet | ||
|
||
// buildKubeletArgMap takes a kubeletFlagsOpts object and builds based on that a string-string map with flags | ||
// that should be given to the local Windows kubelet daemon. | ||
func buildKubeletArgMap(opts kubeletFlagsOpts) map[string]string { | ||
return buildKubeletArgMapCommon(opts) | ||
} |