Kubernetes

Flannel
Network Masquaredes & Forwarding & Ip Tables & Routing
K3S Hetzner Installation with GlusterFS. PDF
k3s.advantages – K8s Kubernetes .PDF
kubernates.install.1.master.2.nodes.kutayzorlu.com.PDF
Kubernetes Flannel networking. This article explains how flannel-kutayzorlu.com.PDF


CNI

Hi !  Here is the example Command lines for Kubernetes.

Kubectl Command Lines
[crayon-663657b39bb82492478200/]
Config Datas
[crayon-663657b39bb8b140223303/]
 

Conntrack Connection Tracking

Kubernetes used iptables NAT and the conntrack kernel module to track connections
[crayon-663657b39bb8e196552115/]
Kubeadm
[crayon-663657b39bb90972986587/]
Kube Node Delete
[crayon-663657b39bb92829749913/]

Normal’de node 2  ve node 3 te,   pod-d ve pod-y yoktular, sonradan olusturuldular.

Kubernetes Volume

Kubernetes supports many types of volumes. A Pod can use any number of volume types simultaneously. Ephemeral volume types have a lifetime of a pod, but persistent volumes exist beyond the lifetime of a pod. When a pod ceases to exist, Kubernetes destroys ephemeral volumes; however, Kubernetes does not destroy persistent volumes. For any kind of volume in a given pod, data is preserved across container restarts. Kubernetes does not destroy persistent volumes.

 

  • Types of Volume
    •  azureDisk – Azure Disk, azureFile – Azure File, cephfs – CephFS volume, csi – Container Storage Interface (CSI)
      fc – Fibre Channel (FC) storage,  ,flexVolume – FlexVolume,  gcePersistentDisk – GCE Persistent Disk
      glusterfs – Glusterfs volume,  hostPath – HostPath volume (for single node testing only; WILL NOT WORK in a multi-node cluster; consider using local volume instead) ,  iscsi – iSCSI (SCSI over IP) storage ,   local – local storage devices mounted on nodes.
      nfs – Network File System (NFS) storage,  portworxVolume – Portworx volume ,  rbd – Rados Block Device (RBD) volume
      vsphereVolume – vSphere VMDK volume
    • awsElasticBlockStore – AWS Elastic Block Store (EBS)
      • An awsElasticBlockStore volume mounts an Amazon Web Services (AWS) EBS volume into your pod. Unlike emptyDir, which is erased when a pod is removed, the contents of an EBS volume are persisted and the volume is unmounted. This means that an EBS volume can be pre-populated with data, and that data can be shared between pods.
    • subPath 
      • The following example shows how to configure a Pod with a LAMP stack (Linux Apache MySQL PHP) using a single, shared volume. This sample subPath configuration is not recommended for production use. The PHP application’s code and assets map to the volume’s html folder and the MySQL database is stored in the volume’s mysql folder. For example:
        • [crayon-663657b39bb95919128014/]
    • subPath  with expanded environment variables
      • Use the subPathExpr field to construct subPath directory names from downward API environment variables. The subPath and subPathExpr properties are mutually exclusive. In this example, a Pod uses subPathExpr to create a directory pod1 within the hostPath volume /var/log/pods. The hostPath volume takes the Pod name from the downwardAPI. The host directory /var/log/pods/pod1 is mounted at /logs in the container.
        • [crayon-663657b39bb98566917122/]
    • Persistent Volumes
      • Familiarity with volumes is suggested.
        • Static
          A cluster administrator creates a number of PVs. They carry the details of the real storage, which is available for use by cluster users. They exist in the Kubernetes API and are available for consumption.
        • Dynamic

 

Eviction Api

[crayon-663657b39bb9a636909971/]
 

 

Ip Tables
[crayon-663657b39bb9c882067453/]
 

 

* Openshift is Kubernetes alternative

 


Example K3S


ref:
kubernetes.io/docs/reference/kubectl/cheatsheet/

https://docs.openshift.com/container-platform/4.3/networking/multiple_networks/configuring-bridge.html

https://docs.aws.amazon.com/eks/latest/userguide/calico.html

https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/   # Very important

https://kubernetes.io/docs/tasks/administer-cluster/ip-masq-agent/ # Very important

* https://ronanquillevere.github.io/2017/05/16/kubernetes-ovh.html#.YXKc8xxCT-i

* https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/

https://kubernetes.io/docs/concepts/workloads/pods/disruptions/