Kubernetes K8

Apr 2021

Overview

Containers contain functions for software components, a container can be a web server, a data processor or an data I/O device, anything really that you used to be able to run on a bare metal server or a VM. Containers can run on multiple servers in multiple locations.
Kubernetes provides an open-source API that controls how and where those containers will run, and manages continer failure and restarts.

Kubernetes Commands

There are many Kubernets commands, here we will explore some that will be useful when dealing with MediaKind HeadEnd solutions (IPHE).

get nodes

kubectl -n mediakind get nodes

In the above example, kubectl is the command, mediakind is the namespace we are dealing with and get nodes is the parameters for the command.

NAME STATUS ROLES AGE VERSION
172.25.27.17 Ready master,node 20d v1.13.12
172.25.27.20 Ready master,node 20d v1.13.12
172.25.27.21 Ready master,node 20d v1.13.12
172.25.27.26 Ready node 20d v1.13.12

kubectl -n mediakind get nodes returns the number of 'servers' in the deployment, these nodes can be bare metal or Virtual Machines.

describe node

kubectl -n mediakind describe node ipaddress

Above the command is describing a particular node in the system, the node IP address was derived by using the get node command.

kubectl -n mediakind describe node 172.25.27.26
Name: 172.25.27.26
Roles: node
Labels: beta.kubernetes.io/arch=amd64
beta.kubernetes.io/os=linux
encoding-hd-services=enabled
encoding-ott-services=enabled
encoding-sd-services=enabled
kubernetes.io/hostname=172.25.27.26
mux-bckp=enabled
node-role.kubernetes.io/node=
Annotations: flannel.alpha.coreos.com/backend-data: {"VtepMAC":"5a:a7:35:25:88:d4"}
flannel.alpha.coreos.com/backend-type: vxlan
flannel.alpha.coreos.com/kube-subnet-manager: true
flannel.alpha.coreos.com/public-ip: 172.25.27.26
node.alpha.kubernetes.io/ttl: 0
volumes.kubernetes.io/controller-managed-attach-detach: true
CreationTimestamp: Tue, 02 Mar 2021 17:47:31 +0000
Taints: <none>
Unschedulable: false
Conditions:
Type Status LastHeartbeatTime LastTransitionTime Reason Message
---- ------ ----------------- ------------------ ------ -------
MemoryPressure False Tue, 23 Mar 2021 14:38:55 +0000 Tue, 02 Mar 2021 17:47:56 +0000 KubeletHasSufficientMemory kubelet has sufficient memory available
DiskPressure False Tue, 23 Mar 2021 14:38:55 +0000 Tue, 02 Mar 2021 17:47:56 +0000 KubeletHasNoDiskPressure kubelet has no disk pressure
PIDPressure False Tue, 23 Mar 2021 14:38:55 +0000 Tue, 02 Mar 2021 17:47:56 +0000 KubeletHasSufficientPID kubelet has sufficient PID available
Ready True Tue, 23 Mar 2021 14:38:55 +0000 Tue, 02 Mar 2021 17:49:07 +0000 KubeletReady kubelet is posting ready status
Addresses:
InternalIP: 172.25.27.26
Hostname: 172.25.27.26
Capacity:
cpu: 96
ephemeral-storage: 114356412Ki
hugepages-1Gi: 0
hugepages-2Mi: 0
memory: 196496644Ki
pods: 110
Allocatable:
cpu: 95900m
ephemeral-storage: 105390869125
hugepages-1Gi: 0
hugepages-2Mi: 0
memory: 196144244Ki
pods: 110
System Info:
Machine ID: 2637027352b94bdfbaf1bb6d06401946
System UUID: 800B863A-10CB-EA11-906E-0017A4403562
Boot ID: 799bbe1a-8015-4250-beb1-c39958381d58
Kernel Version: 3.10.0-957.el7.x86_64
OS Image: CentOS Linux 7 (Core)
Operating System: linux
Architecture: amd64
Container Runtime Version: docker://18.9.9
Kubelet Version: v1.13.12
Kube-Proxy Version: v1.13.12
PodCIDR: 10.234.1.0/24
Non-terminated Pods: (17 in total)
Namespace Name CPU Requests CPU Limits Memory Requests Memory Limits AGE
--------- ---- ------------ ---------- --------------- ------------- ---
kube-system kube-flannel-6ntgc 150m (0%) 300m (0%) 64M (0%) 500M (0%) 20d
kube-system kube-proxy-172.25.27.26 150m (0%) 500m (0%) 64M (0%) 2G (0%) 20d
kube-system nginx-proxy-172.25.27.26 25m (0%) 300m (0%) 32M (0%) 512M (0%) 20d
mediakind fluentbit-fluent-bit-8n7vp 0 (0%) 0 (0%) 0 (0%) 0 (0%) 20d
mediakind logrotate-8d4j7 0 (0%) 0 (0%) 0 (0%) 0 (0%) 20d
mediakind metrics-prometheus-node-exporter-q7qqs 0 (0%) 0 (0%) 30Mi (0%) 150Mi (0%) 20d
mediakind mux-bckp-1-stream-processor-mux-65c46756b5-sgprz 0 (0%) 0 (0%) 0 (0%) 0 (0%) 20d
mediakind service-01-enc-hd-encoding-live-worker-6f6c448599-rnx9q 9 (9%) 12 (12%) 1536Mi (0%) 5Gi (2%) 19d
mediakind service-02-iptv-hd-encoding-live-worker-564fd48c7c-lnpk5 9 (9%) 12 (12%) 1536Mi (0%) 5Gi (2%) 6d2h
mediakind service-02-ott-encoding-live-worker-7d74dddc79-d7mn7 4 (4%) 0 (0%) 1G (0%) 0 (0%) 6d17h
mediakind service-03-enc-sd-encoding-live-worker-5d56c8b844-6hsl6 2 (2%) 3 (3%) 500Mi (0%) 2Gi (1%) 19d
mediakind service-05-enc-hd-encoding-live-worker-7bff86bff-nmx4g 9 (9%) 12 (12%) 1536Mi (0%) 5Gi (2%) 19d
mediakind service-08-enc-hd-encoding-live-worker-6cdf78b9c9-r5fbv 9 (9%) 12 (12%) 1536Mi (0%) 5Gi (2%) 8d
mediakind service-dtt01-2-enc-hd-encoding-live-worker-5bdfc9dc9-rfbcc 9 (9%) 12 (12%) 1536Mi (0%) 5Gi (2%) 7d17h
mediakind service-dtt02-3-enc-hd-encoding-live-worker-65d5fb7455-5slpw 9 (9%) 12 (12%) 1536Mi (0%) 5Gi (2%) 7d4h
mediakind service-dtt02-6-enc-sd-encoding-live-worker-7844d9b7d4-2cnz8 2 (2%) 3 (3%) 500Mi (0%) 2Gi (1%) 7d3h
mediakind stream-processor-statmux-bckp-75dc49984-lfl7v 0 (0%) 0 (0%) 0 (0%) 0 (0%) 20d
Allocated resources:
(Total limits may be over 100 percent, i.e., overcommitted.)
Resource Requests Limits
-------- -------- ------
cpu 62325m (64%) 79100m (82%)
memory 11903709696 (5%) 39676508416 (19%)
ephemeral-storage 0 (0%) 0 (0%)
Events: <none>