diff --git a/test/e2e/common/kubelet_etc_hosts.go b/test/e2e/common/kubelet_etc_hosts.go index 52b9399707983..1a69d691e583f 100644 --- a/test/e2e/common/kubelet_etc_hosts.go +++ b/test/e2e/common/kubelet_etc_hosts.go @@ -130,6 +130,8 @@ func (config *KubeletManagedHostConfig) getEtcHostsContent(podName, containerNam } func (config *KubeletManagedHostConfig) createPodSpec(podName string) *v1.Pod { + hostPathType := new(v1.HostPathType) + *hostPathType = v1.HostPathType(string(v1.HostPathFileOrCreate)) pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: podName, @@ -176,6 +178,7 @@ func (config *KubeletManagedHostConfig) createPodSpec(podName string) *v1.Pod { VolumeSource: v1.VolumeSource{ HostPath: &v1.HostPathVolumeSource{ Path: "/etc/hosts", + Type: hostPathType, }, }, }, diff --git a/test/e2e_node/log_path_test.go b/test/e2e_node/log_path_test.go index 4974943366b3d..b4d64aa52a856 100644 --- a/test/e2e_node/log_path_test.go +++ b/test/e2e_node/log_path_test.go @@ -74,6 +74,9 @@ var _ = framework.KubeDescribe("ContainerLogPath", func() { expectedlogFile := logDir + "/" + logPodName + "_" + ns + "_" + logContName + "-" + logConID.ID + ".log" + hostPathType := new(v1.HostPathType) + *hostPathType = v1.HostPathType(string(v1.HostPathFileOrCreate)) + checkPod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: checkPodName, @@ -104,6 +107,7 @@ var _ = framework.KubeDescribe("ContainerLogPath", func() { VolumeSource: v1.VolumeSource{ HostPath: &v1.HostPathVolumeSource{ Path: expectedlogFile, + Type: hostPathType, }, }, }, diff --git a/test/e2e_node/node_problem_detector_linux.go b/test/e2e_node/node_problem_detector_linux.go index e35236d6f10e0..dea4b7fe4b1b0 100644 --- a/test/e2e_node/node_problem_detector_linux.go +++ b/test/e2e_node/node_problem_detector_linux.go @@ -161,6 +161,8 @@ var _ = framework.KubeDescribe("NodeProblemDetector", func() { }) Expect(err).NotTo(HaveOccurred()) By("Create the node problem detector") + hostPathType := new(v1.HostPathType) + *hostPathType = v1.HostPathType(string(v1.HostPathFileOrCreate)) f.PodClient().CreateSync(&v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: name, @@ -186,7 +188,10 @@ var _ = framework.KubeDescribe("NodeProblemDetector", func() { { Name: localtimeVolume, VolumeSource: v1.VolumeSource{ - HostPath: &v1.HostPathVolumeSource{Path: etcLocaltime}, + HostPath: &v1.HostPathVolumeSource{ + Path: etcLocaltime, + Type: hostPathType, + }, }, }, }, diff --git a/test/fixtures/doc-yaml/admin/high-availability/kube-apiserver.yaml b/test/fixtures/doc-yaml/admin/high-availability/kube-apiserver.yaml index 6150aa737b69b..a41a2c666dc2b 100644 --- a/test/fixtures/doc-yaml/admin/high-availability/kube-apiserver.yaml +++ b/test/fixtures/doc-yaml/admin/high-availability/kube-apiserver.yaml @@ -63,6 +63,7 @@ spec: name: srvkube - hostPath: path: /var/log/kube-apiserver.log + type: FileOrCreate name: logfile - hostPath: path: /etc/ssl diff --git a/test/fixtures/doc-yaml/admin/high-availability/kube-controller-manager.yaml b/test/fixtures/doc-yaml/admin/high-availability/kube-controller-manager.yaml index f9956ed7940a2..a7cfbd5785b80 100644 --- a/test/fixtures/doc-yaml/admin/high-availability/kube-controller-manager.yaml +++ b/test/fixtures/doc-yaml/admin/high-availability/kube-controller-manager.yaml @@ -55,6 +55,7 @@ spec: name: srvkube - hostPath: path: /var/log/kube-controller-manager.log + type: FileOrCreate name: logfile - hostPath: path: /etc/ssl diff --git a/test/fixtures/doc-yaml/admin/high-availability/kube-scheduler.yaml b/test/fixtures/doc-yaml/admin/high-availability/kube-scheduler.yaml index 6b05d245f22db..eeef9bb628649 100644 --- a/test/fixtures/doc-yaml/admin/high-availability/kube-scheduler.yaml +++ b/test/fixtures/doc-yaml/admin/high-availability/kube-scheduler.yaml @@ -27,4 +27,5 @@ spec: volumes: - hostPath: path: /var/log/kube-scheduler.log + type: FileOrCreate name: logfile diff --git a/test/kubemark/resources/manifests/etcd-events.yaml b/test/kubemark/resources/manifests/etcd-events.yaml index 59fb70dc4aa9a..ea83b1b604b97 100644 --- a/test/kubemark/resources/manifests/etcd-events.yaml +++ b/test/kubemark/resources/manifests/etcd-events.yaml @@ -48,3 +48,4 @@ spec: - name: varlogetcd hostPath: path: /var/log/etcd-events.log + type: FileOrCreate diff --git a/test/kubemark/resources/manifests/etcd.yaml b/test/kubemark/resources/manifests/etcd.yaml index 6c1ab1dfca96b..2f7d88a633f24 100644 --- a/test/kubemark/resources/manifests/etcd.yaml +++ b/test/kubemark/resources/manifests/etcd.yaml @@ -47,3 +47,4 @@ spec: - name: varlogetcd hostPath: path: /var/log/etcd.log + type: FileOrCreate diff --git a/test/kubemark/resources/manifests/kube-addon-manager.yaml b/test/kubemark/resources/manifests/kube-addon-manager.yaml index a24309d6525f9..2c40c884bb60e 100644 --- a/test/kubemark/resources/manifests/kube-addon-manager.yaml +++ b/test/kubemark/resources/manifests/kube-addon-manager.yaml @@ -31,3 +31,4 @@ spec: - name: varlog hostPath: path: /var/log/kube-addon-manager.log + type: FileOrCreate diff --git a/test/kubemark/resources/manifests/kube-apiserver.yaml b/test/kubemark/resources/manifests/kube-apiserver.yaml index f1475e23cd1ed..af4d1cd357e72 100644 --- a/test/kubemark/resources/manifests/kube-apiserver.yaml +++ b/test/kubemark/resources/manifests/kube-apiserver.yaml @@ -56,6 +56,7 @@ spec: - name: logfile hostPath: path: /var/log/kube-apiserver.log + type: FileOrCreate - name: etcssl hostPath: path: /etc/ssl diff --git a/test/kubemark/resources/manifests/kube-controller-manager.yaml b/test/kubemark/resources/manifests/kube-controller-manager.yaml index a3f1b491c07a9..c465b9ecc9fb2 100644 --- a/test/kubemark/resources/manifests/kube-controller-manager.yaml +++ b/test/kubemark/resources/manifests/kube-controller-manager.yaml @@ -45,6 +45,7 @@ spec: - name: logfile hostPath: path: /var/log/kube-controller-manager.log + type: FileOrCreate - name: etcssl hostPath: path: /etc/ssl diff --git a/test/kubemark/resources/manifests/kube-scheduler.yaml b/test/kubemark/resources/manifests/kube-scheduler.yaml index ac5a67293e90b..daf1728295a0d 100644 --- a/test/kubemark/resources/manifests/kube-scheduler.yaml +++ b/test/kubemark/resources/manifests/kube-scheduler.yaml @@ -40,3 +40,4 @@ spec: - name: logfile hostPath: path: /var/log/kube-scheduler.log + type: FileOrCreate