add http2_grpc pusher
@@ -10,7 +10,7 @@ import (
"k8s.io/client-go/tools/clientcmd"
"lmp/eBPF_Supermarket/cilium_ebpf_probe/cluster_utils"
"lmp/eBPF_Supermarket/cilium_ebpf_probe/http2_tracing"
- //"lmp/eBPF_Supermarket/cilium_ebpf_probe/http_kprobe"
+ "lmp/eBPF_Supermarket/cilium_ebpf_probe/http_kprobe"
//
// Uncomment to load all auth plugins
// _ "k8s.io/client-go/plugin/pkg/client/auth"
@@ -53,23 +53,23 @@ func main() {
// - And/or cast to StatusError and use its properties like e.g. ErrStatus.Message
namespace := "wyw"
/*******kprobe on pod************/
- //pod := "httpserver"
- //p, err := clientset.CoreV1().Pods(namespace).Get(context.TODO(), pod, metav1.GetOptions{})
- //if errors.IsNotFound(err) {
- // fmt.Printf("Pod %s in namespace %s not found\n", pod, namespace)
- //} else if statusError, isStatus := err.(*errors.StatusError); isStatus {
- // fmt.Printf("Error getting pod %s in namespace %s: %v\n",
- // pod, namespace, statusError.ErrStatus.Message)
- //} else if err != nil {
- // panic(err.Error())
- //} else {
- // fmt.Printf("Found pod %s in namespace %s\n", pod, namespace)
- // res, _ := cluster_utils.GetAllPodProcess(clientset, "k8s-node2", namespace, pod, p.Status.ContainerStatuses)
- // for k, v := range res {
- // fmt.Printf("get pod %s Pid and Attach Kprobe\n", k.Name)
- // go http_kprobe.GetHttpViaKprobe(int(v[0].Pid), pod)
- // }
- //}
+ pod := "httpserver"
+ p, err := clientset.CoreV1().Pods(namespace).Get(context.TODO(), pod, metav1.GetOptions{})
+ if errors.IsNotFound(err) {
+ fmt.Printf("Pod %s in namespace %s not found\n", pod, namespace)
+ } else if statusError, isStatus := err.(*errors.StatusError); isStatus {
+ fmt.Printf("Error getting pod %s in namespace %s: %v\n",
+ pod, namespace, statusError.ErrStatus.Message)
+ } else if err != nil {
+ panic(err.Error())
+ } else {
+ fmt.Printf("Found pod %s in namespace %s\n", pod, namespace)
+ res, _ := cluster_utils.GetAllPodProcess(clientset, "k8s-node2", namespace, pod, p.Status.ContainerStatuses)
+ for k, v := range res {
+ fmt.Printf("get pod %s Pid and Attach Kprobe\n", k.Name)
+ go http_kprobe.GetHttpViaKprobe(int(v[0].Pid), pod)
+ }
+ }
/*******uprobe on pod************/
poduprobe := "grpcserver"
