Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Latest commit

 

History

History
144 lines (109 loc) · 5.7 KB

README.md

File metadata and controls

144 lines (109 loc) · 5.7 KB

Episode 153 : "KubeProxy and KPNG"

  • Hosted by @jayunit100, @rikatz, @mclaseau
  • Recording date: 2021-04-30

This week we are going to hop around and look at whats goin on w/ Kube proxy:

  • the backlog: a good way to get a feel for some of the KP pain points
  • the KPNG project: a decoupled, easy to extend KP for the future

Table of Contents

Week in Review

VLADs new test framework

https://github.com/vladimirvivien/e2e-framework/blob/initial-poc/examples/suites/hello2_test.go

INGRESS vs GATEWAY

https://kubernetes.io/docs/concepts/services-networking/ingress/ vs https://kubernetes.io/blog/2021/04/22/evolving-kubernetes-networking-with-the-gateway-api/

NETPOL Subproject Status

Show Notes

Why were going to talk about KPNG

KPNG KEP !

https://github.com/kubernetes/enhancements/pull/2094/files

KUBE PROXY AS A BOTTLENECK

LOOK AT THIS COPY PASTE !

KPNG SOLVES

  • DaemonSet problem
  • Decoupling/TechDebt problem

Understanding kube-proxy rules

KPNG Demo

KPNG ARCHITECTURE

BUILD KIND FROM SOURCE

GENERIC KPNG CLUSTER SETUP

https://github.com/kubernetes-sigs/kpng/tree/master/hack

KPNG arch Notes:

  • Jobs: all processes are Jobs, each Job type is a different struct. A job is essentially a way of representing a controller.
  • WatchState: WatchState connects the Sink with the store2localdiff functionality.
    • Initially empty.
    • Triggered by store2localdiff (store2local) or store2globaldiff (store2api or store2file)
    • When triggered...
      • revieves a localnet.v1Service (foo)
      • calculate the diff between empty vs localnet.v1Service 'foo'
      • calls the SendUpdate to the Sink
  • What is a Sink?
    • GenericSink: Generic impl of the Diff2EventLoop (a utility used by LocalSink and Global Sinc)
    • Sink interfaces which compose w/ the generic sinc:
      • LocalSink: used by store2local
      • GlobalSink: store2globaldiff used by the store2api
  • There are 2 ways to run a backend:
    • by specifying it on startup: kpng kube to-local to-nft runs everything in local memory.
    • by separating server + client: kpng kube to-api + kube-proxy-nft in a separate process which comms over GRPC
  • KPNG Startup
    • Watchers (i.e. kube)
      • Start watchers: PICK ONE!!!
        • kpng file watches statefile ~ file2store
          • to-api, to-file, to-local ~ pick store consumer(s)
        • kpng kube watches apiserver ~ kube2store
          • to-api, to-file, to-local ~ pick store consumer(s)
        • api2store NOT THERE YET !!!
    • Consumers (i.e. to-file or to-local or... ) + (to-nft, to-ipvs, ...)
      • store2file.View(...) service - blocks
        • view(...)
          • every time something changes
            • for node, add node to local file
            • for service:
              • lookup all endpoints in proxystore
                • add those endpoints
      • store2Diff.View(...)
        • view(...)
          • send Diff to the Since (STILL SAME MEMORY SPACE)
    • store2diff.View(...) services - blocks
      • wait(...)
      • view(...)
        • every time something changes
  • User creates a service 'foo' (no endpoints yet)
    • kube2store.controller
      • Watch()<-- sees v1.Service
        • service-event-handler.go triggered
          • func (h *serviceEventHandler) OnAdd(obj interface{}) {
          • KPNG optimizes the v1.Service data
            • so that it doesnt trigger unc events
            • so that the storage size is min
            • proxystore.go (Update)
              • revision incremented (so clients can know if theyre uptodate)
              • store2File() triggers the view(...) funciton above
              • store2Local (relise on store2Diff) + store2LocalDiff() triggers the view(...) function
  • User creates a pod