k8s_api - henk52/knowledgesharing GitHub Wiki
Kubernetes API
Introduction
Purpose
Describe how the k8s API works and how entities registers and interacts with the k8s API.
References
Vocabulary
- resource type - is the name used in the URL (pods, namespaces, services)
- kind - resource types have a concrete representation (their object schema)
- collection - list of instances of a resource type.
- resource - single instance of a resource type, usually represents an object.
- object - Most Kubernetes API resource types are objects – they represent a concrete instance of a concept on the cluster, like a pod or namespace.
- Verbs - Almost all object resource types support the standard HTTP verbs - GET, POST, PUT, PATCH, and DELETE. Kubernetes also uses its own verbs, which are often written in lowercase to distinguish them from HTTP verbs.
- CBOR - Concise Binary Object Representation - format support by the kubernetes api.
verbs
- Watch - Track changes.
- uses resourceVersion to keep track of changes. It seems this is bumped up at each change. Efficient detection of changes
- A given Kubernetes server will only preserve a historical record of changes for a limited time. Clusters using etcd 3 preserve changes in the last 5 minutes by default.
- if the resourceVersion no longer exists the status code: '410 Gone' is returned.
- TODO bookmark events.
- TODO streaming lists.
- TODO Sharded list and watch (Alpha in v1.36)