Files
awesome-kubernetes/docs/kubernetes.md
Inaki Fernandez a50bcdf40f Jan 31st
2022-01-31 12:42:44 +01:00

184 KiB
Raw Blame History

Kubernetes

{=="Kubernetes is not for application development but for platform development. Its magic is in enterprise standardization, not app portability" (Kelsey Hightower)==}

Introduction

Kubernetes Jobs Market

  • kube.careers: Kubernetes jobs market (Q2 2021) We analyzed all the 113 Kubernetes jobs posted in the past 3 months (Apr-May-Jun 2021) and extracted metrics for:
    • Kubernetes salary ranges
    • Remote vs office offers
    • Popular cloud providers
  • ==kube.careers: Kubernetes jobs market trends for 2021 (Q4)== What's the average salary for a Kubernetes engineer? Do you need a Kubernetes certification to apply for a job? What technologies and cloud providers are often used with Kubernetes? We analyzed 276 Kubernetes jobs from 2021 and found that:
    • If you know AWS and Python, the world is your oyster.
    • CKA is the top Kubernetes certification. But only a few employers require one.
    • Jenkins is more alive than ever.
    • Prometheus is synonymous with monitoring. No one comes close.
    • Terraform and Ansible lead IaC.

Certified Kubernetes Offerings

The State of Cloud-Native Development

Kubernetes Failure Stories

Kubernetes Maturity Model

  • fairwinds.medium.com: Kubernetes Maturity Model
  • fairwinds.medium.com: An Introduction to the Kubernetes Maturity Model — How to Use It
    • The Fairwinds team developed the Kubernetes Maturity Model over a year ago, and they continue to update and refine it to reflect the five stages you go through in your journey to Kubernetes maturity.
    • If the Kubernetes Maturity Model is new to you, this is a helpful introduction and guide on how to use it.
    • Before you do anything, consider what a cloud-native journey means to you and your organization. Kubernetes isnt right for everyone, so make sure you understand where to start and how to prove value by embracing Kubernetes.
    • Any maturity model is a process, and youre likely to move back and forth between phases, and some will take longer than others. Even once youve reached phase five, youll always be working on ongoing optimization, removing human error and effort, and improving reliability and efficiency.

Cloud Native Learn by doing platforms

Kubernetes Installation Methods

{==

Kubernetes Knowledge Hubs

Kubernetes Podcasts

Kubernetes Blogs

Spanish Kubernetes Blogs

==}

Kubernetes Open Source Container Orchestation

kubeconfig

Docker and Kubernetes

Kubernetes vs Docker

Kubernetes vs Docker Swarm

Kubernetes Admission Controllers

Kubernetes Mutating Webhooks

  • medium.com/@pflooky: Intro to Kubernetes Mutating Webhooks (get more out of Kubernetes)
    • In its simplest terms, a MutatingWebhookConfiguration defines a webhook application to alter a Kubernetes resource when a particular action is taken on it. For example, if I wanted to add particular labels to all the pods that are created, it could be done by a mutating webhook which watches for all CREATE POD events and adds the labels to that pod before it gets deployed.
    • Why: As the development teams put larger workloads into Kubernetes, managing all of the resources becomes quite difficult as there may be different deployment patterns and life cycles. Mutating webhooks give you the ability to target changes to any Kubernetes resource regardless of their deployment mechanisms and alter them before or after any point within the life cycle.
    • Some use cases where it could be used include:
      • Metadata management: include useful metadata about team, environment or type of workload to each Kubernetes resource
      • Attaching sidecar processes: add a log listener to particular pods
      • Secret management: apply consistent secret retrieval across all resources
      • Deployment configuration: could add environment variables or configmaps on the fly to pods

Kubernetes Cloud Controller Manager

Kubernetes Resources

Kubernetes Pods

Kubernetes ConfigMaps

Kubernetes Secrets

Kubernetes Volumes

Kubernetes Namespaces and Multi Tenancy. Self Service Namespaces

Creating Users
  • cloudhero.io Creating Users for your Kubernetes Cluster. Learn how to use x509 certificates to authenticate users in your cluster.

Kubernetes Labels and Selectors

Kubernetes Taints and Tolerations

Kubernetes Deployment, Rollling Updates and Rollbacks

Kubernetes StatefulSet

Kubernetes DaemonSets

Kubernetes Jobs and Cron Jobs

Kubernetes Deployment Strategies

Kubernetes API

Multi-Cluster Services API

Kubernetes Health Checks/Probes. Startup, Liveness, Readiness

Kubernetes Limits and Requests

Kube Scheduler

Kubernetes etcd

Kubernetes Sidecars

Kubernetes Annotations

Kubernetes Best Practices and Tips

[![k8s experts be like](images/k8sexpertsbelike.jfif){: style="width:50%"}](https://twitter.com/memenetes)

Disruptions

Cost Estimation Strategies

kubecost

Kubernetes Resource and Capacity Management. Capacity Planning

Architecting Kubernetes clusters. Node Size. Multi Clusters and Hybrid Cloud

Wide Cluster instead of Multi-Cluster

Client Libraries for Kubernetes

Helm Kubernetes Tool

Templating YAML in Kubernetes with real code. YQ YAML processor

Extending Kubernetes

Adding Custom Resources. Extending Kubernetes API with Kubernetes Resource Definitions. CRD vs Aggregated API

  • Custom Resources
  • itnext.io: CRD is just a table in Kubernetes
  • Use a custom resource (CRD or Aggregated API) if most of the following apply:
    • You want to use Kubernetes client libraries and CLIs to create and update the new resource.
    • You want top-level support from kubectl; for example, kubectl get my-object object-name.
    • You want to build new automation that watches for updates on the new object, and then CRUD other objects, or vice versa.
    • You want to write automation that handles updates to the object.
    • You want to use Kubernetes API conventions like .spec, .status, and .metadata.
    • You want the object to be an abstraction over a collection of controlled resources, or a summarization of other resources.
  • Kubernetes provides two ways to add custom resources to your cluster:
    • CRDs are simple and can be created without any programming.
    • API Aggregation requires programming, but allows more control over API behaviors like how data is stored and conversion between API versions.
  • Kubernetes provides these two options to meet the needs of different users, so that neither ease of use nor flexibility is compromised.
  • Aggregated APIs are subordinate API servers that sit behind the primary API server, which acts as a proxy. This arrangement is called API Aggregation (AA). To users, it simply appears that the Kubernetes API is extended.
  • CRDs allow users to create new types of resources without adding another API server. You do not need to understand API Aggregation to use CRDs.
  • Regardless of how they are installed, the new resources are referred to as Custom Resources to distinguish them from built-in Kubernetes resources (like pods).

Krew, a plugin manager for kubectl plugins

  • Krew is the plugin manager for kubectl command-line tool.

  • itnext.io: Extending Kubernetes Cluster; Kubectl Plugins and Krew

  • darumatic.com: Improve Kubectl Command with Krew Krew is a tool that aims to ease plugin discovery, installation, upgrade, and removal on multiple operating systems. This article will show you how easy it is to grab and experiment with existing plugins.

  • kubectl trace is now on the krew index!! Go install it now!

    kubectl krew install trace
    

    And then just try to snoop into all the file openings:

    kubectl trace run -a  <yournode>  -e 'kprobe:do_sys_open { printf("%s: %s\n", comm, str(arg1)) }'
    

OpenKruise/Kruise

Crossplane, a Universal Control Plane API for Cloud Computing. Crossplane Workloads Definitions

Kubernetes Community

Community Forums

Kubernetes Special Interest Groups (SIGs)

Kubernetes SIG's Repos

Kubectl Plugins


Enforcing Policies and governance for kubernetes workloads with Conftest

Kubernetes Troubleshooting

[![learnk8s debug your pods](images/learnk8s_debug_your_pods.png){: style="width:30%"}](https://learnk8s.io/troubleshooting-deployments)

Provisioning cloud resources (AWS, GCP, Azure) in Kubernetes

Debugging Techniques and Strategies. Debugging with ephemeral containers

Kubernetes Tutorials

Online Training

K8s Diagrams

Kubernetes Patterns and Antipatterns. Service Discovery

Top 10 Kubernetes patterns

Kubernetes Scheduling and Scheduling Profiles

Assigning Pods to Nodes. Pod Affinity and Anti-Affinity

Pod Topology Spread Constraints and PodTopologySpread Scheduling Plugin

Cloud Development Kit (CDK) for Kubernetes

  • cdk8s.io Define Kubernetes apps and components using familiar languages. cdk8s is an open-source software development framework for defining Kubernetes applications and reusable abstractions using familiar programming languages and rich object-oriented APIs. cdk8s apps synthesize into standard Kubernetes manifests which can be applied to any Kubernetes cluster.
  • github.com/awslabs/cdk8s

AWS Cloud Development Kit (AWS CDK)

  • AWS: Introducing CDK for Kubernetes
  • Traditionally, Kubernetes applications are defined with human-readable, static YAML data files which developers write and maintain. Building new applications requires writing a good amount of boilerplate config, copying code from other projects, and applying manual tweaks and customizations. As applications evolve and teams grow, these YAML files become harder to manage. Sharing best practices or making updates involves manual changes and complex migrations.
  • YAML is an excellent format for describing the desired state of your cluster, but it is does not have primitives for expressing logic and reusable abstractions. There are multiple tools in the Kubernetes ecosystem which attempt to address these gaps in various ways:
  • We realized this was exactly the same problem our customers had faced when defining their applications through CloudFormation templates, a problem solved by the AWS Cloud Development Kit (AWS CDK), and that we could apply the same design concepts from the AWS CDK to help all Kubernetes users.

Serverless with OpenFaas and Knative

[![Serverless](images/from-monolith-to-serverless.jpg)](https://www.xenonstack.com/blog/serverless-openfaas-java/)

Multi-Cluster Federation. Hybrid Cloud Setup Tools

KubeFed

  • KubeFed: Kubernetes Cluster Federation
  • aquasec.com: Kubernetes Federation: The Basics and a 5-Step Tutorial Learn about Kubernetes Federation use cases, how it works, and see how to create your first Kubernetes Federation in 5 steps.
  • Kubernetes Federation, or KubeFed, is a tool for coordinating the configuration of multiple clusters in Kubernetes. You can determine which clusters KubeFed will manage, and what their configuration looks like, all from a single group of APIs in the hosting cluster. KubeFed offers low-level mechanisms that can be used as a foundation for increasingly complex production Kubernetes use cases across multiple clusters, such as geographic redundancy and disaster recovery.

KubeCarrier

Red Hat Operator Lifecycle Manager (OLM)

  • Red Hat OLM operator-lifecycle-manager is a management framework for extending Kubernetes with Operators. OLM extends Kubernetes to provide a declarative way to install, manage, and upgrade Operators and their dependencies in a cluster.

Istio Service Mesh

Multi-Regional Architecture

Kubernetes Scripts

Kubernetes and Ansible

Spot instances in Kubernetes

Kubernetes on Windows

Kubernetes Incident Report Plan IRP

Kubernetes interview questions

Kubernetes Certifications. CKA, CKAD and CKS

Books and eBooks

Kubernetes Patterns eBooks

Famous Kubernetes ebooks of 2019

[![Kubernetes: Up and Running](images/kubernetes_up_running_kelsey_hightower.gif)](http://shop.oreilly.com/product/0636920223788.do)

Famous Kubernetes resources of 2019

Famous Kubernetes resources of 2020

Kubernetes Slack Channel

Slides

??? note "Click to expand!"

<center>
<iframe class="speakerdeck-iframe" frameborder="0" src="https://speakerdeck.com/player/e1c397b2aa67470e9204f82f938fec78?slide=1" title="KubeCologne keynote—Troubleshooting Kubernetes apps" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" style="border: 0px; background: padding-box padding-box rgba(0, 0, 0, 0.1); margin: 0px; padding: 0px; border-radius: 6px; box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 40px; width: 560px; height: 314px;" data-ratio="1.78343949044586"></iframe>
</center>

Bunch of images

??? note "Click to expand!"

<center>

[![Kubernetes architecture](images/kubernetes-pod-creation.png)](https://www.padok.fr/en/blog/kubernetes-architecture-clusters)

[![10 most common mistakes](images/10_common_kubernetes_mistakes.jpg){: style="width:60%"}](https://blog.pipetail.io/posts/2020-05-04-most-common-mistakes-k8s)

[![5 Open-source projects that make #Kubernetes even better](images/five-oss-projects-kubernetes.jpg){: style="width:80%"}](https://enterprisersproject.com/article/2020/5/kubernetes-5-open-source-projects-improve)

[![kubernetes arch multicloud hybrid](images/kubernetes_architecture_multicloud_hybride.jpg){: style="width:70%"}](https://www.journaldunet.com/web-tech/cloud/1492047-comment-kubernetes-perce-les-frontieres-du-cloud/)

[![Kubernetes components](images/kubernetes_components_rootsongjc.jpg)](https://github.com/rootsongjc)

[![Container flowchart](images/container_flowchart.jpg)](https://searchcloudcomputing.techtarget.com/tip/Weigh-the-pros-and-cons-of-managed-Kubernetes-services)

[![dockerswarm vs kubernetes](images/dockerswarm_vs_kubernetes.png)](https://www.imaginarycloud.com/blog/docker-vs-kubernetes/)

![simple k8s cluster meme](images/simple_k8s_cluster_meme.jfif)
</center>

Videos

Click to expand!

Spanish Videos

??? note "Click to expand!"

<center>
<iframe width="560" height="315" src="https://www.youtube.com/embed/9p3llZAcyG8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</center>

Tweets

Click to expand!

Can you change an application without changing any code in Kubernetes?

You can when you use multiple containers in a single Pod.

Heres a visual recap of @EmanuelMEvans s article on extending apps on Kubernetes with multi-container pods https://t.co/afS3pPj4zb pic.twitter.com/LS5zOZErbE

— Daniele Polencic (@danielepolencic) March 1, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

What if you could choose the best node for your Kubernetes cluster before writing any code?

I built a calculator to choose the optimal instance sizing for your Kubernetes clusterhttps://t.co/3jlyCLrvdq

Discover:

- costs (used, wasted, kubelet)
- overcommitment
- utilisation pic.twitter.com/gdRTEWkez6

— Daniele Polencic (@danielepolencic) September 7, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

THREAD: What happens when you create a Pod in Kubernetes?

Spoiler: a surprisingly simple task reveals a complicated workflow that touches several components in the cluster. pic.twitter.com/SNEufo0lBe

— Daniele Polencic (@danielepolencic) August 6, 2020
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

THREAD: How to quarantine a Pod in Kubernetes.

This technique helps you with debugging running Pods in production.

The Pod is detached from the Service (no traffic), and you can troubleshoot it live.

Let's get started! pic.twitter.com/E7AUh2ylM7

— Daniele Polencic (@danielepolencic) June 24, 2020
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

THREAD: How to gracefully shut down Pods without dropping production traffic in Kubernetes

If you've ever noticed dropped connection after a rolling upgrade, this thread digs into the details.

Let's start: 𝘸𝘩𝘢𝘵 𝘩𝘢𝘱𝘱𝘦𝘯𝘴 𝘸𝘩𝘦𝘯 𝘢 𝘗𝘰𝘥 𝘪𝘴 𝘥𝘦𝘭𝘦𝘵𝘦𝘥? pic.twitter.com/jS5litVUlw

— Daniele Polencic (@danielepolencic) July 6, 2020
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

THREAD: How does the scheduler work in Kubernetes?

The scheduler is in charge of deciding where your pods are deployed in the cluster.

It might sound like an easy job, but it's rather complicated!

Let's dive into it. pic.twitter.com/iC1vnargc4

— Daniele Polencic (@danielepolencic) September 24, 2020
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

MEGATHREAD

Learn Kubernetes one Twitter thread at the time!

Below you can find a collection of threads about Kubernetes and Kubernetes-related tech!

I regularly add more, so you can follow me or @learnk8s for more updates! pic.twitter.com/0ingxHn9vx

— Daniele Polencic (@danielepolencic) August 26, 2020
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

THREAD

Running new apps in Kubernetes is straightforward.

But what happens when you have legacy apps that:

- Log to file instead of stdout?
- Has no support Prometheus?
- Has no support for HTTPS

Read on → pic.twitter.com/m79f69Huqw

— Daniele Polencic (@danielepolencic) February 22, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

I'm often asked why I prefer zonal Kubernetes clusters over regional clusters. @gctaylor does a great job explaining how @reddit leverages zonal clusters to limit the blast radius of config changes and reduce cross AZ network traffic. https://t.co/3pW5awTtdQ

— Kelsey Hightower (@kelseyhightower) March 18, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

THREAD

How do you scale background jobs in Kubernetes?

With Python, Celery, RabbitMQ and KEDA! pic.twitter.com/BOtwiSjIKW

— Daniele Polencic (@danielepolencic) March 29, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Architecting #Kubernetes clusters: Should you use a single cluster or many clusters for your team(s)?

There are pros and cons to both, read the thread to find out more 🧵 pic.twitter.com/1n5ACO97Ay

— appvia (@appvia_io) August 17, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Unpopular opinion: Kubernetes doesn't have a clear separation between admin and app developer APIs, and we acknowledged this as a source of complexity but maybe this is why it became successful.

— Jaana Dogan ヤナ ドガン (@rakyll) September 9, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Kubernetes saved us from a world of completely proprietary Cloud APIs and provided a trustworthy basis for an open ecosystem of infrastructure tools and APIs. https://t.co/i67orzir2O

— Ian Lewis 💉💉 (@IanMLewis) September 11, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

As more enterprises embrace #containers, theyll find they need #Kubernetes, too. With our open approach, #K8s does more. Heres how: https://t.co/y9TciK53F1 pic.twitter.com/CPWHcy5TOZ

— Nicholas Gerasimatos - Red Hat (@nicholas_redhat) September 23, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Kubernetes experts be like: pic.twitter.com/0z47Q9bdZm

— memenetes (@memenetes) October 11, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

🧵How do you keep up with Kubernetes?

If you are looking for curated Kubernetes news, we have you covered on:

- Core Kubernetes
- Security
- Architecture & development
- Job opportunities
- K3s

Here are the accounts that you should follow: pic.twitter.com/Hcw9BelCsd

— Learnk8s (@learnk8s) October 20, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

@kubernetesio @K8sArchitect K8s Architecture pic.twitter.com/Kbm11a8oMA

— Julien (@MapEngArch) October 24, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

How Kubernetes differs from Docker in the way it deals with containers 🔽

Under the hood, Kubernetes and Docker both rely on the same/similar lower-level components to run containers.

Often, both use containerd and runc. However, Kubernetes makes the container runtime pluggable pic.twitter.com/5daIalpmrt

— Ivan Velichko (@iximiuz) October 30, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Does Kubernetes rebalance your Pods?

If there's a node that has more space, does Kubernetes recompute and balance the workloads?

🤔

Let's see! pic.twitter.com/ML7JIGGtrq

— Daniele Polencic (@danielepolencic) November 9, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

As we close out the year, a few 2022 predictions. 🧵

1. 2022 will be the year where Kubernetes is finally recognized as technology for platform teams enabling product groups, rather than a technology designed for direct end-usage by developers.

— Gabe Monroy (@gabe_monroy) December 25, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-168051035-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-168051035-1'); </script>