Tuesday, October 30, 2018

Where To Modify Starting Arguments of K8S Core Components

Requirement:

  We have a kubernetes cluster running on docker images. Details  refer github doc for Oracle K8S manual installation  . Sometimes we need to add/modify starting arguments of kubernetes core components. ie we need to add TaintBasedEvictions=true for kube-controller-manager component to enable alpha feature. Or we need to add argument for etcd component.

Solution:

    By default, the  manifests files are in master node in  /etc/kubernetes/manifests .You would see these 4 yaml files. Backup the files and do the changes and restart kubernetes cluster.
etcd.yaml  kube-apiserver.yaml  kube-controller-manager.yaml  kube-scheduler.yaml

Where To Find kube-controller-manager Cmd from Kubernetes Cluster

Requirement:

   We need to find  kube-controller-manager file from Kubernetes Cluster which is running on docker images.  refer github doc for Oracle K8S manual installation
    All core binaries are stored inside the docker images.

Solution:

Find the controller docker instance

#docker ps |grep controller
7fc8302ccfe3        887b8144f94f                                                         "kube-controller-man…"   15 hours ago        Up 15 hours                             k8s_kube-controller-manager_kube-controller-manager-instance-cas-mt2_kube-system_d739245871cdd71020650b11ac854d60_0

docker exec into the docker instance and find kube-controller-manager

#docker exec -it k8s_kube-controller-manager_kube-controller-manager-instance-cas-mt2_kube-system_d739245871cdd71020650b11ac854d60_0 /bin/bash
bash-4.2# which kube-controller-manager
/usr/local/bin/kube-controller-manager

Use docker cp to copy the file out of docker instance .

#docker cp k8s_kube-controller-manager_kube-controller-manager-instance-cas-mt2_kube-system_d739245871cdd71020650b11ac854d60_0:/usr/local/bin/kube-controller-manager /bin/



Saturday, October 27, 2018

Golang OCI SDK Create Bucket and Upload Files Into OCI Object Storage

See details in Github link

How To Run Tcpdump With Logs Rotating

Requirement:

    We need to get tcp traffic on busy systems to diagnose the network related issues.  Tcpdump is a great tool but it also dumps huge amount of data which fill up disk easily.

Solution:

tcpdump has rotation built in. Use below command:
-C  8000*1,000,000 byet --> around 8G each file size
-W total 9 files to keep

nohup tcpdump -i bond0 -C 8000 -W 9 port 5801 -w tcpdump-$(hostname -s).pcap -Z root &