Skip to content

Latest commit

 

History

History
37 lines (22 loc) · 1.41 KB

File metadata and controls

37 lines (22 loc) · 1.41 KB

Kubernetes Resource Model (KRM)

Kubernetes has a uniform Resource Model for all interactions you'll have with its API - the KRM. Let's explore it:

  1. Get rid of the initial hello, world:

    k delete deployment echoserver
    
  2. Glance at, and then apply, the echo.pod.yaml resource of kind: Pod:

    k apply -f https://raw.githubusercontent.com/vorburger/LearningKubernetes-CodeLabs/develop/docs/files/echo.pod.yaml
    
  3. You now have a Pod running. Let's list it, look at its log, and look at it's YAML:

    k get pods
    k logs echoserver
    k get pod echoserver -o yaml
    

    Note how the YAML shown is an extended version of the echo.pod.yaml, which we applied above, now with:

    • some new metadata (like a creationTimestamp or a uid)
    • additional spec (like system defaults; we could override those)
    • the status, which Kubernetes added when it reconciled the desired state (AKA intent) expressed by the spec with the system's observed state
  4. This Pod is a (built-in) KRM API resource "kind" (type). We can see all of them like this:

    k api-resources
    k api-versions
    
  5. We can learn more about each of them, as well as detailed documentation about the respective resource's fields:

    k explain pod
    k explain pod.spec.containers.image
    
  6. Clean up:

    k delete pod echoserver