This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // eBPF section named socket, indicating that it is intended for socket handling | |
| SET("socket") | |
| int socket_handler(struct __sk_buff *skb) | |
| { | |
| struct so_event *e; | |
| __u8 verlen; | |
| __u16 proto; | |
| __u32 nhoff = ETH_HLEN; | |
| __u32 ip_proto = 0; | |
| __u32 tcp_hdr_len = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type logger struct { | |
| next handler.EventHandler | |
| } | |
| func log(next handler.EventHandler) handler.EventHandler { | |
| return &logger{next: next} | |
| } | |
| // Implement handler.EventHandler interface | |
| func (l *logger) Create(ctx context.Context, evt event.CreateEvent, q workqueue.RateLimitingInterface) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| prometheus_port=9090 | |
| host_port=$(( ((RANDOM<<15)|RANDOM) % 49152 + 10000)) | |
| kubectl port-forward prometheus-monitoring-prometheus-0 -n kyma-system $host_port:$prometheus_port >/dev/null 2>&1 & | |
| pid=$! | |
| until nc -z localhost $host_port | |
| do | |
| sleep 1 |