1 of 28

Knative Pluggability

mattmoor@google.com (@mattomata)

Last Updated: 2018-Aug-08

SHARED PUBLICLY

2 of 28

The Goal.

Knative aims to be “loosely coupled at the top, and pluggable at the bottom”[1].

… but we are not today.

3 of 28

Loosely coupled at the top

Eventing

n

Serving

n

Build

n

???

???

Use Knative components with non-Knative components that satisfy some contract/interface.

4 of 28

Pluggable at the bottom

Eventing

n

Serving

n

The focus of this presentation.

KPA

n

5 of 28

Background

6 of 28

Kubernetes Ingress

apiVersion: extensions/v1beta1

kind: Ingress

metadata:

name: test-ingress

spec:

rules:

- http:

paths:

- path: /testpath

backend:

serviceName: test

servicePort: 80

1 resource definition,

N controller implementations.

  • GCP L7
  • nginx
  • Istio
  • Heptio Contour
  • ...

7 of 28

Kubernetes Ingress (cont’d)

apiVersion: extensions/v1beta1

kind: Ingress

metadata:

name: test-ingress

annotations:

impl.io/foo: bar

spec:

rules:

- http:

paths:

- path: /testpath

backend:

serviceName: test

servicePort: 80

Pass implementation-specific configuration through annotations.

8 of 28

High-level Idea

9 of 28

Broad Strokes

  • Determine the places Knative should be pluggable,
  • Define a standard CRD to encapsulate the functionality we need,
  • Implement interchangeable controllers for this common definition.

10 of 28

Pluggable at the bottom (revisited)

Eventing

n

Serving

n

kIngress

n

Autoscaling

n

Choose your own adventure...

ImageCache

n

Build

n

CRDs

Implementations

11 of 28

Example: Autoscaler

12 of 28

Pluggable at the bottom (Autoscaler)

Serving

n

KPA

n

Autoscaling

n

HPA

Implementations

CRD (autoscaling.knative.dev/v1alpha1/Bikeshed)

13 of 28

Goal: Pluggable Autoscalers

A rough version of this as “KPA” was pitched in #1655, before seeing the pattern or alignment with the Kubernetes Ingress pattern.

  • Define a common “KPA” interface for configuring autoscaling.
  • Move our autoscaling implementation into a separate controller on this resource.

14 of 28

Example: Ingress 2.0

… or is it Ingress++?

15 of 28

Pluggable at the bottom (Ingress)

Eventing

n

Ingress

2.0

Implementations

CRD (networking.knative.dev/v1alpha1/Bikeshed)

Serving

n

16 of 28

Goal: Pluggable Ingress

Kubernetes Ingress is close, but lacking:

  • Traffic Splitting (Route)
  • Cross-Namespace routing (Route + Activator)
  • Method-based routing (API Gateways)
  • Request rewriting (Recording split decision for activator)

… we likely want the evolution of Kubernetes Ingress, but its coupling with K8s is unfortunate. Maybe it needs to evolve into a CRD outside K8s?

17 of 28

Goal: Pluggable Ingress (cont’d)

  • Extend Kubernetes IngressSpec:
    • Address gaps, aim for back-compat to ease porting.

  • Expose new Ingress and ClusterIngress CRDs that use the updated spec.
    • Disallow “Namespace” in the former

… and provide a base implementation around Istio (to match what we use today).

18 of 28

Example: Image Cache

19 of 28

Pluggable at the bottom (Image Caching)

Eventing

n

Serving

n

ImageCache

n

Nothing

Build

n

Implementations

CRD (something.knative.dev/v1alpha1/Bikeshed)

20 of 28

Goal: Improve Pod Start Latency

Variety of possible strategies, with a variety of operational costs

  • A useful knob for tuning operational cost vs. performance

… get abstraction in place, and measure.

21 of 28

But why?

22 of 28

So why is this interesting? Win / Win.

  • Better formalize our functional contract between components.
    • Clearer roles and responsibilities is good for us.

  • Providing users with choice is good.
    • A lot of early criticism for the heavy Istio dependency.
    • Let the best solution win.
  • Providing operators a means to plug in customizations.
    • Hosted offerings can plug in implementations that better integrate Knative with their platform.

23 of 28

How do we qualify plugins?

24 of 28

How do we qualify plugins?

  1. Plugin to Knative
  2. ???
  3. Profit!

Conformance!

25 of 28

The elephant in the room

26 of 28

Google drawing doesn’t have a nonagon.

Serving

n

10 sides!

27 of 28

I’m sorry...

28 of 28

Questions?