Ref: https://elixir.bootlin.com/linux/v2.6.39/source/kernel/trace/trace.h#L246
struct tracer nop_trace __read_mostly =| filter := new(property.WaitFilter) | |
| filter.Add(dc.VmFolder, "VirtualMachine", []string{"runtime.host"}) | |
| return property.WaitForUpdates(ctx, p, filter, func(updates []types.ObjectUpdate) bool { | |
| fmt.Println("updates: ", updates) | |
| return false // keep waiting | |
| }) |
| testenv := test.NewTestEnvironment() | |
| shutdown := make(chan struct{}) | |
| cfg := testenv.Start(apis.GetAllApiBuilders(), openapi.GetOpenAPIDefinitions) | |
| si := sharedinformers.NewSharedInformers(cfg, shutdown) | |
| defer func() { | |
| testenv.Stop() | |
| close(shutdown) | |
| }() | |
| # Source this at node as root | |
| # install calicoctl | |
| curl -O -L https://github.com/projectcalico/calicoctl/releases/download/v2.0.7/calicoctl | |
| chmod +x calicoctl | |
| mv calicoctl /usr/local/bin | |
| # Imagine dstype is kubernetes | |
| # otherwise need this: ETCD_ENDPOINTS=http://myhost1:2379 | |
| export DATASTORE_TYPE=kubernetes |
| # sudo ./build/example_grpc/katran_server_grpc -balancer_prog ./deps/linux/bpfprog/bpf/balancer_kern.o -default_mac 52:54:00:12:35:02 -forwarding_cores=0 -healthchecker_prog ./deps/linux/bpfprog/bpf/healthchecking_ipip.o -intf=lo -ipip_intf=ipip0 -ipip6_intf=ipip60 -lru_size=10000 -v=4 2>&1 >server.log | |
| I1120 21:21:01.783613 20922 katran_server.cpp:111] size of forwarding cores vector is 1 | |
| I1120 21:21:01.783656 20922 katran_server.cpp:113] size of numa nodes vector is 0 | |
| I1120 21:21:01.783850 20922 KatranGrpcService.cpp:67] Starting Katran | |
| I1120 21:21:01.783865 20922 KatranLb.cpp:215] per core lru size: 10000 | |
| I1120 21:21:01.784356 20922 BpfLoader.cpp:452] section name: .strtab index: 1 | |
| data: 0x5565272ddb60 size: 970 | |
| link: 0 | |
| E1120 21:21:01.784365 20922 BpfLoader.cpp:166] Can't read section size for index: 2 |
| package main | |
| import ( | |
| "context" | |
| "log" | |
| "net/http" | |
| "time" | |
| ) | |
| func delayedHandler(w http.ResponseWriter, r *http.Request) { |
| Chain INPUT (policy DROP) | |
| target prot opt source destination | |
| KUBE-EXTERNAL-SERVICES all -- anywhere anywhere ctstate NEW /* kubernetes externally-visible service portals */ | |
| KUBE-FIREWALL all -- anywhere anywhere | |
| ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED | |
| ACCEPT all -- anywhere anywhere | |
| ACCEPT icmp -- anywhere anywhere | |
| ACCEPT tcp -- anywhere anywhere tcp dpt:ssh | |
| ACCEPT tcp -- anywhere anywhere | |
| ACCEPT udp -- anywhere anywhere |
| -A PREROUTING -m comment --comment "kubernetes service portals" -j KUBE-SERVICES | |
| -A OUTPUT -m comment --comment "kubernetes service portals" -j KUBE-SERVICES | |
| -A POSTROUTING -m comment --comment "kubernetes postrouting rules" -j KUBE-POSTROUTING | |
| -A POSTROUTING -m comment --comment "ip-masq: ensure nat POSTROUTING directs all non-LOCAL destination traffic to our custom IP-MASQ chain" -m addrtype ! --dst-type LOCAL -j IP-MASQ | |
| -A IP-MASQ -d 169.254.0.0/16 -m comment --comment "ip-masq: local traffic is not subject to MASQUERADE" -j RETURN | |
| -A IP-MASQ -d 10.0.0.0/8 -m comment --comment "ip-masq: RFC 1918 reserved range is not subject to MASQUERADE" -j RETURN | |
| -A IP-MASQ -d 172.16.0.0/12 -m comment --comment "ip-masq: RFC 1918 reserved range is not subject to MASQUERADE" -j RETURN | |
| -A IP-MASQ -d 192.168.0.0/16 -m comment --comment "ip-masq: RFC 1918 reserved range is not subject to MASQUERADE" -j RETURN | |
| -A IP-MASQ -d 240.0.0.0/4 -m comment --comment "ip-masq: RFC 5735 reserved range is not subject to MASQUERADE" -j RE |
| # kubectl exec kube-keepalived-vip-2djmq cat /etc/keepalived/keepalived.conf | |
| global_defs { | |
| vrrp_version 3 | |
| vrrp_iptables KUBE-KEEPALIVED-VIP | |
| } | |
| #Check if the VIP list is empty | |
| vrrp_instance vips { |
| # Node status | |
| status: | |
| addresses: | |
| - address: 10.128.15.209 | |
| type: InternalIP | |
| - address: 104.198.153.58 | |
| type: ExternalIP | |
| - address: gke-cluster-4-default-pool-606b8fc7-jqmx.c.ygui-gke.google.com.internal | |
| type: InternalDNS |
Ref: https://elixir.bootlin.com/linux/v2.6.39/source/kernel/trace/trace.h#L246
struct tracer nop_trace __read_mostly =