ks-devops icon indicating copy to clipboard operation
ks-devops copied to clipboard

hostPathVolume.hostPath mounts the wrong path?

Open usernameisnull opened this issue 3 years ago • 1 comments
trafficstars

What is version of KubeSphere DevOps has the issue?

3.3.0

How did you install the Kubernetes? Or what is the Kubernetes distribution?

Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.10", GitCommit:"7e54d50d3012cf3389e43b096ba35300f36e0817", GitTreeState:"clean", BuildDate:"2022-08-17T18:26:59Z", GoVersion:"go1.17.13", Compiler:"gc", Platform:"linux/amd64"}

What happened?

My K8s version:

root:containers#kubectl version
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.4", GitCommit:"e6c093d87ea4cbb530a7b2ae91e54c0842d8308a", GitTreeState:"clean", BuildDate:"2022-02-16T12:38:05Z", GoVersion:"go1.17.7", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.10", GitCommit:"7e54d50d3012cf3389e43b096ba35300f36e0817", GitTreeState:"clean", BuildDate:"2022-08-17T18:26:59Z", GoVersion:"go1.17.13", Compiler:"gc", Platform:"linux/amd64"}

the run time is: containerd:

root@master01:~# ctr version
Client:
  Version:  1.6.8
  Revision: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
  Go version: go1.17.13

Server:
  Version:  1.6.8
  Revision: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
  UUID: 1306ee9c-57fb-4ce8-9339-ee12956adac6

My kubesphere version image


in the agent, according to this document: https://kubesphere.com.cn/forum/d/3811-kubesphere-devops-docker, I think it should be mounted here /var/lib/containers as cache, not /var/run/docker.sock ? It's also possible that I misunderstood something.

jenkins:
  mode: EXCLUSIVE
  numExecutors: 0
  scmCheckoutRetryCount: 2
  disableRememberMe: true

  clouds:
    - kubernetes:
        name: "kubernetes"
        serverUrl: "https://kubernetes.default"
        skipTlsVerify: true
        namespace: "kubesphere-devops-worker"
        credentialsId: "k8s-service-account"
        jenkinsUrl: "http://devops-jenkins.kubesphere-devops-system:80"
        jenkinsTunnel: "devops-jenkins-agent.kubesphere-devops-system:50000"
        containerCapStr: "2"
        connectTimeout: "60"
        readTimeout: "60"
        maxRequestsPerHostStr: "32"
        templates:
          - name: "base"
            namespace: "kubesphere-devops-worker"
            label: "base"
            nodeUsageMode: "NORMAL"
            idleMinutes: 0
            containers:
            - name: "base"
              image: "10.6.182.195/kubesphere/kubesphere/builder-base:v3.2.0-podman"
              command: "cat"
              args: ""
              ttyEnabled: true
              privileged: true
              resourceRequestCpu: "100m"
              resourceLimitCpu: "4000m"
              resourceRequestMemory: "100Mi"
              resourceLimitMemory: "8192Mi"
            - name: "jnlp"
              image: "10.6.182.195/kubesphere/jenkins/inbound-agent:4.10-2"
              args: "^${computer.jnlpmac} ^${computer.name}"
              resourceRequestCpu: "50m"
              resourceLimitCpu: "500m"
              resourceRequestMemory: "400Mi"
              resourceLimitMemory: "1536Mi"
            workspaceVolume:
              emptyDirWorkspaceVolume:
                memory: false
            volumes:
            - hostPathVolume:
                hostPath: "/var/run/docker.sock"
                mountPath: "/var/run/docker.sock"
            - hostPathVolume:
                hostPath: "/var/data/jenkins_sonar_cache"
                mountPath: "/root/.sonar/cache"

Relevant log output

No response

Additional information

No response

usernameisnull avatar Sep 13 '22 03:09 usernameisnull

hi @usernameisnull thanks for contacting us, especially for providing the details. But I still have a couple of questions that hopefully you could help me have a better understanding.

  • What is the container runtime? docker or containerd ?

it should be mounted here /var/lib/containers as cache, not /var/run/docker.sock

/var/run/docker.sock is not a cache directory. It is the default docker sock file path. Currently, we didn't provide the corresponding config file according to different container runtime. Users have to change it by themself.

But please help us to improve it if you're interested in it.

LinuxSuRen avatar Sep 13 '22 06:09 LinuxSuRen

/close

chilianyi avatar Jul 24 '23 01:07 chilianyi

@chilianyi: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

ks-ci-bot avatar Jul 24 '23 01:07 ks-ci-bot