mirror of https://github.com/kubernetes/kops.git
added flexvolume mount to kube-controller
This commit is contained in:
parent
78f5b2c06a
commit
d0a653b0a5
|
@ -151,6 +151,16 @@ func (b *KubeControllerManagerBuilder) buildPod() (*v1.Pod, error) {
|
|||
},
|
||||
}
|
||||
|
||||
volumePluginDir := b.Cluster.Spec.Kubelet.VolumePluginDirectory
|
||||
|
||||
// Ensure the Volume Plugin dir is mounted on the same path as the host machine so DaemonSet deployment is possible
|
||||
if volumePluginDir == "" {
|
||||
volumePluginDir = "/usr/libexec/kubernetes/kubelet-plugins/volume/exec"
|
||||
} else {
|
||||
// If volume-plugin-dir flag is set in kubelet, match dir in kube-controller
|
||||
flags = append(flags, "--flex-volume-plugin-dir="+volumePluginDir)
|
||||
}
|
||||
|
||||
container := &v1.Container{
|
||||
Name: "kube-controller-manager",
|
||||
Image: b.Cluster.Spec.KubeControllerManager.Image,
|
||||
|
@ -195,6 +205,8 @@ func (b *KubeControllerManagerBuilder) buildPod() (*v1.Pod, error) {
|
|||
addHostPathMapping(pod, container, "logfile", "/var/log/kube-controller-manager.log").ReadOnly = false
|
||||
addHostPathMapping(pod, container, "varlibkcm", "/var/lib/kube-controller-manager")
|
||||
|
||||
addHostPathMapping(pod, container, "volplugins", volumePluginDir).ReadOnly = false
|
||||
|
||||
pod.Spec.Containers = append(pod.Spec.Containers, *container)
|
||||
|
||||
kubemanifest.MarkPodAsCritical(pod)
|
||||
|
|
Loading…
Reference in New Issue