From 31d615fa84e93e99e39e5971b97120fd77f38a80 Mon Sep 17 00:00:00 2001 From: wanjunlei Date: Sat, 25 Jul 2020 13:44:40 +0800 Subject: [PATCH] add host local time to kubectl from toolbox Signed-off-by: wanjunlei --- pkg/models/kubectl/kubectl.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pkg/models/kubectl/kubectl.go b/pkg/models/kubectl/kubectl.go index c3ed70447..85b29b0ed 100644 --- a/pkg/models/kubectl/kubectl.go +++ b/pkg/models/kubectl/kubectl.go @@ -138,11 +138,28 @@ func (o *operator) CreateKubectlDeploy(username string) error { }, Spec: v1.PodSpec{ Containers: []v1.Container{ - {Name: "kubectl", + { + Name: "kubectl", Image: o.kubectlImage, + VolumeMounts: []v1.VolumeMount{ + { + Name: "host-time", + MountPath: "/etc/localtime", + }, + }, }, }, ServiceAccountName: "kubesphere-cluster-admin", + Volumes: []v1.Volume{ + { + Name: "host-time", + VolumeSource: v1.VolumeSource{ + HostPath: &v1.HostPathVolumeSource{ + Path: "/etc/localtime", + }, + }, + }, + }, }, }, },