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

Understanding API Internals

Understanding API Internals

Nabarun Pal

June 26, 2021
Tweet

More Decks by Nabarun Pal

Other Decks in Technology

Transcript

  1. Understanding the Kubernetes API Internals
    By Nabarun Pal and Nikhita Raghunath

    View full-size slide

  2. 2
    Source: https://kubernetes.io/docs/concepts/overview/components/

    View full-size slide

  3. 3
    Group
    git.k8s.io/kubernetes/staging/src/k8s.io/api

    View full-size slide

  4. 6
    Group-Version-Kind (GVK)
    apps.v1/Deployment
    Group Version Kind

    View full-size slide

  5. 7
    Group-Version-Resource (GVR)
    /apis/apps/v1/namespaces/{namespace}/deployments
    Group Version Resource
    /api/v1/namespaces/{namespace}/pods

    View full-size slide

  6. Relation between GVK and GVR
    8

    View full-size slide

  7. 9
    External Types v/s Internal Types

    View full-size slide

  8. 1
    0
    Codebase walkthrough
    To import the codebase walkthrough in VS Code, please see this
    gist.

    View full-size slide

  9. 11
    Conversion
    v1
    Storage Version

    View full-size slide

  10. 12
    Conversion
    v1
    v1beta1
    Storage Version
    Input Version

    View full-size slide

  11. 13
    Conversion
    v1
    v1beta2
    Storage Version
    Input Version

    View full-size slide

  12. 14
    Conversion
    v1
    v1beta3
    Storage Version
    Input Version

    View full-size slide

  13. 15
    Conversion
    v1
    v1beta1
    Storage Version
    Input Version

    View full-size slide

  14. 16
    Conversion
    v1
    internal
    v1beta1
    Storage Version
    “Hub” Version
    Input Version

    View full-size slide

  15. 17
    Conversion
    v1
    internal
    v1beta2
    Storage Version
    “Hub” Version
    Input Version

    View full-size slide

  16. 18
    Conversion
    v1
    internal
    v1beta3
    Storage Version
    “Hub” Version
    Input Version

    View full-size slide

  17. 19
    Conversion
    v1
    internal
    v1beta1
    Storage Version
    “Hub” Version
    Input Version

    View full-size slide

  18. 20
    Conversion and Defaulting
    v1
    internal
    v1beta1
    Storage Version
    “Hub” Version
    Input Version

    View full-size slide

  19. 21
    Decoding
    v1beta1
    Input Version
    internal
    “Hub” Version
    Serialization, Defaulting and Conversion

    View full-size slide

  20. 22
    Admission
    v1
    internal
    “Hub” Version
    Admission
    Mutating
    Validating

    View full-size slide

  21. 23
    Registry
    v1
    internal
    “Hub” Version
    Admission
    Mutating
    Validating
    Registry
    BeforeCreate
    Validation

    View full-size slide

  22. 24
    Encoding
    v1
    internal
    “Hub” Version
    Admission
    Mutating
    Validating
    Registry
    BeforeCreate
    Validation
    Encoding
    Conversion
    Defaulting
    Deserialization

    View full-size slide

  23. 2
    5
    Codebase walkthrough
    To import the codebase walkthrough in VS Code, please see this
    gist.

    View full-size slide

  24. 26
    CRDs and Aggregated Apiservers
    They follow the same pattern
    ● CRDs - staging/src/k8s.io/apiextensions-apiserver
    ● Aggregated Apiservers - staging/src/k8s.io/kube-aggregator
    (We won’t be covering them in detail in this talk)

    View full-size slide

  25. Thank you!
    2
    7
    Feedback Link

    View full-size slide