From 06f53b4838101ad5d36239df0173447d6f5b67c9 Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Fri, 20 Apr 2018 17:21:55 -0700 Subject: [PATCH] Add `unix://` prefix for socket addresses used by CRI remote client. Signed-off-by: Lantao Liu --- README.md | 2 +- cluster/gce/env | 2 +- contrib/ansible/cri-containerd.yaml | 4 ++-- docs/crictl.md | 6 +++--- hack/install/install-critools.sh | 2 +- hack/test-utils.sh | 2 +- hack/utils.sh | 2 +- integration/test_utils.go | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 2fb13f7d1..938b8dded 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ sudo containerd ``` 2. From the Kubernetes project directory startup a local cluster using `containerd`: ```bash -CONTAINER_RUNTIME=remote CONTAINER_RUNTIME_ENDPOINT='/run/containerd/containerd.sock' ./hack/local-up-cluster.sh +CONTAINER_RUNTIME=remote CONTAINER_RUNTIME_ENDPOINT='unix:///run/containerd/containerd.sock' ./hack/local-up-cluster.sh ``` ### Test See [here](./docs/testing.md) for information about test. diff --git a/cluster/gce/env b/cluster/gce/env index 956f5fa2c..613516c5e 100644 --- a/cluster/gce/env +++ b/cluster/gce/env @@ -11,7 +11,7 @@ fi export KUBE_MASTER_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/master.yaml,containerd-configure-sh=${GCE_DIR}/configure.sh,containerd-env=${version_file}" export KUBE_NODE_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/node.yaml,containerd-configure-sh=${GCE_DIR}/configure.sh,containerd-env=${version_file}" export KUBE_CONTAINER_RUNTIME="remote" -export KUBE_CONTAINER_RUNTIME_ENDPOINT="/run/containerd/containerd.sock" +export KUBE_CONTAINER_RUNTIME_ENDPOINT="unix:///run/containerd/containerd.sock" export KUBE_CONTAINER_RUNTIME_NAME=containerd export KUBE_LOAD_IMAGE_COMMAND="/home/containerd/usr/local/bin/ctr cri load" export NETWORK_PROVIDER="" diff --git a/contrib/ansible/cri-containerd.yaml b/contrib/ansible/cri-containerd.yaml index 516562b21..85b3fc111 100644 --- a/contrib/ansible/cri-containerd.yaml +++ b/contrib/ansible/cri-containerd.yaml @@ -46,7 +46,7 @@ - name: "Add runtime args in kubelet conf" lineinfile: dest: "/etc/systemd/system/kubelet.service.d/10-kubeadm.conf" - line: "Environment=\"KUBELET_EXTRA_ARGS= --runtime-cgroups=/system.slice/containerd.service --container-runtime=remote --runtime-request-timeout=15m --container-runtime-endpoint=/run/containerd/containerd.sock\"" + line: "Environment=\"KUBELET_EXTRA_ARGS= --runtime-cgroups=/system.slice/containerd.service --container-runtime=remote --runtime-request-timeout=15m --container-runtime-endpoint=unix:///run/containerd/containerd.sock\"" insertafter: '\[Service\]' when: check_args.stdout == "" @@ -57,5 +57,5 @@ - name: "Pre-pull pause container image" shell: | /usr/local/bin/ctr pull k8s.gcr.io/pause:3.1 - /usr/local/bin/crictl --runtime-endpoint /run/containerd/containerd.sock \ + /usr/local/bin/crictl --runtime-endpoint unix:///run/containerd/containerd.sock \ pull k8s.gcr.io/pause:3.1 diff --git a/docs/crictl.md b/docs/crictl.md index e1f112584..22ccc7a01 100644 --- a/docs/crictl.md +++ b/docs/crictl.md @@ -22,8 +22,8 @@ so you don't have to repeatedly specify the runtime sock used to connect crictl to the container runtime: ```console $ cat /etc/crictl.yaml -runtime-endpoint: /run/containerd/containerd.sock -image-endpoint: /run/containerd/containerd.sock +runtime-endpoint: unix:///run/containerd/containerd.sock +image-endpoint: unix:///run/containerd/containerd.sock timeout: 10 debug: true ``` @@ -188,7 +188,7 @@ $ crictl info "sandboxImage": "k8s.gcr.io/pause:3.1", "statsCollectPeriod": 10, "containerdRootDir": "/var/lib/containerd", - "containerdEndpoint": "/run/containerd/containerd.sock", + "containerdEndpoint": "unix:///run/containerd/containerd.sock", "rootDir": "/var/lib/containerd/io.containerd.grpc.v1.cri", "stateDir": "/run/containerd/io.containerd.grpc.v1.cri", }, diff --git a/hack/install/install-critools.sh b/hack/install/install-critools.sh index e58d69ae0..5070a3b0b 100755 --- a/hack/install/install-critools.sh +++ b/hack/install/install-critools.sh @@ -33,7 +33,7 @@ make ${SUDO} make install -e BINDIR=${CRITOOL_DIR} GOPATH=${GOPATH} ${SUDO} mkdir -p ${CRICTL_CONFIG_DIR} ${SUDO} bash -c 'cat >'${CRICTL_CONFIG_DIR}'/crictl.yaml <