k8s Bullet Notes for Beginners

Contents
  • Makes decisions across the entire cluster
  • Contains the core components of k8s
  • The control plane can run on any machine in the cluster
  • api-server
  • etcd
  • scheduler
  • controller manager
  • kube-proxy
  • kubelet
  • To provide a unified interface for accessing containers
  • A Pod is an abstraction of a node, allowing us to not be restricted by the number of physical instances
  • The smallest unit of object in k8s
  • Each Pod can contain multiple containers
  • The same application should not exist in the same Pod
  • Containers in the same Pod can communicate through their own network
  • Containers in the same Pod can share the same volume
  • Define an init container in the Pod and execute the prerequisite processes inside it
  • To provide a declarative way to deploy applications
  • Services should run 24/7
  • Single points of failure should be avoided
  • The number of Pods should remain constant
  • Deployment strategy
  • ReplicaSet
  • First terminate all Pods, then create new ones
  • Ensure there is always at least one existing Pod
  • This is the default deployment strategy
  • Load balances the Pods
  • Ensures the correct number of Pods
  • Manages Pod-level operations
  • Ensures that each node runs the required Pods
  • Network plugins, like Calico
  • Pod communication proxy, like kube-proxy
  • Monitoring exporters
  • Logging collectors
1
ip link
  • Inspect network interfaces at the data link layer
1
ip addr
  • Inspect network interfaces at the network layer
  • Subnetwork resolution
    • 192.168.1.10/24 -> 255.255.255.0 -> from 192.168.1.10 to 192.168.1.255
  • A host can request the IP through its name
  • If the name is not found in the hostname configuration, it will be searched through the domain name
  • Translates internal IPs to external IPs
  • IP addresses from external sources don’t have router settings, so NAT is needed
  • Translates IP addresses to MAC addresses
  • Isolates IP definitions from the physical node
  • Processes running under the namespace can communicate through network interfaces
  • Network interfaces set up by different namespaces can link to each other
  • By setting up a virtual switch (Linux bridge)
  • By adding routing through a gateway
  • Cluster IP
  • External IP
  • By allocating CoreDNS
  • Bypass request restrictions from firewalls and whitelists
  • Load balance incoming requests at the Pod level
  • Maintain IP tables on each node