This page is under regular updates. Please check back later for more content.
Kubernetes Objects

Kubernetes Objects

Overview

  • Kubernetes uses objects to represent state of cluster.
  • What containerized applications are running (and on which node)
  • The policies around how those applications behave, such as restart policies, upgrade and fault tolerance.
  • Once you create the object the Cuba Reddy system will constantly work to ensure that object exists and maintain cluster's desired state
  • Every Kubernetes object include two nested fields that govern the object conflguration and they are - Object Specification and the Object status.
  • The specification, which we provide describes your desired state for the object- the characteristics that you want the object to have
  • The status describes the actual state of the object and is supplied and updated by the Kubernetes system
  • All objects are identified by a unique name and a UID

Basic Kubernets Objects

The basic humanities objects include -

  1. Pod
  2. Service
  3. Volume
  4. Namespaces
  5. Replicaset
  6. Secrets
  7. ConfigMaps
  8. Deployments
  9. Jobs
  10. Darmonsets

There are more than 200 Kubernetes objects.

Relationship between the objects

  • Pod manages containers
  • Replica set manages pods
  • services expose pod processes to the outside world
  • Configmaps and Secrets helps you configure pod

Representation

  • It represents as JSON or YAML file.
  • You create these and then push them to the Kubernetes API with kubectl

State of the object

  • Replicas (2/2)
  • Image (Tomcat/Ubuntu)
  • Name
  • Port
  • Volume
  • Startup
  • Detached

Kubernetes object management

  • The kubectl command line to support several different ways to create and manage kubernetes object
Management TechniqueOperates OnRecommended Environment
Imperative Command (Creating and working directly using command)Live objectsDevelopment/Testing
Declarative Object ConfigurationIndividual files (YAML/JSON)Production

Declarative is about describing what you are trying to achieve, without instructing how to do it.

Imperative explicitly tells "how to accomplish it.