Skip to content

Commit

Permalink
modify cgroup2 path from /mnt/cgroup2 to /mnt/kmesh_cgroup2
Browse files Browse the repository at this point in the history
  • Loading branch information
kwb0523 committed Nov 11, 2022
1 parent 35b181c commit ecab817
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ make install
config

```sh
mkdir /mnt/cgroup2
mount -t cgroup2 none /mnt/cgroup2/
mkdir /mnt/kmesh_cgroup2
mount -t cgroup2 none /mnt/kmesh_cgroup2/

vim /etc/kmesh/kmesh.json
---
Expand Down Expand Up @@ -86,7 +86,7 @@ Usage of kmesh-daemon:
-bpf-fs-path string
bpf fs path (default "/sys/fs/bpf")
-cgroup2-path string
cgroup2 path (default "/mnt/cgroup2")
cgroup2 path (default "/mnt/kmesh_cgroup2")
-config-file string
[if -enable-kmesh] deploy in kube cluster (default "/etc/kmesh/kmesh.json")
-enable-ads
Expand Down
2 changes: 1 addition & 1 deletion build/docker/kmesh.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Usage:
# docker build -f kmesh.dockerfile -t kmesh:1.0.1 .
# docker run -itd --privileged=true -v /mnt/cgroup2:/mnt/cgroup2 -v /sys/fs/bpf:/sys/fs/bpf -v /lib/modules:/lib/modules --name kmesh kmesh:1.0.1
# docker run -itd --privileged=true -v /mnt:/mnt -v /sys/fs/bpf:/sys/fs/bpf -v /lib/modules:/lib/modules --name kmesh kmesh:1.0.1
#

# base image
Expand Down
8 changes: 4 additions & 4 deletions build/docker/kmesh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ spec:
app: kmesh
spec:
volumes:
- name: mnt-cgroup2
- name: mnt
hostPath:
path: /mnt/cgroup2
path: /mnt
- name: sys-fs-bpf
hostPath:
path: /sys/fs/bpf
Expand All @@ -35,8 +35,8 @@ spec:
- containerPort: 6789
hostPort: 6789
volumeMounts:
- name: mnt-cgroup2
mountPath: /mnt/cgroup2
- name: mnt
mountPath: /mnt
readOnly: false
- name: sys-fs-bpf
mountPath: /sys/fs/bpf
Expand Down
10 changes: 5 additions & 5 deletions build/docker/start_kmesh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ if [ $? -ne 0 ]; then
modprobe kmesh
fi

mount | grep /mnt/cgroup2
mount | grep /mnt/kmesh_cgroup2
if [ $? -ne 0 ]; then
mkdir /mnt/cgroup2
mount -t cgroup2 none /mnt/cgroup2/
mkdir /mnt/kmesh_cgroup2
mount -t cgroup2 none /mnt/kmesh_cgroup2/
if [ $? -ne 0 ]; then
echo "mount cgroup2 failed"
fi
Expand All @@ -26,8 +26,8 @@ function stop_kmesh() {
rmmod kmesh
fi

umount -t cgroup2 /mnt/cgroup2/
rm -rf /mnt/cgroup2
umount -t cgroup2 /mnt/kmesh_cgroup2/
rm -rf /mnt/kmesh_cgroup2
rm -rf /sys/fs/bpf/bpf_kmesh
}

Expand Down
8 changes: 4 additions & 4 deletions build/kmesh-start-pre.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ else
modprobe kmesh
fi

mount | grep /mnt/cgroup2
mount | grep /mnt/kmesh_cgroup2
if [ $? -ne 0 ]; then
mkdir /mnt/cgroup2
mount -t cgroup2 none /mnt/cgroup2/
fi
mkdir /mnt/kmesh_cgroup2
mount -t cgroup2 none /mnt/kmesh_cgroup2/
fi
6 changes: 3 additions & 3 deletions build/kmesh-stop-post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ if [ $? == 0 ]; then
rmmod kmesh
fi

umount -t cgroup2 /mnt/cgroup2/
rm -rf /mnt/cgroup2 > /dev/null
rm -rf /sys/fs/bpf/bpf_kmesh
umount -t cgroup2 /mnt/kmesh_cgroup2/
rm -rf /mnt/kmesh_cgroup2 > /dev/null
rm -rf /sys/fs/bpf/bpf_kmesh
2 changes: 1 addition & 1 deletion pkg/bpf/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type Config struct {

func (c *Config) SetArgs() error {
flag.StringVar(&c.BpfFsPath, "bpf-fs-path", "/sys/fs/bpf", "bpf fs path")
flag.StringVar(&c.Cgroup2Path, "cgroup2-path", "/mnt/cgroup2", "cgroup2 path")
flag.StringVar(&c.Cgroup2Path, "cgroup2-path", "/mnt/kmesh_cgroup2", "cgroup2 path")

flag.BoolVar(&c.EnableKmesh, "enable-kmesh", false, "enable bpf kmesh")

Expand Down
4 changes: 2 additions & 2 deletions test/testcases/kmesh/libs/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ source ${OET_PATH}/libs/locallibs/common_lib.sh
# environment preparation
function env_init()
{
mkdir /mnt/cgroup2
mount -t cgroup2 none /mnt/cgroup2/
mkdir /mnt/kmesh_cgroup2
mount -t cgroup2 none /mnt/kmesh_cgroup2/

cd $CURRENT_PATH
cd ../pkg
Expand Down

0 comments on commit ecab817

Please sign in to comment.