Skip to content

Instantly share code, notes, and snippets.

@alexchiri
Last active April 18, 2020 17:29
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 alexchiri/f2a6f514ef6ff2a13866972778797d70 to your computer and use it in GitHub Desktop.
Save alexchiri/f2a6f514ef6ff2a13866972778797d70 to your computer and use it in GitHub Desktop.
A short and high level presentation about what and why is there Kubernetes

What and Why is there Kubernetes?

What?

Why?

What? continued

  • Let's have a look at this again
  • I see Kubernetes being composed of logical 2 components
    • Master and Workers
    • An imperfect analogy
      • Master <-> our brain
      • Workers <-> the other parts of our body that our brain controls
    • The Master includes (besides other components)
      • The API server - most of the communication with the cluster and between its components happens through the API
      • etcd - a key value database where the state of the cluster is kept (the cluster "memory")
    • Zooming on a Worker (which is basically a VM) - a cluster can have several workers
      • There are several Kubernetes processes
      • And a number of pods which each contain 1 or more Docker containers
      • The services deployed on the cluster run in these containers
  • When we deploy a service, we tell Kubernetes what is the end state we want (how many instances of the service, how should it be exposed outside the cluster etc.)
  • And if it has the resources available, it will make it happen
    • Kubernetes will try to spread the instances (pods) along its worker nodes
    • Or if it doesn't have enough nodes with available resources, it might put all instances (pods) on the same node
  • One more thing... namespaces
    • Pods, services, many Kubernetes resources are organised in namespaces across nodes
    • Namespaces provide isolation between the resources in the cluster
    • You can assign roles to users and give them access to do specific actions on specific namespaces
    • In reality, pods might look more like this when it comes to namespace distribution across nodes
      • (rectangles are pods of different sizes, colours represent the namespace they are part of)

THE END

@marcusphi
Copy link

I think the mistake we made was to be too dependent and tightly coupled to the environment. Is it really worth it?

Other big mistake was leaving the trees, but that’s another story ;)

@alexchiri
Copy link
Author

Many microservices setups I see today are too tightly coupled. Not making things better in my view when they are done this way. Just moving the pain further.

@marcusphi
Copy link

I referred to the problems we solved with docker on your historical outline.

@alexchiri
Copy link
Author

Ah, sorry, I assumed you were talking about the microservices part.

In what way were we too dependent on the environment? And what would've been the alternative?

@marcusphi
Copy link

Well docker was a hit because it addressed that problem, as you state yourself. So we evidently had a problem with tight coupling to a complex “environment “.

I’m thinking about how we ended up here. Longer term perspective. Why have things gotten so complicated? Or haven’t they? Maybe we solved the “environment” problem in the wrong way, and then things just continued in a tangential direction.

It’s a complicated story to go into specifics, but it was a architectural smell to depend on a complex environment. Are as decoupled as we should be today on K8s? Maybe? But did we need all this machinery to solve our essential problems?

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