Posts

Supervisord configuration

In Dockerfile:  ENTRYPOINT [ "/usr/local/bin/supervisord" , "-c" , "/etc/supervisor/conf.d/supervisord.conf" ]   supervisor configuration file: [supervisord] logfile=/opt/supervisord/supervisord.log    ; (main log file;default $CWD/supervisord.log) logfile_maxbytes=50MB                    ; (max main logfile bytes b4 rotation;default 50MB) logfile_backups=5                        ; (num of main logfile rotation backups;default 10) loglevel=info                            ; (log level;default info; others: debug,warn,trace) nodaemon=true                            ; (start in foreground if true;default false) pidfile=/opt/supervisord/supervisord.pid    ; (supervisord pidfile;default supervisord.pid) [pro...

Continious deployment using kubernetes

 Continious deployment using kubernetes: Created a Jenkins container Installed 2 plugins(kubernets plugin & kubernetes continuous plugin) Add a jenkins slave using cloud(which creates a pod for running the pipeline job and terminates after execution) Cretaed a project with declarative pipeline, which contains 2 steps Kubernetes manifests(i.e sample nginx deployment abd corresponding service) kubernetes continuous plugin code to recognize the kube config file Reference: justmeandopensource Github Repo: code

Helm Charts

Image
 Spacing in  helm charts: When ever a go template  command  is executed, then  it will leave  an empty line. If we  want  to remove emtylines, or any secias characters to the  left we need  to use {{- similary  on the right - }} Example {{- template , {{- include, {{- if, {{- end  etc When we use named templates(common blocks of code in _name.tpl files), we  don't need  any  {{- in the declare command,  by we can see in many charts they  were  written(They  doesn't  make any sense) Reference: video Include vs template: Both are helpful when we write  want to  call common block of code written in _helper.tpl file using define I always recommend using include  over template because template doesn't support piping Just know about template,  so if  you find any references of it old charts you can get the idea. The template and include takes . as argument which means s...

Kubernetes Notes

 When we create secrets, we will encode data values in base64, kubelet in the nodes is reponsible to decode the base64 encoded data when it is consumed by containers within a pod If we add new pod with same labels, why replica controller don't recognize it and delete other pod. Because replica controller adds ownerrefrences section in metadata of every pod it creates and adds it name(i.e repliacontroller name) under it.Instead of completely relying on labels it also checks this section (VV Imp) kubectl run was earlier used to create deployments as well. However, with Kubernetes 1.18, kubectl run was updated to only create pods and it lost its deployment-specific options as well. If you are looking to create a deployment, you should instead use the kubectl create deployment command. When we create ClusterIp type service, we know that it can be used to talk within cluster but not outside.For testing this exec into the pods and try acessing clusterIp serviceip:port, coolthing is we ca...

Docker notes

 Imp points: docker images -a => It will show all the images even interediate that were used while building images using Dockerfile docker ps -a =>  Only display container IDs of the running comtainers If we change line in docker file then all the ones below that line will be reexecuted instead of making use of cache docker stop $(docker ps -q) -> stops all running containers && docker rmi $(docker images -q) only removes images with proper repo and tag name.It will  not delete images used by running containers docker rm $(docker ps -aq) -> removes all stopped containers, first stop container using above cmd docker rmi $(docker images -aq) -> removes all images even intermediatory images created while building docker images and when we rebuild images with same tag, the old images have none as repositoty and tag value. Even these will be removed The CMD values can be overriden while running the container.This is not possible with entry point By ...

Git Notes

Image
 Imp points: General points: Rename a  branch -> First checkout to the branch which should be renamed  then use git branch -m <new name>  git detached head mode, nice blog here Git Fetch and Pull: To see all remote branches, use gir branch -r If a remote branch exists with name test,which can be viewed using git branch -r. If we want to create a local branch for the same use git switch branch name. This will do 2 actions: 1. Create a local branch with name test 2. Set up track top point to origin/test(which can be seen in .git/config  file)  git fetch origin test3 or  git checkout test3  -> only fetches test3 branches info from remote to local but git fetch gets info of all branches in remote origin when using git pull(above 2.27.0), we need to specify how to reconcile divergent branches, using opions discussed here  else it wil promt the warning Before pulling the changes if we want to see want has changed in master,  you ca...

Time table

Image
 Devops classes: Track1:(Non containerization) ------------------------------------------------------------------------ Git ------------------------------------------------------------------------ Day1: Installing git in linux and windows Introduction to git(wordir,staging,local and repo repo && file status- untracked,modified,staged) git basic commands(pull,push,commit,add,clone etc) branching git pointers(HEAD,origin/HEAD,master,origin/master etc) merge(fastforward and recursive) rebase Day 2: merge and rebase conflicts git ignore file git stash git fetch and pull hands on(and behind the scenes) git workflows undoing changes git detached head mode Integration with jenkins(pending) git internals ------------------------------------------------------------------------- AWS -------------------------------------------------------------------------- Types of cloud computing services(IAAS,PAAS,SAAS) Aws Global infrastructure(regions,availability zones,data centers,local zones(c...