Kubernetes has a uniform Resource Model for all interactions you'll have with its API - the KRM. Let's explore it:
-
Get rid of the initial hello, world:
k delete deployment echoserver
-
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
-
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 acreationTimestamp
or auid
) - additional
spec
(like system defaults; we could override those) - the
status
, which Kubernetes added when it reconciled the desired state (AKA intent) expressed by thespec
with the system'sobserved
state
- some new
-
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
-
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
-
Clean up:
k delete pod echoserver