SlideShare a Scribd company logo
Knative Outro
n3wscott@knative.team
@n3wscott ( , , )
Who am I?
● Riot Games (2012 - 2015)
○ Thrown under the bus to work on an emerging infra project (chef targeting VMs)
● Google (2015 - 2019)
○ Tried my hand at desktop apps, Chrome. Thought about farming instead.
○ Transferred into Google Cloud, worked on OSS - Kubernetes Service Catalog
■ I joined when the project was still an aggregated API server, made the case for CRDs
○ Fought hard for the team to pivot to the “Kubernetes Resource Model”
■ End result: Google Config Connector.
○ Bounced out before it got going, thought the world needed Knative First.
■ Landed in Knative Eventing.
■ Started the Eventing Sources Working Group.
■ Became a Productivity Working group leave several months ago.
● VMware (2019 - present)
○ Keeping the Knative OSS dreams alive.
■ Vote for me! I am running for Knative ToC 2021 :D
What is duck typing? “If it looks like a duck, swims like a duck, and
quacks like a duck, then it probably is a duck.”
In computer science, there are two ways to implement interfaces, the direct way, like Java:
public interface Animal {...}
public class Mammal implements Animal {...}
type Animal interface {...}
type Mammal struct {...}
animal, ok := mammal.(Animal)
Or the inferred way, like Go:
Both ways let the integrator interact with objects through a contract, duck typing allows for
the implementation to not be aware of that contract, and the integrator to not need to be
fully aware of the implementation.
Other kinds of duck typing?
We also duck type on resource type negotiation, like the double decode JSON pattern:
1. Receive some JSON
2. Decode that JSON into a common base object and inspect it, extract a type hint.
3. Use the type hint to further decode it into a known type.
{
“type”: “foo.bar.baz”,
“foo”: “abc”,
“bar”: 123,
“baz”: [“one”, “two”]
}
struct base type {
Type string
}
struct fooBarBaz type {
Type string
Foo string
Bar int
Baz []string
}
1
2
3
Here, base is the duck type, the contract to get type.
Duck Typing in Kubernetes
Case Study: Cluster API
Required status fields
The InfrastructureCluster object must have a status object.
The spec object must have the following fields defined:
● controlPlaneEndpoint - identifies the endpoint used to
connect to the target’s cluster apiserver.
The status object must have the following fields defined:
● ready - a boolean field that is true when the infrastructure is
ready to be used.
kind: MyProviderCluster
apiVersion:
infrastructure.cluster.x-k8s.io/v1alpha3
spec:
controlPlaneEndpoint:
host: example.com
port: 6443
status:
ready: true
Contract
Instance
https://cluster-api.sigs.k8s.io/developer/architecture/controllers/cluster.html
Case Study: KEDA
// WithTriggers is a specification for a resource with triggers
type WithTriggers struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec WithTriggersSpec `json:"spec"`
}
// WithTriggersSpec is the spec for a an object with triggers resource
type WithTriggersSpec struct {
PollingInterval *int32 `json:"pollingInterval
Triggers []ScaleTriggers `json:"triggers"`
}
apiVersion: keda.sh/v1alpha1
kind: ScaledJob
metadata:
name: azure-storage-queue-consumer
namespace: default
spec:
jobTargetRef:
template:
spec:
containers:
- name: azure-storage-queue-receive
image: azure-storage-queue-client:dev
imagePullPolicy: Always
command: ["receive"]
envFrom:
- secretRef:
name: azure-storage-queue-secret
restartPolicy: Never
backoffLimit: 4
triggers:
- type: azure-queue
authenticationRef:
name: azure-queue-auth
metadata:
queueName: "hello"
Contract
Instance
https://github.com/kedacore/sample-go-storage-queue/
Case Study: Knative Addressable
apiVersion: group/version
kind: Kind
status:
address:
url: http://host/path?query
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: colors
namespace: default
spec: ...
status:
address:
url: http://colors.default.svc.cluster.local
conditions:
- lastTransitionTime: "2021-04-23T22:43:48Z"
status: "True"
type: Ready
- ...
latestCreatedRevisionName: colors-00005
latestReadyRevisionName: colors-00005
observedGeneration: 9
...
Contract
Instance
https://github.com/knative/docs/blob/main/docs/concepts/_index.md
Full Picture
Components:
● Control Plane Contract (Shape of resource)
● Behavioural Contract (how it should interpret or express that contract)
● RBAC, Using an Aggregated Role.
🦆 Controller
Service Account
Role Binding
+ Label Selector
Role X
Role Y
Role Z
Duck Typing in Action
Results Contract
type Results struct {
Expression string `json:"expression,omitempty"`
Result int `json:"result"`
}
type ResultsType struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Status ResultsStatus `json:"status"`
}
type ResultsStatus struct {
Results `json:",inline"`
}
`status.expression` is the human
readable form of the equation
represented by the resource
instance.
`status.result` is a numerical result
of the expression.
Results Contract
apiVersion: maths.tableflip.dev/v1alpha1
kind: Add
metadata:
name: add-few
spec:
add:
- value: 1
- value: 2
- value: 3
- value: 4
status:
conditions:
- lastTransitionTime: "2021-04-26T21:21:52Z"
status: "True"
type: Ready
expression: 1 + 2 + 3 + 4
observedGeneration: 1
result: 10
Add as duck type of the Results Contract
Add contract
Ref points to a resource that
implements the Results duck type.
Add is also a Results duck type.
This lets us view a resource as a
Results but also point at resources
that the operator has claimed are also
Results.
The controller that realizes Add knows
only the duck type contract when
inspecting the object Ref points at.
apiVersion: maths.tableflip.dev/v1alpha1
kind: Add
metadata:
name: add-refs
spec:
add:
- value: 1
- ref:
name: add-one
namespace: default
kind: Add
apiVersion: maths.tableflip.dev/v1alpha1
- ref:
name: add-few
namespace: default
kind: Add
apiVersion: maths.tableflip.dev/v1alpha1
apiVersion: maths.tableflip.dev/v1alpha1
kind: Subtract
metadata:
name: minus-7
spec:
sub:
- ref:
name: 3-plus
namespace: default
kind: Add
apiVersion: maths.tableflip.dev/v1alpha1
- value: 7
status:
conditions:...
expression: (3 + (1 + 2)) - 7
observedGeneration: 1
result: -1
apiVersion: maths.tableflip.dev/v1alpha1
kind: Add
metadata:
name: one-two
spec:
add:
- value: 1
- value: 2
status:
conditions:...
expression: 1 + 2
observedGeneration: 1
result: 3
apiVersion: maths.tableflip.dev/v1alpha1
kind: Add
metadata:
name: 3-plus
spec:
add:
- value: 3
- ref:
name: one-two
namespace: default
kind: Add
apiVersion: maths.tableflip.dev/v1alpha1
status:
conditions:...
expression: 3 + (1 + 2)
observedGeneration: 1
result: 6
Let’s make a duck.
Knative Dependency
Injection
Definitions
● Controller
○ A standard shell around Reconciler, to provide required setup.
● Reconciler
○ Control plane business logic centered around a single resource.
● Client
○ A generated RESTful client for interacting with the Kubernetes API Server to do CRUD.
● Informer
○ Sets up static watches with the Client to a cache. Tells you when the resource you are
interested in has had an update.
● Lister
○ Similar to the Client but read only for the shared cache.
rec·on·cile, settle
(a disagreement).
rec·on·cile, make
changes to current
state to become
closer to desired
state.
Desired State
K8s
API
Server
Reconciler
K8s
API
Server
Controller
Client
🗝
Informers
Listers Reconciler
cache
Shared State
K8s
API
Server
Controller
Client
🗝
Informers
Listers Reconciler
cache
Steps to Reconcile
1. Create Clients
2. Create Informers and Listers from that Client
a. This builds a cache for that client and connects the Informers and Listers.
3. Provide those Informers, Listers and Clients to a Controller Constructor
4. Start threads for Informers
5. Start threads for Controllers
1. Create Clients
2. Create Informers and Listers
from that Client
3. Provide those Informers,
Listers and Clients to a
Controller Constructor
4. Start threads for Informers
5. Start threads for Controllers
1. Create Clients
2. Create Informers and Listers
from that Client
3. Provide those Informers,
Listers and Clients to a
Controller Constructor
4. Start threads for Informers
5. Start threads for Controllers
1. Create Clients
2. Create Informers and Listers
from that Client
3. Provide those Informers,
Listers and Clients to a
Controller Constructor
4. Start threads for Informers
5. Start threads for Controllers
"These 200+ lines of
code will stay in-sync
with the rest of
Knative."
- no one
We want to write this:
K8s
API
Server
Controller
Client
🗝
Informers
Listers Reconciler
cache
We have to deal with these:
K8s
API
Server
Controller
Client
🗝
Informers
Listers Reconciler
cache
Main
makes
🗝🐌🐚
Controller
wants
🐌🐚
makes
💵⚒
🗝 - Creds
🐌 - Client
🐚 - Informer
💵 - Lister
⚒ - Reconciler
Dependency Graph
🗝
🗝 - Creds
🐌 - Client
🐚 - Informer
💵 - Lister
⚒ - Reconciler
🐌
🐚
💵
⚒
Needs Graph
🗝
🗝 - Creds
🐌 - Client
🐚 - Informer
💵 - Lister
⚒ - Reconciler
🐌
🐚
💵
⚒
Steps to Reconcile
1. Ask for Clients
2. Ask for Informers
a. These ask for Clients
3. Use Informers to make Listers
4. Provide those Informers, Listers and Clients to a Controller Constructor
We standardized how
Knative main methods
ask for creds and
setup configs.
So this code can all
be shared.
We standardized how
Knative controllers ask
for clients and
informers.
So this code can all
be generated.
Generated Client Injection Code

More Related Content

What's hot

Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?
SegFaultConf
 
Best Practices in Qt Quick/QML - Part I
Best Practices in Qt Quick/QML - Part IBest Practices in Qt Quick/QML - Part I
Best Practices in Qt Quick/QML - Part I
ICS
 
Bringing Transactional Guarantees to MongoDB
Bringing Transactional Guarantees to MongoDBBringing Transactional Guarantees to MongoDB
Bringing Transactional Guarantees to MongoDB
Paul Robinson
 
Finatra v2
Finatra v2Finatra v2
Finatra v2
Steve Cosenza
 
Angular Interview Questions & Answers
Angular Interview Questions & AnswersAngular Interview Questions & Answers
Angular Interview Questions & Answers
Ratnala Charan kumar
 
Typescript barcelona
Typescript barcelonaTypescript barcelona
Typescript barcelona
Christoffer Noring
 
Creating a Java EE 7 Websocket Chat Application
Creating a Java EE 7 Websocket Chat ApplicationCreating a Java EE 7 Websocket Chat Application
Creating a Java EE 7 Websocket Chat Application
Micha Kops
 
Angular.js Primer in Aalto University
Angular.js Primer in Aalto UniversityAngular.js Primer in Aalto University
Angular.js Primer in Aalto University
SC5.io
 
Html5 Interview Questions & Answers
Html5 Interview Questions & AnswersHtml5 Interview Questions & Answers
Html5 Interview Questions & Answers
Ratnala Charan kumar
 
Practical QML - Key Navigation, Dynamic Language and Theme Change
Practical QML - Key Navigation, Dynamic Language and Theme ChangePractical QML - Key Navigation, Dynamic Language and Theme Change
Practical QML - Key Navigation, Dynamic Language and Theme Change
Burkhard Stubert
 
Intro to Cocoa KVC/KVO and Bindings
Intro to Cocoa KVC/KVO and BindingsIntro to Cocoa KVC/KVO and Bindings
Intro to Cocoa KVC/KVO and Bindings
Sergio Acosta
 
Android development
Android developmentAndroid development
Android development
Gregoire BARRET
 
Introduction to Restkit
Introduction to RestkitIntroduction to Restkit
Introduction to Restkit
petertmarks
 
Difference between java script and jquery
Difference between java script and jqueryDifference between java script and jquery
Difference between java script and jquery
Umar Ali
 
JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...
JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...
JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...
PROIDEA
 
In-Depth Model/View with QML
In-Depth Model/View with QMLIn-Depth Model/View with QML
In-Depth Model/View with QML
ICS
 

What's hot (16)

Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?
 
Best Practices in Qt Quick/QML - Part I
Best Practices in Qt Quick/QML - Part IBest Practices in Qt Quick/QML - Part I
Best Practices in Qt Quick/QML - Part I
 
Bringing Transactional Guarantees to MongoDB
Bringing Transactional Guarantees to MongoDBBringing Transactional Guarantees to MongoDB
Bringing Transactional Guarantees to MongoDB
 
Finatra v2
Finatra v2Finatra v2
Finatra v2
 
Angular Interview Questions & Answers
Angular Interview Questions & AnswersAngular Interview Questions & Answers
Angular Interview Questions & Answers
 
Typescript barcelona
Typescript barcelonaTypescript barcelona
Typescript barcelona
 
Creating a Java EE 7 Websocket Chat Application
Creating a Java EE 7 Websocket Chat ApplicationCreating a Java EE 7 Websocket Chat Application
Creating a Java EE 7 Websocket Chat Application
 
Angular.js Primer in Aalto University
Angular.js Primer in Aalto UniversityAngular.js Primer in Aalto University
Angular.js Primer in Aalto University
 
Html5 Interview Questions & Answers
Html5 Interview Questions & AnswersHtml5 Interview Questions & Answers
Html5 Interview Questions & Answers
 
Practical QML - Key Navigation, Dynamic Language and Theme Change
Practical QML - Key Navigation, Dynamic Language and Theme ChangePractical QML - Key Navigation, Dynamic Language and Theme Change
Practical QML - Key Navigation, Dynamic Language and Theme Change
 
Intro to Cocoa KVC/KVO and Bindings
Intro to Cocoa KVC/KVO and BindingsIntro to Cocoa KVC/KVO and Bindings
Intro to Cocoa KVC/KVO and Bindings
 
Android development
Android developmentAndroid development
Android development
 
Introduction to Restkit
Introduction to RestkitIntroduction to Restkit
Introduction to Restkit
 
Difference between java script and jquery
Difference between java script and jqueryDifference between java script and jquery
Difference between java script and jquery
 
JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...
JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...
JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...
 
In-Depth Model/View with QML
In-Depth Model/View with QMLIn-Depth Model/View with QML
In-Depth Model/View with QML
 

Similar to Knative Outro

Automatically scaling Kubernetes workloads - SVC215-S - New York AWS Summit
Automatically scaling Kubernetes workloads - SVC215-S - New York AWS SummitAutomatically scaling Kubernetes workloads - SVC215-S - New York AWS Summit
Automatically scaling Kubernetes workloads - SVC215-S - New York AWS Summit
Amazon Web Services
 
Making Things Work Together
Making Things Work TogetherMaking Things Work Together
Making Things Work Together
Subbu Allamaraju
 
Communication Amongst Microservices: Kubernetes, Istio, and Spring Cloud with...
Communication Amongst Microservices: Kubernetes, Istio, and Spring Cloud with...Communication Amongst Microservices: Kubernetes, Istio, and Spring Cloud with...
Communication Amongst Microservices: Kubernetes, Istio, and Spring Cloud with...
VMware Tanzu
 
KFServing and Feast
KFServing and FeastKFServing and Feast
KFServing and Feast
Animesh Singh
 
Android application architecture
Android application architectureAndroid application architecture
Android application architecture
Romain Rochegude
 
Running gRPC Services for Serving Legacy API on Kubernetes
Running gRPC Services for Serving Legacy API on KubernetesRunning gRPC Services for Serving Legacy API on Kubernetes
Running gRPC Services for Serving Legacy API on Kubernetes
Sungwon Lee
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
mwillmer
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle Management
DoKC
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle Management
DoKC
 
Itb 2021 - Bulding Quick APIs by Gavin Pickin
Itb 2021 - Bulding Quick APIs by Gavin PickinItb 2021 - Bulding Quick APIs by Gavin Pickin
Itb 2021 - Bulding Quick APIs by Gavin Pickin
Gavin Pickin
 
ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...
ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...
ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...
Tobias Schneck
 
Dropwizard with MongoDB and Google Cloud
Dropwizard with MongoDB and Google CloudDropwizard with MongoDB and Google Cloud
Dropwizard with MongoDB and Google Cloud
Yun Zhi Lin
 
Interop 2018 - Understanding Kubernetes - Brian Gracely
Interop 2018 - Understanding Kubernetes - Brian GracelyInterop 2018 - Understanding Kubernetes - Brian Gracely
Interop 2018 - Understanding Kubernetes - Brian Gracely
Brian Gracely
 
Tech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagyTech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagy
Skills Matter
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
Rishabh Indoria
 
Operator SDK for K8s using Go
Operator SDK for K8s using GoOperator SDK for K8s using Go
Operator SDK for K8s using Go
CloudOps2005
 
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 RaleighKube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Brad Topol
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
Terry Cho
 
Salesforce and sap integration
Salesforce and sap integrationSalesforce and sap integration
Salesforce and sap integration
Karanraj Sankaranarayanan
 
What Does Kubernetes Look Like?: Performance Monitoring & Visualization with ...
What Does Kubernetes Look Like?: Performance Monitoring & Visualization with ...What Does Kubernetes Look Like?: Performance Monitoring & Visualization with ...
What Does Kubernetes Look Like?: Performance Monitoring & Visualization with ...
InfluxData
 

Similar to Knative Outro (20)

Automatically scaling Kubernetes workloads - SVC215-S - New York AWS Summit
Automatically scaling Kubernetes workloads - SVC215-S - New York AWS SummitAutomatically scaling Kubernetes workloads - SVC215-S - New York AWS Summit
Automatically scaling Kubernetes workloads - SVC215-S - New York AWS Summit
 
Making Things Work Together
Making Things Work TogetherMaking Things Work Together
Making Things Work Together
 
Communication Amongst Microservices: Kubernetes, Istio, and Spring Cloud with...
Communication Amongst Microservices: Kubernetes, Istio, and Spring Cloud with...Communication Amongst Microservices: Kubernetes, Istio, and Spring Cloud with...
Communication Amongst Microservices: Kubernetes, Istio, and Spring Cloud with...
 
KFServing and Feast
KFServing and FeastKFServing and Feast
KFServing and Feast
 
Android application architecture
Android application architectureAndroid application architecture
Android application architecture
 
Running gRPC Services for Serving Legacy API on Kubernetes
Running gRPC Services for Serving Legacy API on KubernetesRunning gRPC Services for Serving Legacy API on Kubernetes
Running gRPC Services for Serving Legacy API on Kubernetes
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle Management
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle Management
 
Itb 2021 - Bulding Quick APIs by Gavin Pickin
Itb 2021 - Bulding Quick APIs by Gavin PickinItb 2021 - Bulding Quick APIs by Gavin Pickin
Itb 2021 - Bulding Quick APIs by Gavin Pickin
 
ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...
ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...
ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...
 
Dropwizard with MongoDB and Google Cloud
Dropwizard with MongoDB and Google CloudDropwizard with MongoDB and Google Cloud
Dropwizard with MongoDB and Google Cloud
 
Interop 2018 - Understanding Kubernetes - Brian Gracely
Interop 2018 - Understanding Kubernetes - Brian GracelyInterop 2018 - Understanding Kubernetes - Brian Gracely
Interop 2018 - Understanding Kubernetes - Brian Gracely
 
Tech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagyTech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagy
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Operator SDK for K8s using Go
Operator SDK for K8s using GoOperator SDK for K8s using Go
Operator SDK for K8s using Go
 
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 RaleighKube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
 
Salesforce and sap integration
Salesforce and sap integrationSalesforce and sap integration
Salesforce and sap integration
 
What Does Kubernetes Look Like?: Performance Monitoring & Visualization with ...
What Does Kubernetes Look Like?: Performance Monitoring & Visualization with ...What Does Kubernetes Look Like?: Performance Monitoring & Visualization with ...
What Does Kubernetes Look Like?: Performance Monitoring & Visualization with ...
 

Recently uploaded

Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 

Recently uploaded (20)

Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 

Knative Outro

  • 2. Who am I? ● Riot Games (2012 - 2015) ○ Thrown under the bus to work on an emerging infra project (chef targeting VMs) ● Google (2015 - 2019) ○ Tried my hand at desktop apps, Chrome. Thought about farming instead. ○ Transferred into Google Cloud, worked on OSS - Kubernetes Service Catalog ■ I joined when the project was still an aggregated API server, made the case for CRDs ○ Fought hard for the team to pivot to the “Kubernetes Resource Model” ■ End result: Google Config Connector. ○ Bounced out before it got going, thought the world needed Knative First. ■ Landed in Knative Eventing. ■ Started the Eventing Sources Working Group. ■ Became a Productivity Working group leave several months ago. ● VMware (2019 - present) ○ Keeping the Knative OSS dreams alive. ■ Vote for me! I am running for Knative ToC 2021 :D
  • 3. What is duck typing? “If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck.” In computer science, there are two ways to implement interfaces, the direct way, like Java: public interface Animal {...} public class Mammal implements Animal {...} type Animal interface {...} type Mammal struct {...} animal, ok := mammal.(Animal) Or the inferred way, like Go: Both ways let the integrator interact with objects through a contract, duck typing allows for the implementation to not be aware of that contract, and the integrator to not need to be fully aware of the implementation.
  • 4. Other kinds of duck typing? We also duck type on resource type negotiation, like the double decode JSON pattern: 1. Receive some JSON 2. Decode that JSON into a common base object and inspect it, extract a type hint. 3. Use the type hint to further decode it into a known type. { “type”: “foo.bar.baz”, “foo”: “abc”, “bar”: 123, “baz”: [“one”, “two”] } struct base type { Type string } struct fooBarBaz type { Type string Foo string Bar int Baz []string } 1 2 3 Here, base is the duck type, the contract to get type.
  • 5. Duck Typing in Kubernetes
  • 6. Case Study: Cluster API Required status fields The InfrastructureCluster object must have a status object. The spec object must have the following fields defined: ● controlPlaneEndpoint - identifies the endpoint used to connect to the target’s cluster apiserver. The status object must have the following fields defined: ● ready - a boolean field that is true when the infrastructure is ready to be used. kind: MyProviderCluster apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 spec: controlPlaneEndpoint: host: example.com port: 6443 status: ready: true Contract Instance https://cluster-api.sigs.k8s.io/developer/architecture/controllers/cluster.html
  • 7. Case Study: KEDA // WithTriggers is a specification for a resource with triggers type WithTriggers struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec WithTriggersSpec `json:"spec"` } // WithTriggersSpec is the spec for a an object with triggers resource type WithTriggersSpec struct { PollingInterval *int32 `json:"pollingInterval Triggers []ScaleTriggers `json:"triggers"` } apiVersion: keda.sh/v1alpha1 kind: ScaledJob metadata: name: azure-storage-queue-consumer namespace: default spec: jobTargetRef: template: spec: containers: - name: azure-storage-queue-receive image: azure-storage-queue-client:dev imagePullPolicy: Always command: ["receive"] envFrom: - secretRef: name: azure-storage-queue-secret restartPolicy: Never backoffLimit: 4 triggers: - type: azure-queue authenticationRef: name: azure-queue-auth metadata: queueName: "hello" Contract Instance https://github.com/kedacore/sample-go-storage-queue/
  • 8. Case Study: Knative Addressable apiVersion: group/version kind: Kind status: address: url: http://host/path?query apiVersion: serving.knative.dev/v1 kind: Service metadata: name: colors namespace: default spec: ... status: address: url: http://colors.default.svc.cluster.local conditions: - lastTransitionTime: "2021-04-23T22:43:48Z" status: "True" type: Ready - ... latestCreatedRevisionName: colors-00005 latestReadyRevisionName: colors-00005 observedGeneration: 9 ... Contract Instance https://github.com/knative/docs/blob/main/docs/concepts/_index.md
  • 9. Full Picture Components: ● Control Plane Contract (Shape of resource) ● Behavioural Contract (how it should interpret or express that contract) ● RBAC, Using an Aggregated Role. 🦆 Controller Service Account Role Binding + Label Selector Role X Role Y Role Z
  • 10. Duck Typing in Action
  • 11. Results Contract type Results struct { Expression string `json:"expression,omitempty"` Result int `json:"result"` } type ResultsType struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Status ResultsStatus `json:"status"` } type ResultsStatus struct { Results `json:",inline"` } `status.expression` is the human readable form of the equation represented by the resource instance. `status.result` is a numerical result of the expression.
  • 12. Results Contract apiVersion: maths.tableflip.dev/v1alpha1 kind: Add metadata: name: add-few spec: add: - value: 1 - value: 2 - value: 3 - value: 4 status: conditions: - lastTransitionTime: "2021-04-26T21:21:52Z" status: "True" type: Ready expression: 1 + 2 + 3 + 4 observedGeneration: 1 result: 10 Add as duck type of the Results Contract
  • 13. Add contract Ref points to a resource that implements the Results duck type. Add is also a Results duck type. This lets us view a resource as a Results but also point at resources that the operator has claimed are also Results. The controller that realizes Add knows only the duck type contract when inspecting the object Ref points at. apiVersion: maths.tableflip.dev/v1alpha1 kind: Add metadata: name: add-refs spec: add: - value: 1 - ref: name: add-one namespace: default kind: Add apiVersion: maths.tableflip.dev/v1alpha1 - ref: name: add-few namespace: default kind: Add apiVersion: maths.tableflip.dev/v1alpha1
  • 14. apiVersion: maths.tableflip.dev/v1alpha1 kind: Subtract metadata: name: minus-7 spec: sub: - ref: name: 3-plus namespace: default kind: Add apiVersion: maths.tableflip.dev/v1alpha1 - value: 7 status: conditions:... expression: (3 + (1 + 2)) - 7 observedGeneration: 1 result: -1 apiVersion: maths.tableflip.dev/v1alpha1 kind: Add metadata: name: one-two spec: add: - value: 1 - value: 2 status: conditions:... expression: 1 + 2 observedGeneration: 1 result: 3 apiVersion: maths.tableflip.dev/v1alpha1 kind: Add metadata: name: 3-plus spec: add: - value: 3 - ref: name: one-two namespace: default kind: Add apiVersion: maths.tableflip.dev/v1alpha1 status: conditions:... expression: 3 + (1 + 2) observedGeneration: 1 result: 6
  • 15. Let’s make a duck.
  • 17. Definitions ● Controller ○ A standard shell around Reconciler, to provide required setup. ● Reconciler ○ Control plane business logic centered around a single resource. ● Client ○ A generated RESTful client for interacting with the Kubernetes API Server to do CRUD. ● Informer ○ Sets up static watches with the Client to a cache. Tells you when the resource you are interested in has had an update. ● Lister ○ Similar to the Client but read only for the shared cache.
  • 19. rec·on·cile, make changes to current state to become closer to desired state.
  • 23. Steps to Reconcile 1. Create Clients 2. Create Informers and Listers from that Client a. This builds a cache for that client and connects the Informers and Listers. 3. Provide those Informers, Listers and Clients to a Controller Constructor 4. Start threads for Informers 5. Start threads for Controllers
  • 24. 1. Create Clients 2. Create Informers and Listers from that Client 3. Provide those Informers, Listers and Clients to a Controller Constructor 4. Start threads for Informers 5. Start threads for Controllers
  • 25. 1. Create Clients 2. Create Informers and Listers from that Client 3. Provide those Informers, Listers and Clients to a Controller Constructor 4. Start threads for Informers 5. Start threads for Controllers
  • 26. 1. Create Clients 2. Create Informers and Listers from that Client 3. Provide those Informers, Listers and Clients to a Controller Constructor 4. Start threads for Informers 5. Start threads for Controllers
  • 27. "These 200+ lines of code will stay in-sync with the rest of Knative." - no one
  • 28. We want to write this: K8s API Server Controller Client 🗝 Informers Listers Reconciler cache
  • 29. We have to deal with these: K8s API Server Controller Client 🗝 Informers Listers Reconciler cache
  • 30. Main makes 🗝🐌🐚 Controller wants 🐌🐚 makes 💵⚒ 🗝 - Creds 🐌 - Client 🐚 - Informer 💵 - Lister ⚒ - Reconciler
  • 31. Dependency Graph 🗝 🗝 - Creds 🐌 - Client 🐚 - Informer 💵 - Lister ⚒ - Reconciler 🐌 🐚 💵 ⚒
  • 32. Needs Graph 🗝 🗝 - Creds 🐌 - Client 🐚 - Informer 💵 - Lister ⚒ - Reconciler 🐌 🐚 💵 ⚒
  • 33. Steps to Reconcile 1. Ask for Clients 2. Ask for Informers a. These ask for Clients 3. Use Informers to make Listers 4. Provide those Informers, Listers and Clients to a Controller Constructor
  • 34.
  • 35.
  • 36. We standardized how Knative main methods ask for creds and setup configs. So this code can all be shared.
  • 37.
  • 38. We standardized how Knative controllers ask for clients and informers. So this code can all be generated.