Operation modes of kubectl
- I would tell kubectl what action has to be taken
kubectl run tomcat --image=tomcat:8
- Maintaining declared state.
- Declarative state is mentioned in some file.
- To describe Declarative State in k8s we use YAML files.
- Lets assume you have yaml file test.yml.
kubctl apply -f test.yml kubectl delete -f test.yml
- All capabilities of K8s are exposed as REST APIs
- To execute APIs
- Client Libraries
- APIs are changing every day, then how should i use in my Production Systems.
- Are of three types
- Alpha: inside api version if you see alpha
- Beta: inside api version if you see beta
- Stable: inside api version if you see vX here X is a integer
Refer here for more info
Resources and Objects
- Resources are all the possibilities in K8s
- Objects are what you are creating
Resource Category Workload
- smallest unit of creation in k8s
- Pod has
- IP Address
- Object has two nested groups
- Desired state
- Actual State
apiVersion: <apiversion> kind: <type> metadata: key1: <value1> spec: <objectspec>