Sunday, June 14, 2020

Root password of a Docker container

Root User Privileges in a Docker Container


Often we will come across situations where the default user setting in docker container will be not be sufficient to perform operations. 

Lets say to kill a process, inspect or edit some system files, import certificates or even to install some tool..


We have few options to accomplish this..


Easiest of all:

docker exec -u 0 -it <container-name> bash
 
By default, "0" denotes root user. You can also choose to specify, simply as "root". Also its better to specify the working directory as below..

docker exec -u root -it --workdir / <container-name> bash



Other options that are available are during the container image build:

Make necessary file permissions, etc., during the image build in the Docker file

If all the packages are available in your Linux image, chpasswdin the dockerfile before the USER utility

Hope this helps..!!

10 Useful Unix Commands - Must for Debugging


Useful Unix Commands for Debugging with Examples


This is my list of commands, found useful while debugging issues in logs, servers process, etc., With regard to the list, will share the commands which I use in the real world scenarios..

  • lsof - Used to get the list of "open files" in linux and all the processes that opened them. I find them useful to search / find the processes that are listening on a given Port.          
            lsof -i tcp:8443

This will give the Process ID, service name which listens on the port (8443) and much more.. Particularly useful to debug different services running on the same server. 

Saturday, June 13, 2020

Kubernetes Certification - CKAD


CKAD - Certified Kubernetes Application Developer 


Recently I cleared the CNCF - Cloud Native Computing Foundation's certification - CKAD - Certified Kubernetes Application Developer (YES.!!!)


If you haven't explored Containers - Docker, Kubernetes, the whole cloud native journey, would request to start now.. Its much fun.. 


CNCF offers two certifications on Kubernetes (K8s), CKAD for Application Developers and CKA for DevOps / Administrators. 

CKAD is a real hands-on, performance based exam for a duration of 2 hours. 
The curriculum covers Core Concepts, Configuration, Observability, Pod Design patterns, Networking, persistence and other concepts.

Multiple trainings are available through the official Linux Foundation trainings, Udemy, Pluralsight, etc.,

My favourite been Mumshad's following Udemy course, covering all the concepts needed for the certification. Also the training course in Linux Foundation covers the concepts in much more depth. 

Apart from the concepts, one has to be really good with Linux command line / terminal commands and environment. During the test you will be presented with multiple clusters and traversing through them needs skill. 
Also brush up your vi editor commands since you will be required to write .yaml files for the K8s configurations. 


Finally, one important recommendation - Practise, Practise and More Practise... 

Few resources that would help..


Last tip, Try to containerise your legacy applications, learning apps (anything that you can put hands on) and deploy them in K8s using minikube in your development environments. This will help...



CKAD

Onboard the Cloud Native wagon.. All the best for your efforts..
Happy coding..!!

Root password of a Docker container

Root User Privileges in a Docker Container Often we will come across situations where the default user setting in docker container will be n...