Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: error in Kubelet when using default root directory #603

Merged
merged 5 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Or you can start nydus-snapshotter manually.
# Otherwise, provide them in below command line.
# `address` is the domain socket that you configured in containerd configuration file
# `--nydusd-config` is the path to `nydusd` configuration file
# The default nydus-snapshotter work directory is located at `/var/lib/containerd-nydus`
# The default nydus-snapshotter work directory is located at `/var/lib/containerd/io.containerd.snapshotter.v1.nydus`

$ sudo ./containerd-nydus-grpc --config /etc/nydus/config.toml --nydusd-config /etc/nydus/nydusd-config.json --log-to-stdout
```
Expand Down
2 changes: 1 addition & 1 deletion config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestLoadSnapshotterTOMLConfig(t *testing.T) {

exampleConfig := SnapshotterConfig{
Version: 1,
Root: "/var/lib/containerd-nydus",
Root: "/var/lib/containerd/io.containerd.snapshotter.v1.nydus",
Address: "/run/containerd-nydus/containerd-nydus-grpc.sock",
DaemonMode: "dedicated",
Experimental: Experimental{
Expand Down
2 changes: 1 addition & 1 deletion integration/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SNAPSHOTTER_CONFIG=/etc/nydus/config.toml
CONTAINERD_ROOT=/var/lib/containerd/
CONTAINERD_STATUS=/run/containerd/
REMOTE_SNAPSHOTTER_SOCKET=/run/containerd-nydus/containerd-nydus-grpc.sock
REMOTE_SNAPSHOTTER_ROOT=/var/lib/containerd-nydus
REMOTE_SNAPSHOTTER_ROOT=/var/lib/containerd/io.containerd.snapshotter.v1.nydus
CONTAINERD_SOCKET=/run/containerd/containerd.sock
SNAPSHOTTER_SHARED_MNT=${REMOTE_SNAPSHOTTER_ROOT}/mnt
SNAPSHOTTER_CACHE_DIR=${REMOTE_SNAPSHOTTER_ROOT}/cache
Expand Down
2 changes: 1 addition & 1 deletion internal/constant/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const (
NydusdBinaryName string = "nydusd"
NydusImageBinaryName string = "nydus-image"

DefaultRootDir = "/var/lib/containerd-nydus"
DefaultRootDir = "/var/lib/containerd/io.containerd.snapshotter.v1.nydus"
DefaultAddress = "/run/containerd-nydus/containerd-nydus-grpc.sock"
DefaultSystemControllerAddress = "/run/containerd-nydus/system.sock"

Expand Down
2 changes: 1 addition & 1 deletion misc/snapshotter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ARG SCRIPT_DESTINATION=${DESTINATION}/opt/nydus
WORKDIR /root/
RUN apk add --no-cache libc6-compat bash

VOLUME /var/lib/containerd-nydus /run/containerd-nydus
VOLUME /var/lib/containerd/io.containerd.snapshotter.v1.nydus /run/containerd-nydus

COPY --from=sourcer /.nydus_version /.nydus_version
COPY --from=kubectl-sourcer /usr/bin/kubectl /usr/bin/kubectl
Expand Down
4 changes: 2 additions & 2 deletions misc/snapshotter/base/nydus-snapshotter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ spec:
- name: config-volume
mountPath: "/etc/nydus-snapshotter"
- name: nydus-lib
mountPath: "/var/lib/containerd-nydus"
mountPath: "/var/lib/containerd/io.containerd.snapshotter.v1.nydus"
mountPropagation: Bidirectional
- name: nydus-run
mountPath: "/run/containerd-nydus"
Expand Down Expand Up @@ -118,7 +118,7 @@ spec:
type: DirectoryOrCreate
- name: nydus-lib
hostPath:
path: /var/lib/containerd-nydus
path: /var/lib/containerd/io.containerd.snapshotter.v1.nydus
type: DirectoryOrCreate
- name: nydus-opt
hostPath:
Expand Down
2 changes: 1 addition & 1 deletion misc/snapshotter/config-blockdev.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version = 1
# Snapshotter's own home directory where it stores and creates necessary resources
root = "/var/lib/containerd-nydus"
root = "/var/lib/containerd/io.containerd.snapshotter.v1.nydus"
# The snapshotter's GRPC server socket, containerd will connect to plugin on this socket
address = "/run/containerd-nydus/containerd-nydus-grpc.sock"
# No nydusd daemon needed
Expand Down
2 changes: 1 addition & 1 deletion misc/snapshotter/config-proxy.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version = 1
# Snapshotter's own home directory where it stores and creates necessary resources
root = "/var/lib/containerd-nydus"
root = "/var/lib/containerd/io.containerd.snapshotter.v1.nydus"
# The snapshotter's GRPC server socket, containerd will connect to plugin on this socket
address = "/run/containerd-nydus/containerd-nydus-grpc.sock"
# No nydusd daemon needed
Expand Down
2 changes: 1 addition & 1 deletion misc/snapshotter/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version = 1
# Snapshotter's own home directory where it stores and creates necessary resources
root = "/var/lib/containerd-nydus"
root = "/var/lib/containerd/io.containerd.snapshotter.v1.nydus"
# The snapshotter's GRPC server socket, containerd will connect to plugin on this socket
address = "/run/containerd-nydus/containerd-nydus-grpc.sock"
# The nydus daemon mode can be one of the following options: multiple, dedicated, shared, or none.
Expand Down
2 changes: 1 addition & 1 deletion misc/snapshotter/nydusd-config-localfs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"backend": {
"type": "localfs",
"config": {
"dir": "/var/lib/containerd-nydus/cache/"
"dir": "/var/lib/containerd/io.containerd.snapshotter.v1.nydus/cache/"
}
},
"cache": {
Expand Down
2 changes: 1 addition & 1 deletion misc/snapshotter/snapshotter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SNAPSHOTTER_GRPC_SOCKET="${SNAPSHOTTER_GRPC_SOCKET:-/run/containerd-nydus/contai

# The directory about nydus and nydus snapshotter
NYDUS_CONFIG_DIR="${NYDUS_CONFIG_DIR:-/etc/nydus}"
NYDUS_LIB_DIR="${NYDUS_LIB_DIR:-/var/lib/containerd-nydus}"
NYDUS_LIB_DIR="${NYDUS_LIB_DIR:-/var/lib/containerd/io.containerd.snapshotter.v1.nydus}"
NYDUS_BINARY_DIR="${NYDUS_BINARY_DIR:-/usr/local/bin}"
SNAPSHOTTER_SCRYPT_DIR="${SNAPSHOTTER_SCRYPT_DIR:-/opt/nydus}"

Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/k8s/snapshotter-cri.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ spec:
- name: config-volume
mountPath: "/etc/nydus-snapshotter"
- name: nydus-lib
mountPath: "/var/lib/containerd-nydus"
mountPath: "/var/lib/containerd/io.containerd.snapshotter.v1.nydus"
mountPropagation: Bidirectional
- name: nydus-run
mountPath: "/run/containerd-nydus"
Expand Down Expand Up @@ -131,7 +131,7 @@ spec:
type: DirectoryOrCreate
- name: nydus-lib
hostPath:
path: /var/lib/containerd-nydus
path: /var/lib/containerd/io.containerd.snapshotter.v1.nydus
type: DirectoryOrCreate
- name: nydus-etc
hostPath:
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/k8s/snapshotter-kubeconf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ spec:
- name: config-volume
mountPath: "/etc/nydus-snapshotter"
- name: nydus-lib
mountPath: "/var/lib/containerd-nydus"
mountPath: "/var/lib/containerd/io.containerd.snapshotter.v1.nydus"
mountPropagation: Bidirectional
- name: nydus-run
mountPath: "/run/containerd-nydus"
Expand Down Expand Up @@ -140,7 +140,7 @@ spec:
type: DirectoryOrCreate
- name: nydus-lib
hostPath:
path: /var/lib/containerd-nydus
path: /var/lib/containerd/io.containerd.snapshotter.v1.nydus
type: DirectoryOrCreate
- name: nydus-etc
hostPath:
Expand Down
Loading