Posts

Showing posts from 2018

How to change data directory for Docker with systemd

Image
How to change the data directory for Docker with systemd ? Recently I was playing with docker and got the issue with system space utilization which got full when I tried to pull some new images form docker hub. The reason was that partition was full where docker was storing all data including images.      Usually, By default docker store its all data in /var/ partition which is usually will be in root"/" partition or have can have the separate partition. In my case that was in root "/" partition. So I thought of moving this data directory to somewhere else. Moving this directly to non OS or non-default partition will be a good habit as it will not harm data if something goes wrong with the system. You have different option to do this - 1. Use "--graph=/data/docker/data" in systemd file i.e. "/usr/lib/systemd/system/docker.service" as below -                 ExecStart=/usr/bin/dockerd --graph="/data/docker/da...

Push Docker Images to Azure Container Registry (ACR)

Image
How to Push you custom Docker Images to Azure Container Registry? In this post, We will be going to see that how we can tag and push our custom docker images to ACR i.e. Azure Container Registry.  Azure CLI We are going to use Azure CLI during whole setup. So make sure you have Azure CLI installed and you are able to run "az" command. You can check your CLI version using | az --version | as below- If you don't have installed. you can download and install it from |https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest|. Note - I am assuming here that - you have already logged in with Azure CLI. If you haven't, then please do that using |az login|. You have already created ACR in specific Resource Group. If not, then do that using |az group create [OPTIONS]|. Login to Azure Container Registry- Fetch name of ACR using command |az acr list -g {group_name} -o table|. Then, use command |az acr logi...

Site Reliability Engineering Cookbook

Minikube - How to set up local kubernetes cluster

Image
Question - How to setup local kubernetes cluster using minikube? First of all lets describe briefly about "What is kubernetes?". Well, Kubernetes is open-source container orchestration tool which is used for deployments automation and scaling of containers on large scale environments. There are plenty of other features that it can do. Please go to the main site (https://kubernetes.io/) to explore more. In this specific post, we'll try to setup full kubernetes cluster on local machine. This should be used on Production like env, this is only for doing local testing and getting test of kubernetes on local server without investing much.             We will make use of "minikube" for this setup. Below is the "minikube" Architecture. Env and Version Details -    - Host OS - Windows 10    - Hypervisor - Vritualbox Requirements - 1. Hypervisor -                Install s...

How to Clean or Reset build numbers in Jenkins job ?

Image
When you were working with some POC or R&D, you may have to do things a number of times until you come to final conclusion. In my recent POC, I was working with Jenkins build jobs for Azure container registry with Azure Managed Container services aka AKS. During this whole activity I have created 70 plus builds and during this process each build was creating one separate tag for docker image on ACR. When this whole POC gets completed, I thought that it will be really good idea to flush/clear out build history and start building from scratch. Situation after completing POC- Below are the step by step instructions for the same- Login to Jenkins server, click on " Manage Jenkins" --> "Script Console". This will open below dialog box. Once you click on "Script Console", then copy and paste below script there and run. Note - Make sure to change the "Job Name" def jobName = "Enter Job Name" def jo...

Dictionaries in Python

Hello Guys,           In this particular post, I am going to discuss dictionaries in python. The example in this post is tested on Python-3.6.           Python data structures include lists, dictionaries, tuples, and sets.  If you have worked with python, then you may have worked on "lists", "tuples", "sets" and "dictionary" in python. Dictionary  - As the name suggests dictionary is the same as that ordinary dictionary where we will have index and then we'll use that index to search the specific entry. This is similar to book or phonebook index where we search things using names instead of values which we do in other python data structure. Dictionary worked in "key":"value" pair. The "word" is called key and the definition of "word" is called a value .               Usually, the "values" or "keys" of a dictionary are not in specific order. Another import thing is that we ca...