- install jenkins using docker-compose
- default port for jenkins 8080
- Explain the your CICD pipeline
- What is DSL?
- How do you manage credentials in jenkins?
- explain the basic structure of Jenkinsfile?
- how jobs are managed for different branch/ multibranch?
- What issues you faced in jenkins? = plugin high disk IO
- build trigger?
- how to configure webhook?
- poll SCM?
- light checkout in jekins?
- groovy sandbox?
- add worker node in jenkins? types of method?
Category: Uncategorized
Disk IO read/write monitor
yum install sysstat -y
iostat -t
iostat -xtc
iostat -d
#More command
iostat -dx /dev/sda 5
sar
vmstat
badblock
Sonatype Nexus3 – Docker compose
version: '3'
services:
jenkins:
image: sonatype/nexus3:3.29.0
user: root:root
restart: always
container_name: nexus
environment:
TZ: "Asia/Kolkata"
volumes:
- /opt/nexus-data:/nexus-data
ports:
- 8081:8081
Get admin passwords:
docker exec -it nexus bash
find / -iname admin.*
#OR
docker exec -it nexus cat /nexus-data/admin.password
More : https://hub.docker.com/r/sonatype/nexus3#user-content-persistent-data
Nomad – Container orchestration example for Dev environment
#Install nomad
-Download the stable release form https://www.nomadproject.io/downloads
wget https://releases.hashicorp.com/nomad/1.0.1/nomad_1.0.1_linux_amd64.zip
unzip nomad_1.0.1_linux_amd64.zip
mv nomad /usr/local/bin/
#start nomad in dev mode
nomad agent -dev
nomad node status
#Install docker https://docs.docker.com/engine/install/centos/
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io
systemctl start docker
systemctl enable docker
#Create simple nginx job file (nginx.nomad)
job "nginx" {
datacenters = ["dc1"]
type = "service"
update {
max_parallel = 1
min_healthy_time = "10s"
healthy_deadline = "3m"
progress_deadline = "10m"
auto_revert = false
canary = 0
}
migrate {
max_parallel = 1
health_check = "checks"
min_healthy_time = "10s"
healthy_deadline = "5m"
}
group "cache" {
count = 1
network {
port "nginx-port" {
to = 80
}
}
service {
name = "nginx-port"
tags = ["nginx", "web"]
port = "nginx-port"
}
restart {
attempts = 2
interval = "30m"
delay = "15s"
mode = "fail"
}
ephemeral_disk {
size = 300
}
task "nginx" {
driver = "docker"
config {
image = "nginx"
ports = ["nginx-port"]
}
resources {
cpu = 500
memory = 256
}
}
}
}
#Nomand commands for Run,Stop, job status and logs
nomad job status
nomad job run nginx.nomad
nomad job stop nginx
nomad job status nginx
nomad alloc status <Allocations ID>
nomad alloc logs <Allocations ID>
#Access webUI at http://127.0.0.1:4646
Named pipe in linux
Why to use named pipe?
1. No data is written on disk while reading and writing file
2. Screen sharing
3. Higher read write IO
Screen sharing with named pipe
- terminal-1
mkfifo /tmp/pipe1
- terminal-1
script -f /tmp/pipe1
- terminal-2
cat /tmp/pipe1
- terminal-1 start typing the command it will be shown in terminal-2

Kubernetes get new join command for data plane/Worker node
on control plane(master) node
kubeadm token create --print-join-command
More : https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-join/
Rancher proxy rule in httpd with websocket secure (wss)
<VirtualHost *:80>
ServerName rancher.initedit.com
Redirect permanent / https://rancher.initedit.com/
RewriteEngine on
RewriteCond %{SERVER_NAME} =rancher.initedit.com [OR]
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerName rancher.initedit.com
AllowEncodedSlashes on
SSLEngine On
SSLProxyEngine On
RewriteEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
RequestHeader set X-Forwarded-Proto "https"
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) wss://192.168.0.183:8443/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) https://192.168.0.183:8443/$1 [P,L]
ProxyPassReverse / https://192.168.0.183:8443/
ProxyPreserveHost On
SSLCertificateFile /etc/letsencrypt/live/rancher.initedit.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/rancher.initedit.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/rancher.initedit.com/fullchain.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
More info : https://stackoverflow.com/questions/27526281/websockets-and-apache-proxy-how-to-configure-mod-proxy-wstunnel
Install rancher to manage k8
rancher.yml
version: '3'
services:
rancher:
image: rancher/rancher:latest
privileged: true
restart: always
container_name: rancher
volumes:
- /opt/docker/rancher:/var/lib/rancher
ports:
- 88:80
- 443:443
run postgres with docker-compose
postgres.yml
version: '3'
services:
postgres:
image: postgres
restart: always
container_name: postgres
environment:
POSTGRES_PASSWORD: "password"
volumes:
- /opt/docker/postgres:/var/lib/postgresql/data
ports:
- 5432:5432
start : docker-compose -f postgres.yml up -d
stop : docker-compose -f postgres.yml down
find high disk IO Read/Write process
1.Install iotop
#centos/readhat
yum install iotop
#debian/ubuntu
apt install iotop
2.Run below command to check high disk io process
iotop -aoP
a = append data
o = only running disk IO
P = process ID instead of Thread ID
3.Get the process ID
lsof -p Process_id