Upgrade to Pro — share decks privately, control downloads, hide ads and more …

KubeCon EU 2024 : Knative Maintainers Session

Salaboy
March 23, 2024

KubeCon EU 2024 : Knative Maintainers Session

for more information visit: https://salaboy.com

Salaboy

March 23, 2024
Tweet

More Decks by Salaboy

Other Decks in Technology

Transcript

  1. Agenda • Knative Overview • Quick Project Updates • Functions

    Overview • Functions Demo • f(Knative Serving)=❤
  2. Knative Overview • Kubernetes based open source building blocks for

    serverless • Founded - 2018 • CNCF Incubating - 2022 • knative.dev
  3. Knative • Serving ◦ Autoscales your workloads based on traffic

    - can scale to zero • Eventing ◦ Declaratively bind consumers and producers of events • Client (kn) ◦ Create resources interactively from the command line • Functions ◦ A programming model to simplify development
  4. Knative Project Updates • User Experience WG ◦ Sourcing People

    for User Interviews! ▪ Sign up @ https://bit.ly/knative-user-interview
  5. Knative Project Updates • Client WG ◦ Held a 48

    Hour Hackathon with Prizes ◦ Check out the Wrap Up Presentation
  6. Knative Project Updates • Eventing WG ◦ Eventing transport encryption

    (Eventing TLS) ◦ Improved Event Discovery ◦ Event Catalog with Backstage ◦ net-eventing-rabbitmq will be picked up by the RabbitMQ Team
  7. Functions Demo • Keypoints ◦ Function lifecycle (instance based functions)

    ◦ Non-opinionated function runtime ◦ Host builder ◦ Build and Deploy independently
  8. Serving + Functions • Higher Level Abstraction than Kubernetes •

    Container ⇒ URL • Autoscales your workloads based on traffic ◦ Scales to Zero • Automatic Certificate Provisioning for HTTPS • Revision Management & Traffic Splitting • Automatic Health Checks
  9. Serving + Functions • Higher Level Abstraction than Kubernetes •

    Container ⇒ URL apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: my-func apiVersion: apps/v1 kind: Deployment metadata: name: my-func spec: selector: matchLabels: app: my-func replicas: 2 template: metadata: labels: app: my-func spec: containers: - name: my-func image: my-func:2.0 ports: - containerPort: 80 https://my-func.default.example.com apiVersion: v1 kind: Service metadata: name: my-func spec: selector: app: my-func ports: - port: 80 protocol: TCP targetPort: 80 apiVersion: v1 kind: Ingress metadata: name: my-func spec: rules: - http: my-func paths: - path: / backend: serviceName: my-func servicePort: 80 apiVersion: v1 kind: Service metadata: name: my-func spec: selector: app: my-func ports: - port: 80 protocol: TCP targetPort: 80 apiVersion: serving.knative.dev/v1 kind: Service metadata: name: my-func spec: template: spec: containers: - image: my-func:2.0 ports: - containerPort: 80
  10. Serving + Functions • Autoscales your workloads based on traffic

    apiVersion: serving.knative.dev/v1 kind: Service metadata: name: nginx spec: template: spec: containerConcurrency: 1 containers: - image: nginx:1.14.2 ports: - containerPort: 80 Concurrency Number of simultaneous requests that can be processed by each replica of an application at any given time.
  11. Serving + Functions Pod my-func Pod my-func Pod my-func 3

    requests concurrency = 1 concurrency = 80 Pod my-func 3 requests
  12. Serving + Functions concurrency = 1 concurrency = 80 Source:

    https://cloud.google.com/run/docs/about-concurrency
  13. Serving + Functions • Concurrency ◦ Using low values ~1

    ▪ More instances spin up ▪ Can hit K8s limits faster (eg. max # pods on a node) ◦ Using >1 ▪ Requires more Memory & CPU ▪ Can’t use Global State ◦ Tune the value to your function
  14. • Burst Capacity Ingress Serving + Functions Pod my-func Activator

    https://knative.dev/docs/serving/load-balancing/target-burst-capacity
  15. • Burst Capacity Ingress Serving + Functions Pod my-func Activator

    https://knative.dev/docs/serving/load-balancing/target-burst-capacity Pod my-func Pod my-func Pod my-func
  16. • Burst Capacity ◦ Configured via annotation on the Revision

    Ingress Serving + Functions Pod my-func Activator https://knative.dev/docs/serving/load-balancing/target-burst-capacity Pod my-func Pod my-func Pod my-func autoscaling.knative.dev/target-burst-capacity: "200"