shishir khandelwal
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Kubernetes Simplified: Understanding its Inner Workings ## Introduction Kubernetes has revolutionized the world of container orchestration, providing organizations with a powerful solution for deploying, managing, and scaling applications. However, the complexity of Kubernetes can be daunting for newcomers. In this article, we will demystify Kubernetes by breaking down its core components, revealing its operational principles, and guiding you through the process of running a pod. By the end of this article, you will have a solid understanding of Kubernetes and be equipped to harness its capabilities effectively. ## Understanding Kubernetes Components The architecture of Kubernetes seamlessly combines various components into a user-friendly powerhouse. If you are seeking a versatile solution for container orchestration, self-healing capabilities, and traffic load balancing, Kubernetes is the answer. At its core, Kubernetes operates on a client-server architecture, providing a robust framework for managing containerized applications. Now, let's delve into the major Kubernetes architecture components: the master node, etcd, and worker nodes. ### Master Node: The Architect of the Cluster Think of the master node as the conductor of an intricate symphony. This crucial component ensures the integrity of the cluster by supervising the interactions among its constituents. Its primary role is to align the actual state of system objects with the desired state, orchestrating a harmonious environment. ### Etcd: The Trustworthy Guardian of Cluster States Meet etcd, the unsung hero of the Kubernetes architecture. It serves as a distributed key-value storage system, diligently maintaining records and consistency of the cluster states. Etcd stores essential information such as the number of pods, deployment states, namespaces, and service discovery details. This reliable guardian ensures that the cluster's data remains secure and readily accessible. ### Worker Nodes: Where the Magic Happens Visualize the worker nodes as the stage where containers come to life. These nodes are responsible for executing containers, breathing life into your applications. The master node takes charge of managing these worker nodes, ensuring seamless and efficient operations. ## Unraveling the Intricacies: Components within Components Within each major component, there are various parts, each serving a unique purpose. Understanding the functions of these individual parts will grant you a deeper comprehension of the true power behind the Kubernetes architecture. Let’s start? ![](https://hackmd.io/_uploads/BJQIKm5Ih.png) ### Master Node Components: Unveiling the Powerhouses Within the master node of a Kubernetes cluster, several components work tirelessly to ensure seamless operations. Let's explore the key components that contribute to the master node's functionality and their essential roles: #### Kube-apiserver: The Gateway to the Cluster The kube-apiserver serves as a vital gateway for interacting with the cluster. Users can leverage it to perform various actions, including creating, deleting, scaling, and updating different objects within the cluster. Clients like kubectl authenticate with the cluster through the kube-apiserver, which also acts as a proxy or tunnel for communication with nodes, pods, and services. Moreover, it is responsible for the crucial task of communicating with the etcd cluster, ensuring the secure storage of data. #### Kube-controller-manager: Driving the Desired State To comprehend the kube-controller-manager, we must first grasp the concept of controllers. In Kubernetes, most resources have metadata defining their desired state and observed state. Controllers play a pivotal role in driving the object's actual state toward its desired state. For instance, the replication controller manages the number of replicas for a pod, while the endpoints controller populates endpoint objects like services and pods. The kube-controller-manager comprises multiple controller processes that operate in the background, constantly monitoring the cluster's state, and making necessary changes to align the status with the desired state. #### Kube-scheduler: Orchestrating Container Placement The kube-scheduler takes charge of efficiently scheduling containers across the cluster's nodes. By considering various constraints such as resource limitations, guarantees, affinity, and anti-affinity specifications, it determines the best-fit node to accommodate a service based on its operational requirements. This component ensures optimal utilization of resources and facilitates the seamless execution of workloads. These components within the master node form the backbone of a Kubernetes cluster, enabling smooth orchestration, management, and scaling of containerized applications. ### Worker Node Components: Powering Container Execution Within the worker nodes of a Kubernetes cluster, several essential components work together to ensure efficient container execution. Let's explore these components and their crucial roles: #### Kubelet: Enforcing Desired State The Kubelet serves as the primary and most critical controller in Kubernetes. It plays a vital role in enforcing the desired state of resources, ensuring that pods and their containers are running as intended. The Kubelet is responsible for monitoring and managing the containers on its node, making sure they adhere to the desired specifications. It also sends regular health reports of the worker node to the master node, providing vital insights into the node's status. #### Kube-proxy: Proxying Requests Kube-proxy acts as a proxy service running on each worker node. Its primary function is to forward individual requests targeted at specific pods or containers across the isolated networks within the cluster. By intelligently routing network traffic, Kube-proxy enables seamless communication between various components and ensures that requests reach their intended destinations efficiently. #### Container Runtime: Running Containers The container runtime is a crucial software component responsible for executing containers on the worker nodes. It provides the necessary environment and resources for running containers effectively. Common examples of container runtimes include runC, containerd, Docker, and Windows Containers. The container runtime ensures the proper instantiation and management of containers, allowing them to function seamlessly within the Kubernetes cluster. ### Kubectl In addition to these components directly related to the Kubernetes cluster, it's worth mentioning the 'Kubectl' tool. Kubectl serves as the primary command-line interface for interacting with the cluster, enabling users to execute commands, manage resources, and obtain information about the cluster's state. ## Understanding the Interactions among components To gain a deeper understanding of how the different components of Kubernetes interact, let's explore the step-by-step process involved in creating a new pod within the cluster: ### Step 1: User Request Processing - When a user wants to create a new pod in Kubernetes, they start by issuing a command through the kubectl command-line tool. - This command travels to the kube-apiserver, which plays a crucial role as the central hub for communication within the cluster. The kube-apiserver then validates the user request, ensuring its integrity and security. If the validation is successful, the kube-apiserver proceeds to create a new key-value record for the pod in the etcd storage system. - Etcd serves as a reliable data store, housing the cluster's configuration and state information. This record in etcd becomes the authoritative source for the pod's details and attributes, allowing Kubernetes to manage and track its lifecycle effectively. ### Step 2: Worker Node Scheduling Process - The kube-scheduler, in continuous interaction with the kube-apiserver, plays a crucial role in the creation of a new pod. It becomes aware of the need for a new pod and initiates the scheduling process. - Then the kube-scheduler carefully evaluates various parameters, including resource requirements and affinity rules, to determine the most suitable worker node for scheduling the pod. Once the decision is made, the kube-apiserver steps in and establishes communication with the chosen worker node's kubelet. It provides essential information such as the pod's image name and environment variables to the kubelet. - Armed with this information, the kubelet is ready to create and manage the new pod on the designated worker node. Simultaneously, the kube-apiserver updates the worker node's information in etcd, ensuring that the cluster's state accurately reflects the addition of the new pod ### Step 3: Pod Status - During the lifecycle of a pod in Kubernetes, seamless communication between the kubelet and the kube-apiserver ensures real-time updates on the pod's status. - The kubelet, running on each worker node, acts as the primary agent responsible for monitoring the pod. It continuously reports the current state of the pod to the kube-apiserver, providing valuable insights into its health and operation. - The kube-apiserver, acting as the central control plane component, receives and records this information in the etcd key-value store, ensuring an accurate representation of the pod's status within the cluster. - Once the pod transitions from the pending state to the running state, the kube-apiserver promptly notifies the user, conveying the latest details on the pod's state and availability. By understanding these steps, we can grasp the intricate coordination and communication between the components of Kubernetes during the creation of a new pod. This insight enables us to navigate the Kubernetes ecosystem with confidence and effectively manage our applications within the cluster. ## Conclusion Kubernetes has undoubtedly revolutionized the way we deploy and manage applications. With the given solid understanding of its components and operational principles, we are well-prepared to navigate the Kubernetes ecosystem and unlock its full potential to drive innovation and scalability in our organizations.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully