Getting Started with Kubernetes | Application Orchestration and Management of Kubernetes

1) Resource Metadata

i) Kubernetes Resource Objects

ii) Labels

iii) Selectors

iv) Annotations

v) OwnerReferences

2) Operations Demonstration

  • kubectl get pods
  • kubectl apply -f pod1.yaml
  • kubectl apply -f pod2.yaml
  • kubectl get pods --show-labels
  • kubectl get pods nginx1 -o yaml | less
  • kubectl label pods nginx1 env=test
  • kubectl label pods nginx1 env=test -overwrite
  • kubectl get pods --show-labels
  • kubectl label pods nginx tie-
  • kubectl get pods --show-labels
  • kubectl get pods --show-labels -l env=test
  • kubectl get pods --show-labels -l env=test,env=dev
  • kubectl get pods --show-labels -l env=dev,tie=front
  • kubectl get pods --show-labels -l 'env in (dev,test)
  • kubectl annotate pods nginx1 my-annotate='my annotate,ok
  • kubectl get pods nging1 -o yaml | less
  • kubectl apply -f rs.yaml
  • kubectl get replicasets nginx-replicasets -o yaml |less
  • kubectl get pods
  • kubectl get pods nginx-replicasets-rhd68 -o yaml | less

3) Controller Mode

i) Control Loop

ii) Sensor

iii) Example — Control Loop — Scale-up

4) Controller Mode — Summary

i) Two API Design Methods

ii) Imperative APIs Issues

  • The biggest issue with imperative APIs lies in error handling.
  • Many imperative interactive systems often provide an inspection system in the back end to correct data inconsistency in scenarios such as command processing timeout and retries.
  • The imperative APIs are prone to errors during the handling of multiple concurrent access requests.
  • In contrast, declarative APIs enable natural recording of the current and final states of the system.

iii) Controller Mode — Summary

Conclusion

  • The metadata of resource objects in Kubernetes includes various elements such as labels for identifying resources, annotations for describing resources, and OwnerReferences for describing the relationship between resources. The metadata is critical to the running of Kubernetes.
  • The core of the controller mode is the control loop.
  • Two API design methods- declarative APIs and command APIs are available. The controller mode used by Kubernetes is driven by declarative APIs.

Original Source:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com