Một phần mền nội tiếng là wireshark thì trên k8s chúng ta có Kubeshark
Kubeshark is an observability and monitoring tool for Kubernetes, enabling dynamic analysis of the microservices, detecting anomalies and triggering functions when certain patterns appear in runtime.
1) Install Kubeshark via helm chart
Đâu tiên các bạn cần đăng nhập và lấy token:
https://console.kubeshark.co/
Sau khi đã có token thì bạn tiến hành define valuefile:
###valuefile: license: xxxxxx tap: ingress: enabled: true classname: nginx host: kubeshark.xxsvideo.com
Kubeshark’s Helm repository:
https://helm.kubeshark.co
2) Install Kubeshark via CLI
Bạn cần có 1 máy tình cài tool của kubeshark
sh <(curl -Ls https://kubeshark.co/install)
Tiếp đến là chúng ta run command để filter theo pods
kubeshark tap "(eng-mdfsembd*)"
Bạn có thể thấy là tool nó sẽ helm install để cài kubeshark vào trong cluster.
Lúc này bạn chỉ cần forward port service ra localhost và truy cập.
Đây là web:
Mình có lấy được file value:
config: {} dumpLogs: false headless: false kube: configPath: "" context: "" license: "" logs: file: "" manifests: dump: false scripting: env: {} source: "" watchScripts: true tap: annotations: {} auth: approvedDomains: [] approvedEmails: [] approvedTenants: [] enabled: false debug: false defaultFilter: "" docker: imagePullPolicy: Always registry: docker.io/kubeshark tag: "" dryRun: false efsFileSytemIdAndPath: "" ignoreTainted: false ingress: annotations: {} className: "" enabled: false host: ks.svc.cluster.local tls: [] ipv6: true labels: {} namespaces: [] noKernelModule: false nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/os operator: In values: - linux persistentStorage: false persistentStorageStatic: false proxy: front: port: 8899 host: 127.0.0.1 hub: srvPort: 8898 worker: srvPort: 30001 regex: (eng-mdfsembd*) release: name: kubeshark namespace: default repo: https://helm.kubeshark.co resources: hub: limits: cpu: 750m memory: 1Gi requests: cpu: 50m memory: 50Mi worker: limits: cpu: 750m memory: 1Gi requests: cpu: 50m memory: 50Mi serviceMesh: true storageClass: standard storageLimit: 500Mi telemetry: enabled: true tls: true
View toàn bộ traffic on all namespaces:
kubeshark tap -A
Để xóa kubeshark.
kubeshark clean
tham khảo thêm các command ở đây:
https://docs.kubeshark.co/en/install
Mình có 1 issue:
“Kubeshark” Metrics not available at the moment