Skip to content

Commit

Permalink
Merge pull request kmesh-net#432 from hzxuzhonghu/mount-proc
Browse files Browse the repository at this point in the history
Mount proc
  • Loading branch information
kmesh-bot authored Jun 18, 2024
2 parents bccbda7 + 8af0cb8 commit c3b6ec1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
8 changes: 7 additions & 1 deletion deploy/helm/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ spec:
name: cni
- mountPath: /opt/cni/bin
name: kmesh-cni-install-path
- mountPath: /host/proc
name: host-procfs
readOnly: true
- mountPath: /var/run/secrets/istio
name: istiod-ca-cert
- mountPath: /var/run/secrets/tokens
Expand All @@ -90,6 +93,10 @@ spec:
- hostPath:
path: /opt/cni/bin
name: kmesh-cni-install-path
- name: host-procfs
hostPath:
path: /proc
type: Directory
- configMap:
defaultMode: 420
name: istio-ca-root-cert
Expand All @@ -102,4 +109,3 @@ spec:
audience: istio-ca
expirationSeconds: 43200
path: istio-token
hostPID: true
8 changes: 7 additions & 1 deletion deploy/yaml/kmesh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ spec:
- name: kmesh-cni-install-path
hostPath:
path: /opt/cni/bin
- name: host-procfs
hostPath:
path: /proc
type: Directory
- name: istiod-ca-cert
configMap:
defaultMode: 420
Expand Down Expand Up @@ -105,6 +109,9 @@ spec:
- name: kmesh-cni-install-path
mountPath: /opt/cni/bin
readOnly: false
- mountPath: /host/proc
name: host-procfs
readOnly: true
- name: istiod-ca-cert
mountPath: /var/run/secrets/istio
- name: istio-token
Expand All @@ -116,4 +123,3 @@ spec:
cpu: "1"
priorityClassName: system-node-critical
serviceAccountName: kmesh
hostPID: true
4 changes: 2 additions & 2 deletions pkg/controller/bypass/bypass_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func getnspath(pod *corev1.Pod) (string, error) {
if err != nil {
return "", err
}
res = path.Join("/proc", res)
res = path.Join("/host/proc", res)
return res, nil
}

Expand All @@ -287,7 +287,7 @@ func BuiltinOrDir(dir string) fs.FS {

func FindNetnsForPod(pod *corev1.Pod) (string, error) {
netnsObserved := sets.New[uint64]()
fd := BuiltinOrDir("/proc")
fd := BuiltinOrDir("/host/proc")

entries, err := fs.ReadDir(fd, ".")
if err != nil {
Expand Down

0 comments on commit c3b6ec1

Please sign in to comment.