1. Copy Data From a Pod to Local Machine:

kubectl cp <some-namespace>/<some-pod>:/tmp/foo /tmp/bar
and just vice versa i.e. from local machine to POD
kubectl cp /tmp/bar <some-namespace>/<some-pod>:/tmp/foo

2. Display Pod Details Only three Columns (NodeName, POD name, Name space)

kubectl get pods --all-namespaces --output ‘jsonpath={range .items[*]}{.spec.nodeName}{“ “}{.metadata.namespace}{“\t “}{.metadata.name}{“\n”}{end}’

3. Display Pod Details Only three Columns (NodeName, POD name, Status)

kubectl get pod -o=custom -columns=NAME:.metadata.name,STATUS:.status.phase,NODE:.spec.nodeName --all-namespaces

4. Display Pod Details Only two Columns (NodeName, POD name)

kubectl get pod -o=custom-columns=NODE:.spec.nodeName,NAME:.metadata.name --all-namespaces

5. List of PODs running on selected NODE:

kubectl get pods --all-namespaces -o wide --field-selector spec.nodeName=<node-name>

6. View Logs of…


/boot partition cannot be an LVM devices is because when the system boots, it first searches for /boot/vmlinuz, and at this time, lvm cannot be recognized because there is no module for lvm loaded at this time. So, the /boot partition can not be a lvm partition.

Note: this document should also work for another Linux distribution like Debian / Gentoo/ OpenSUSE.

Check Boot space

you can use fdisk or parted commands to create another partition. Else you have to add extra storage like vdb or sdc.
In my situation i have add new storage /deb/vdb

Let’s create partition vdb1 (10GB) on Linux Disk

[root@os-lvm ~]# fdisk   /dev/vdb

Welcome to…

Registering a Runner is the process that binds the Runner with a GitLab instance.

Before registering a Runner, you need to first:

  • Install it on a (bare metal server or on docker container ) server separate than where GitLab is installed on
  • Obtain a token for a shared or specific Runner via GitLab’s interface (Gitlab UI -> Project or group -> settings -> CI/CD -> Runners -> copy url and token also)
  • First Method : To register a Runner (Bare Metal Server ) under GNU/Linux:
1. #sudo gitlab-runner register
After run this command enter below information
2. Please enter the…

Ansible ad hoc commands are great for tasks you repeat rarely. For example, you could execute a quick one-liner in Ansible without writing a playbook. An ad hoc command looks like this:
$ ansible [pattern] -m [module] -a "[module options]"

Some Examples are given Below:

  1. Ansible ad-hoc against ‘all’ hosts on the inventory file and using the ‘ping’ module
    $ ansible all -m ping
    The first parameter ‘all’ for all hosts on the inventory file.
    The second parameter inside the ‘-m’ option for the module, running the ping module
    To List All Hosts: $ ansible all --list-hosts
  2. Now you can…

Lens is the only IDE you’ll ever need to take control of your Kubernetes clusters. It’s open source and free

Download Link:

Click and install it on local machine.

Click on add new cluster and enter the kubeconfig path or copy paste kubeconfig file and select the cluster you need to check in GUI.

https://asciinema.org/a/I6KAX3iUkpVyO0JgIRPmzCqs6

Enjoy !!!


  1. $ kubectl config get-contexts : View list of clusters

2. $ kubectl config current-context : To view current running version

3. $ kubectl config use-context <context-name> : Switch to cluster or context

4. $ kubectl get ns : Generate a plain-text list of all namespaces

5. $ kubectl get po -A : Generate list of all pods in all namespaces

6. $ kubectl create namespace [namespace-name]: Create namespace

7. $kubectl get po: Generate a plain-text list of all pods in default namespace.
$ kubectl get po -n <namespace_name>: display pods underspecific name space

8. $ kubectl get pods -o wide


Kind is a tool built for running local Kubernetes clusters using Docker containers as nodes. kind was primarily designed for testing Kubernetes itself, but it is actually quite useful for creating a Kubernetes environment for local development, QA, or CI/CD

A fully functioning environment using kind includes a few different components. For our purposes, we will install the following list of software.

  1. Docker: (To create KINDcontroller and worker node For k8s cluster)
  2. The kubectl tool: (To communicate with K8s Cluster)
  3. kind: (Commnad line tool by which you can create single node or multinode cluster)
  4. A local Docker registry: (To push…

  1. Open VirtualBox
  2. Right-click your VM, then click Settings
  3. Go to Shared Folders section
  4. Add a new shared folder
  5. On Add Share prompt, select the Folder Path in your host that you want to be accessible inside your VM.
  6. In the Folder Name field, type shared
  7. Uncheck Read-only and Auto-mount, and check Make Permanent
  8. Start your VM
Select The Shared Folder

9. Install dependencies for VirtualBox guest additions:
sudo apt-get update
sudo apt-get install build-essential linux-headers-`uname -r`
sudo apt-get install virtualbox-guest-utils virtualbox-guest-dkms

You’ll see a folder under /media directory named similarly to the folder you selected to share on your host machine with “sf_” added to the…


  1. Create web and DB images Seperately. So create seperate Dockerfiles for WEB and DB

FOR DB

  1. Take DB backup and put it in same place with DB dokcerfile
FROM mariadb:latest as builder# That file does the DB initialization but also runs mysql daemon, by removing the last line it will only init
RUN ["sed", "-i", "s/exec \"$@\"/echo \"not running $@\"/", "/usr/local/bin/docker-entrypoint.sh"]
# needed for intialization
ENV MYSQL_ROOT_PASSWORD=root
COPY *.sql /docker-entrypoint-initdb.d/# Need to change the datadir to something else that /var/lib/mysql because the parent docker file defines it as a volume.
# https://docs.docker.com/engine/reference/builder/#volume :
#…

  1. BOOT INTO GRUB MENU:
    The first step is to reboot into the GRUB menu. If Ubuntu 18.04 Bionic Beaver is the only operating system installed you need to keep pressing SHIFT for the GRUB menu to show up.
GRUB MENU

2. Edit Grub Menu:
Using arrows select the Ubuntu menu or the menu you use to boot your system and hit the e key. This will allow you to edit the menu:

Vineetcic

The Senior Devops

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store