Skip to content

Instantly share code, notes, and snippets.

@pandorasNox
Last active August 15, 2022 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pandorasNox/92bea43daecae60611fc6e7b93acc7f4 to your computer and use it in GitHub Desktop.
Save pandorasNox/92bea43daecae60611fc6e7b93acc7f4 to your computer and use it in GitHub Desktop.
Kubernetes Learning Material

kubernetes intro

what is kubernetes

  • (official definition): Kubernetes is a portable, extensible, open source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation.
  • insimpler terms: it's a container orchestrator (which mainly manages containers)
  • it support a distributed cluster architecture
    • where a cluster describes a collection of multiple nodes/server (normally 3/5/7... consensus relevant)
    • as it useses, to store the cluster state, the etcd distributed key-value store, which under the hood uses the Raft consensus algorithm
    • with that it manages containers across the cluster, so across all the nodes
  • it normally is used distributed but also can run as a single node instance, mostly for development purpose

other points to consider

  • if distributed it can provide festures like:
    • (high) availability of the software (no downtimes, always accessible to user), if the software makes use of it
    • failure tolerant

loose points

  • Q: what is the main tool to interact with kubernetes clusters? (after they are alredy created)
  • A: kubectl is for kubernetes cluster what scp/ssh is for remote servers
  • Q: for development you can use a tool such as kind (stands for kubernetes in docker) to create a k8s cluster (single node in default)

kubernetes resources in detail

What is a resource in the context of k8s?

  • A:
    • yaml representation in etcd
    • stored in etcd (pushed & validated through the k8s api)
    • is a logical unit & representation which k8s can understand and manage
      • examples: pod, namespace, deployment
    • from docs: "A resource is an endpoint in the Kubernetes API that stores a collection of API objects of a certain kind; for example, the built-in pods resource contains a collection of Pod objects."

pod

  • Q: What is the most basic/core used resource in k8s?
    • A: a pod
  • Q: What is a pod?
    • A:
      • it's a resource
      • the smallest logical core unit in k8s for running/deploying apps
      • manages one or multiple containers
      • each pod gets a separate ip
      • each container is running on localhost/127.0.01
      • that imples: reaching a certain container app via port works over the pod ip:port
      • in comparison in docker-compose each service/container gets its own IP + network (you only whould port-forward it to localhost)
      • it is the one unit which other units (e.g. deployments, satefulsets....) which running/execurting/managing applications in a certain way all use under the hood

sources

@pandorasNox
Copy link
Author

pandorasNox commented Aug 9, 2022

source: What is Kubernetes?

first part - what is k8s

Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services. that facilitates both declarative configuration and automation, letting you run distributed systems resiliently, with scaling and failover for your application.

simpler put

Basically, it's a container orchestrator, that helps make sure each container is where it's supposed to be and that the containers can work together

second part - why was it created / what does it try to solve

  • there are a lot of application that we call monoliths, which means they put all the functionality, like transaction and third party integration, into a single deployable artifact
  • And monoliths are a common way to build applications, even today.
  • But they still have there downfalls
  • For example, deployments can take a long time, since everything has to rollout altogether.
  • And if different parts of the monolith are managed by different teams, there could be a lot of additional complexity, when prepping for a rollout
  • And scaling has the same problem.
  • Teams have to throw resources at the whole application, even if the bottleneck is only on a single area.
  • So people came up with...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment