├── Docker_Playlist_For_Beginners_ENGLISH
└── docker_installation_on_ami_ec2.md
└── ubuntu
├── ansible
└── ansible_installation_on_aws.md
├── aws
└── aws_cli_installation.md
├── devops_real_time_project
├── project_1
│ ├── jenkins_ansible_installation_p1.md
│ ├── kubernetes_installation_ec2_p1.md
│ ├── kubernetes_installation_p1.md
│ ├── project_1.md
│ ├── project_1_overview.png
│ └── sonarqube_installation_p1.md
└── project_1_in_english
│ ├── jenkins_ansible_installation_p1.md
│ ├── kubernetes_installation_ec2_p1.md
│ ├── kubernetes_installation_p1.md
│ ├── project_1.md
│ ├── project_1_overview.png
│ └── sonarqube_installation_p1.md
├── docker
└── docker_installation_on_aws.md
├── jenkins
└── jenkins_installation.md
├── jenkins_on_container
└── jenkins_installation_on_docker_container.md
├── kubernetes
└── minikube_installation_on_aws.md
└── terraform
└── terraform_installation.md
/Docker_Playlist_For_Beginners_ENGLISH/docker_installation_on_ami_ec2.md:
--------------------------------------------------------------------------------
1 |
🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
2 |
3 | Connect with me:
4 |
5 |
6 | - Click 👉 **[Whatsapp DevOps Jobs Group](https://chat.whatsapp.com/J1oriqe9ckc9NolOiStPti)**
7 | - Click 👉 **[Telegram DevOps Jobs Group](https://t.me/DevOps_Linux_Jobs)**
8 | - Click 👉 **[YouTube](https://www.youtube.com/@sunnygodiwal007/)**
9 | - Click 👉 **[GitHub](https://github.com/sunnydevops2022/)**
10 | - Click 👉 **[LinkedIn](https://www.linkedin.com/in/sunnygodiwal/)**
11 |
12 |
13 |
14 |
🔥 DOCKER INSTALLATION ON EC2 (AWS) 🔥
15 |
16 | #### `**** Please Like & Subscribe My Channel To Motivate Me ****`
17 |
18 |
19 | #### Switch to root user & change hostname
20 | ```
21 | sudo -i
22 | hostnamectl set-hostname docker
23 | bash
24 | ```
25 |
26 | #### Apply pending updates using the yum command
27 | ```
28 | sudo yum update
29 | ```
30 |
31 | #### Search for Docker package
32 | ```
33 | sudo yum search docker
34 | ```
35 |
36 | #### Get version information
37 | ```
38 | sudo yum info docker
39 | ```
40 |
41 | #### Install docker
42 | ```
43 | sudo yum install docker
44 | ```
45 |
46 | #### Status the Docker service
47 | ```
48 | systemctl status docker.service
49 | ```
50 |
51 | #### Enable docker service at AMI boot time
52 | ```
53 | systemctl enable docker.service
54 | ```
55 |
56 | #### Start the Docker service
57 | ```
58 | systemctl start docker.service
59 | ```
60 |
61 | #### Again Status the Docker service
62 | ```
63 | systemctl status docker.service
64 | ```
65 |
66 | #### Check docker version
67 | ```
68 | docker version
69 | docker --version
70 | ```
71 |
72 | #### Run demo sample container
73 | ```
74 | docker help
75 | docker container ls
76 | docker run -itd httpd
77 | docker container ls
78 | ```
79 |
80 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
81 |
82 | You will get all steps github repo link in the description box.
83 |
84 | We'll provide DevOps real time project in upcoming video in this channel. So please subscribe my channel.
85 |
86 | ## `************************* EOF *************************`
87 |
88 |
--------------------------------------------------------------------------------
/ubuntu/ansible/ansible_installation_on_aws.md:
--------------------------------------------------------------------------------
1 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
2 |
3 | Connect with me:
4 |
5 |
6 | - Click 👉 **[Whatsapp DevOps Jobs Group](https://chat.whatsapp.com/J1oriqe9ckc9NolOiStPti)**
7 | - Click 👉 **[Telegram DevOps Jobs Group](https://t.me/DevOps_Linux_Jobs)**
8 | - Click 👉 **[YouTube](https://www.youtube.com/@sunnygodiwal007/)**
9 | - Click 👉 **[GitHub](https://github.com/sunnydevops2022/)**
10 | - Click 👉 **[LinkedIn](https://www.linkedin.com/in/sunnygodiwal/)**
11 |
12 |
13 |
14 |
🔥 ANSIBLE INSTALLATION 🔥
15 |
16 | #### Update Ubuntu packages
17 | ```
18 | sudo -i
19 | apt-get update
20 | ```
21 |
22 |
23 |
24 | #### Change hostname
25 | ```
26 | hostnamectl set-hostname ansible
27 | bash
28 | hostname
29 | ```
30 |
31 |
32 |
33 | #### Check Ansible exist or not ?
34 | ```
35 | ansible --version
36 | ```
37 |
38 |
39 |
40 | #### Add Ansible repository
41 | ```
42 | sudo apt-add-repository ppa:ansible/ansible
43 | ```
44 |
45 |
46 |
47 | #### Now fetch latest update & install Ansible
48 | ```
49 | sudo apt update
50 | sudo apt-get install ansible
51 | ```
52 |
53 |
54 |
55 | #### Now check Ansible version
56 | ```
57 | ansible --version
58 | ```
59 |
60 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
61 |
62 |
63 | You will get all steps github repo link in the description box.
64 |
65 | We'll provide DevOps real time project in upcoming video in this channel. So please subscribe my channel.
66 |
67 | ## `************************* EOF *************************`
68 |
--------------------------------------------------------------------------------
/ubuntu/aws/aws_cli_installation.md:
--------------------------------------------------------------------------------
1 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
2 |
3 | Connect with me:
4 |
5 |
6 | - Click 👉 **[Whatsapp DevOps Jobs Group](https://chat.whatsapp.com/J1oriqe9ckc9NolOiStPti)**
7 | - Click 👉 **[Telegram DevOps Jobs Group](https://t.me/DevOps_Linux_Jobs)**
8 | - Click 👉 **[YouTube](https://www.youtube.com/@sunnygodiwal007/)**
9 | - Click 👉 **[GitHub](https://github.com/sunnydevops2022/)**
10 | - Click 👉 **[LinkedIn](https://www.linkedin.com/in/sunnygodiwal/)**
11 |
12 |
13 |
14 |
🔥 AWS-CLI INSTALLATION ON UBUNTU 🔥
15 |
16 |
17 |
18 |
19 | ## 🔹STEP-1
20 | #### Change hostname
21 | ```
22 | whoami
23 | sudo -i
24 | whoami
25 | hostnamectl set-hostname aws-cli
26 | bash
27 | hostname
28 | ```
29 |
30 |
31 |
32 | ## 🔹STEP-2
33 | #### Check OS version & Update Ubuntu packages
34 | ```
35 | cat /etc/os-release
36 | sudo apt-get update
37 | ```
38 |
39 |
40 |
41 | ## 🔹STEP-3
42 | #### Verify Aws-cli install or not ?
43 | ```
44 | aws --version
45 | ```
46 |
47 |
48 |
49 | ## 🔹STEP-4
50 | #### Now install Aws-cli
51 | ```
52 | apt-get install awscli
53 | ```
54 |
55 |
56 |
57 | ## 🔹STEP-5
58 | #### Again Verify Aws-cli
59 | ```
60 | aws --version
61 | aws
62 | ```
63 |
64 |
65 |
66 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
67 |
68 | You will get all steps github repo link in the description box & you will get important video's link related to DevOps.
69 |
70 | 👉 We'll provide DevOps real time project in upcoming video in this channel. So please subscribe my channel.
71 |
72 | ## `************************* EOF *************************`
73 |
--------------------------------------------------------------------------------
/ubuntu/devops_real_time_project/project_1/jenkins_ansible_installation_p1.md:
--------------------------------------------------------------------------------
1 | ## ++++++++++++++++++ JENKINS INSTALLATION ++++++++++++++++++
2 |
3 | ## Pre-Requisites
4 |
5 | ### Jenkins Server Details:
6 | ```
7 | Operating System : Ubuntu
8 | Hostname : jenkins-ansible
9 | RAM : 2 GB
10 | CPU : 1 Core
11 | EC2 Instance : t2.small
12 | ```
13 |
14 | #### Update repository of ubuntu
15 | ```
16 | sudo -i
17 | sudo apt-get update
18 | ```
19 |
20 | ### Change time zone
21 | ```
22 | date
23 | timedatectl
24 | sudo timedatectl set-timezone Asia/Kolkata
25 | timedatectl
26 | date
27 | ```
28 |
29 | ### Change hostname
30 | ```
31 | hostname
32 | hostnamectl set-hostname jenkins-ansible
33 | bash
34 | hostname
35 | ```
36 |
37 | ### Install Java
38 | ```
39 | java -version
40 | apt-get install openjdk-11-jdk
41 | java -version
42 | ```
43 |
44 | ### Install Jenkins
45 | ```
46 | curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
47 | /usr/share/keyrings/jenkins-keyring.asc > /dev/null
48 |
49 | echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
50 | https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
51 | /etc/apt/sources.list.d/jenkins.list > /dev/null
52 |
53 | sudo apt-get update
54 | sudo apt-get install jenkins=2.361.3 -y
55 | ```
56 |
57 | ### Service start
58 | ```
59 | systemctl start jenkins
60 | ```
61 |
62 | ### Service enable & check status
63 | ```
64 | systemctl enable jenkins
65 | systemctl status jenkins
66 | ```
67 |
68 | ### Check 8080 port is used or not
69 | ```
70 | netstat -plant | grep 8080
71 | ```
72 |
73 | ### Check version & Open jenkins on browser
74 | ```
75 | jenkins --version
76 |
77 | URL: http://:8080
78 | ```
79 |
80 | ### Get Jenkins Administrator password using this command
81 | ```
82 | sudo cat /var/lib/jenkins/secrets/initialAdminPassword
83 | ```
84 |
85 |
86 |
87 |
88 |
89 |
90 | ## ++++++++++++++++++ ANSIBLE INSTALLATION ++++++++++++++++++
91 |
92 | ### Add Ansible repository
93 | ```
94 | sudo apt-add-repository ppa:ansible/ansible
95 | ```
96 |
97 | ### Now fetch latest update & install Ansible
98 | ```
99 | sudo apt update
100 | sudo apt-get install ansible -y
101 | ```
102 |
103 | ### Now check Ansible version
104 | ```
105 | ansible --version
106 | ```
107 |
108 |
109 |
110 |
111 |
112 |
113 | ## ++++++++++++++++++ MAVEN INSTALLATION ++++++++++++++++++
114 |
115 | ### Check version before install
116 | ```
117 | mvn --version
118 | ```
119 |
120 | ### Change dir to /opt and download maven
121 | ```
122 | cd /opt/
123 | ls
124 | wget https://dlcdn.apache.org/maven/maven-3/3.9.1/binaries/apache-maven-3.9.1-bin.zip
125 | apt-get install unzip -y
126 | unzip apache-maven-3.9.1-bin.zip
127 | ls
128 | rm -rf apache-maven-3.9.1-bin.zip
129 | ls
130 | ```
131 |
132 | ### Configure maven home path
133 | ```
134 | vim ~/.bashrc
135 |
136 | ## Add end of the file & save it.
137 | export M2_HOME=/opt/apache-maven-3.9.1
138 | export PATH=$PATH:$M2_HOME/bin
139 |
140 | source ~/.bashrc
141 | ```
142 |
143 | ### Check version again now
144 | ```
145 | mvn --version
146 | mvn --help
147 | ```
148 |
149 | ## `************************* EOF *************************`
150 |
--------------------------------------------------------------------------------
/ubuntu/devops_real_time_project/project_1/kubernetes_installation_ec2_p1.md:
--------------------------------------------------------------------------------
1 | # KUBERNETES CLUSTER INSTALLATION
2 |
3 | ## Pre-Requisites
4 |
5 | ### Kubernetes Cluster Server Details:
6 | ```
7 | Operating System : Ubuntu
8 | Hostname : k8-master
9 | RAM : 2 GB
10 | CPU : 2 Core
11 | EC2 Instance : t3a.small
12 | Disk Size : 30 GB
13 | ```
14 |
15 | # ON MASTER NODE
16 |
17 | ### Switch to root user & Update repository of ubuntu
18 | ```
19 | sudo -i
20 | sudo apt update
21 | ```
22 |
23 | ### Start by disabling the swap memory
24 | ```
25 | sudo swapoff -a
26 | sed -i 's/^\(.*swap.*\)$/#\1/' /etc/fstab
27 | ```
28 |
29 | ### Change time hostname
30 | ```
31 | hostname
32 | sudo hostnamectl set-hostname k8-master
33 | bash
34 | hostname
35 | ```
36 |
37 | ### Change time zone
38 | ```
39 | date
40 | timedatectl
41 | sudo timedatectl set-timezone Asia/Kolkata
42 | timedatectl
43 | date
44 | ```
45 |
46 | ### Install Docker, start service
47 | ```
48 | sudo apt-get update
49 | sudo apt-get install docker.io -y
50 | sudo systemctl start docker
51 | ```
52 |
53 |
54 | ### Check the installation (and version) by entering the following
55 | ```
56 | docker --version
57 | ```
58 |
59 |
60 | ### The product_uuid can be checked by using the command
61 | ```
62 | sudo cat /sys/class/dmi/id/product_uuid
63 | ```
64 |
65 |
66 | ### Set Docker to launch at boot by entering the following
67 | ```
68 | sudo systemctl enable docker
69 | ```
70 |
71 |
72 | ### Verify Docker is running
73 | ```
74 | sudo systemctl status docker
75 | ```
76 |
77 |
78 | ### Add Kubernetes Repo
79 | ```
80 | sudo apt-get install -y apt-transport-https ca-certificates curl
81 | curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
82 | echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
83 | ```
84 |
85 | ### Install kubeadm kubelet kubectl
86 | ```
87 | sudo apt-get update
88 | sudo apt-get install -y kubelet kubeadm kubectl
89 | sudo apt-mark hold kubelet kubeadm kubectl
90 | ```
91 |
92 | ### Verify the installation with kubeadm
93 | ```
94 | kubeadm version
95 | kubectl version --short
96 | ```
97 |
98 | ### Initialize Kubernetes on Master Node
99 | ```
100 | sudo kubeadm init --pod-network-cidr=10.244.0.0/16
101 | ```
102 |
103 | ### Enter the following to create a directory for the cluster: To start using your cluster, you need to run the following as a regular user
104 | ```
105 | sudo mkdir -p $HOME/.kube
106 | sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
107 | sudo chown $(id -u):$(id -g) $HOME/.kube/config
108 | ```
109 |
110 |
111 | ### Now check to see if the kubectl command is activated
112 | ```
113 | kubectl get nodes
114 |
115 | NAME STATUS ROLES AGE VERSION
116 | master-node NOtReady master 8m3s v1.18.5
117 | ```
118 |
119 | ### Deploy Pod Network to Cluster
120 | ```
121 | sudo kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
122 | ```
123 |
124 | ### Verify that everything is running and communicating
125 | ```
126 | kubectl get pod --all-namespaces
127 | ```
128 |
129 | ### Cross check your cluster is running status
130 | ```
131 | kubectl get nodes
132 | ```
133 |
134 | ### Remove taint from k8-master node
135 | ```
136 | ## For v1.27.1
137 | kubectl taint nodes k8-master node-role.kubernetes.io/control-plane:NoSchedule-
138 | ```
139 |
140 |
141 |
142 | # KUBERNETES CLUSTER TESTING
143 |
144 | ### Check pod status
145 | ```
146 | kubectl get pod
147 | ```
148 |
149 | ### Create testing.yml and insert below content
150 |
151 | vim testing.yaml
152 | ```
153 | apiVersion: v1
154 | kind: Pod
155 | metadata:
156 | name: testing
157 | spec:
158 | containers:
159 | - name: testing
160 | image: nginx
161 | ```
162 |
163 | ### Check pod status
164 | ```
165 | kubectl apply -f testing.yaml
166 | ```
167 |
168 | ### Check pod status
169 | ```
170 | kubectl get pod
171 | ```
172 |
173 | ### After check delete the pod
174 | ```
175 | kubectl delete -f testing.yaml
176 | ```
177 |
178 | ## `************************* EOF *************************`
179 |
--------------------------------------------------------------------------------
/ubuntu/devops_real_time_project/project_1/kubernetes_installation_p1.md:
--------------------------------------------------------------------------------
1 | # KUBERNETES CLUSTER INSTALLATION
2 |
3 | ## Pre-Requisites
4 |
5 | ### Kubernetes Cluster Server Details:
6 | ```
7 | Operating System : Ubuntu
8 | Hostname : k8-master
9 | RAM : 2 GB
10 | CPU : 2 Core
11 | EC2 Instance : t3a.small
12 | ```
13 |
14 | # ON MASTER NODE
15 |
16 | ### Switch to root user & Update repository of ubuntu
17 | ```
18 | sudo -i
19 | sudo apt update
20 | ```
21 |
22 | ### Start by disabling the swap memory
23 | ```
24 | sudo swapoff -a
25 | sed -i 's/^\(.*swap.*\)$/#\1/' /etc/fstab
26 | ```
27 |
28 | ### Change time hostname
29 | ```
30 | hostname
31 | sudo hostnamectl set-hostname k8-master
32 | bash
33 | hostname
34 | ```
35 |
36 | ### Change time zone
37 | ```
38 | date
39 | timedatectl
40 | sudo timedatectl set-timezone Asia/Kolkata
41 | timedatectl
42 | date
43 | ```
44 |
45 | ### Install Docker with the command
46 | ```
47 | sudo apt-get install -y \
48 | apt-transport-https \
49 | ca-certificates \
50 | curl \
51 | gnupg-agent \
52 | software-properties-common
53 | ```
54 |
55 | ### Add Docker’s official GPG key
56 | ```
57 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
58 | ```
59 |
60 |
61 | ### Add Docker Repo
62 | ```
63 | sudo add-apt-repository \
64 | "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
65 | $(lsb_release -cs) \
66 | stable"
67 | ```
68 |
69 | ### Install the latest version of Docker Engine and containerd
70 | ```
71 | sudo apt-get install -y docker-ce docker-ce-cli containerd.io
72 | ```
73 |
74 |
75 | ### Check the installation (and version) by entering the following
76 | ```
77 | docker --version
78 | ```
79 |
80 |
81 | ### The product_uuid can be checked by using the command
82 | ```
83 | sudo cat /sys/class/dmi/id/product_uuid
84 | ```
85 |
86 |
87 | ### Set Docker to launch at boot by entering the following
88 | ```
89 | sudo systemctl enable docker
90 | ```
91 |
92 |
93 | ### Verify Docker is running
94 | ```
95 | sudo systemctl status docker
96 | ```
97 |
98 |
99 | ### Add Kubernetes Repo
100 | ```
101 | {
102 | curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
103 | echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
104 | }
105 | ```
106 |
107 | ### Install kubeadm kubelet kubectl
108 | ```
109 | apt update && apt-get install -y kubelet=1.21* kubeadm=1.21* kubectl=1.21* ## For 1.21 version
110 | sudo apt-mark hold kubelet kubeadm kubectl
111 | ```
112 |
113 | ### Verify the installation with kubeadm
114 | ```
115 | kubeadm version
116 | kubectl version --short
117 | ```
118 |
119 | ### Initialize Kubernetes on Master Node
120 | ```
121 | sudo kubeadm init --pod-network-cidr=10.244.0.0/16
122 | ```
123 |
124 | ### Enter the following to create a directory for the cluster: To start using your cluster, you need to run the following as a regular user
125 | ```
126 | sudo mkdir -p $HOME/.kube
127 | sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
128 | sudo chown $(id -u):$(id -g) $HOME/.kube/config
129 | ```
130 |
131 |
132 | ### Now check to see if the kubectl command is activated
133 | ```
134 | kubectl get nodes
135 |
136 | NAME STATUS ROLES AGE VERSION
137 | master-node NOtReady master 8m3s v1.18.5
138 | ```
139 |
140 | ### Deploy Pod Network to Cluster
141 | ```
142 | sudo kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
143 | ```
144 |
145 | ### Verify that everything is running and communicating
146 | ```
147 | kubectl get pod --all-namespaces
148 | ```
149 |
150 | ### Cross check your cluster is running status
151 | ```
152 | kubectl get nodes
153 | ```
154 |
155 | ### Remove taint from k8-master node
156 | ```
157 | kubectl taint nodes k8-master node-role.kubernetes.io/control-plane:NoSchedule- ## v1.27.1
158 | OR
159 | kubectl taint nodes k8-master node-role.kubernetes.io/master:NoSchedule- ## v1.21.14
160 |
161 | ```
162 |
163 |
164 |
165 | # KUBERNETES CLUSTER TESTING
166 |
167 | ### Check pod status
168 | ```
169 | kubectl get pod
170 | ```
171 |
172 | ### Create testing.yml and insert below content
173 |
174 | vim testing.yaml
175 | ```
176 | apiVersion: v1
177 | kind: Pod
178 | metadata:
179 | name: testing
180 | spec:
181 | containers:
182 | - name: testing
183 | image: nginx
184 | ```
185 |
186 | ### Check pod status
187 | ```
188 | kubectl apply -f testing.yaml
189 | ```
190 |
191 | ### Check pod status
192 | ```
193 | kubectl get pod
194 | ```
195 |
196 | ### After check delete the pod
197 | ```
198 | kubectl delete -f testing.yaml
199 | ```
200 |
201 | ## `************************* EOF *************************`
202 |
--------------------------------------------------------------------------------
/ubuntu/devops_real_time_project/project_1/project_1.md:
--------------------------------------------------------------------------------
1 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
2 |
3 |
4 |
5 | Connect with me:
6 |
7 |
8 | - Click 👉 **[Whatsapp DevOps Jobs Group](https://chat.whatsapp.com/J1oriqe9ckc9NolOiStPti)**
9 | - Click 👉 **[Telegram DevOps Jobs Group](https://t.me/DevOps_Linux_Jobs)**
10 | - Click 👉 **[YouTube](https://www.youtube.com/@sunnygodiwal007/)**
11 | - Click 👉 **[GitHub](https://github.com/sunnydevops2022/)**
12 | - Click 👉 **[LinkedIn](https://www.linkedin.com/in/sunnygodiwal/)**
13 |
14 |
15 |
16 |
🔥 PROJECT 1 🔥
17 |
18 | ## _++++++++++++++++++++++ PART-1 ++++++++++++++++++++++_
19 |
20 | ### Overview of project-1
21 |
22 |
23 |
24 |
25 |
26 |
27 | ## _++++++++++++++++++++++ PART-2 ++++++++++++++++++++++_
28 |
29 | ### Configure all below pre-requisites for project.
30 |
31 |
32 |
33 | 1. **[Install Jenkins & Ansible & Maven ](https://github.com/sunnydevops2022/DevOps/blob/master/ubuntu/devops_real_time_project/project_1/jenkins_ansible_installation_p1.md)**
34 |
35 | 1. **[Install Sonarqube](https://github.com/sunnydevops2022/DevOps/blob/master/ubuntu/devops_real_time_project/project_1/sonarqube_installation_p1.md)**
36 |
37 | 1. **[Install Kubernetes Cluster](https://github.com/sunnydevops2022/DevOps/blob/master/ubuntu/devops_real_time_project/project_1/kubernetes_installation_p1.md)**
38 |
39 | 1. **[Git Account](https://github.com/)**
40 |
41 | 1. **[Dockerhub Account](https://hub.docker.com/)**
42 |
43 |
44 |
45 |
46 |
47 | ## _++++++++++++++++++++++ PART-3 ++++++++++++++++++++++_
48 |
49 | ### Configure jenkins pipeline job.
50 | ```
51 | Login Jenkins > New Item > project-1 > Pipeline > OK
52 |
53 | Pipeline:
54 | Definition: Pipeline script from SCM
55 |
56 | SCM: Git
57 |
58 | Repositories:
59 | Repository URL: https://github.com/sunnydevops2022/devops_real_time_project_1.git
60 |
61 | Script Path: Jenkinsfile
62 | ```
63 |
64 |
65 | ### Jenkins integration with Sonarqube server.
66 |
67 |
68 |
69 | ### Login Sonarqube server
70 | ```
71 | Sonarqube > My Account > Security > Generate Tokens
72 | Name : porject-1
73 | Type : Global Analysis Token
74 | Expires : 30 Days
75 | Generate
76 |
77 | After that copy token & save it.
78 | ```
79 |
80 | ### Go to Jenkins and create credential for Sonar token
81 | ```
82 | Dashboard > Manage Jenkins > Credentials > System Global credentials (unrestricted) > Add credentials >
83 | kind: Secret text
84 | Scope: Global
85 | Secret: ******
86 | ID: SONAR_TOKEN
87 | Des: SONAR_TOKEN
88 | Create
89 | ```
90 |
91 |
92 | ### Configure inventry file & Password less authentication with Kubernetes server.
93 | ```
94 | +++++++++++++++ KUBERNETES SERVER ++++++++++++++++++++++
95 |
96 | passwd root
97 | cp -r /etc/ssh/sshd_config /etc/ssh/sshd_config_orig
98 | sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
99 | sed -i "s/PasswordAuthentication no/PasswordAuthentication yes/g" /etc/ssh/sshd_config
100 | systemctl restart sshd.service
101 |
102 | +++++++++++++++ ANSIBLE SERVER ++++++++++++++++++++++
103 |
104 | cat /etc/ansible/hosts
105 | > /etc/ansible/hosts
106 | cat /etc/ansible/hosts
107 |
108 | vim /etc/ansible/hosts
109 |
110 | [kubernetes]
111 |
112 |
113 | cat /etc/ansible/hosts
114 | su - jenkins
115 | ansible -m ping kubernetes -u root
116 | ssh root@
117 | ssh-keygen
118 | ssh-copy-id root@
119 | ssh root@
120 |
121 | ansible -m ping kubernetes -u root
122 | ```
123 |
124 |
125 | ### Create credential for Dockerhub server login.
126 | ```
127 | Dashboard > Manage Jenkins > Credentials > System Global credentials (unrestricted) > Add credentials >
128 | kind: Secret text
129 | Scope: Global
130 | Secret: ******
131 | ID: DOCKERHUB_USER
132 | Des: DOCKERHUB_USER
133 | Create
134 |
135 | ##################################
136 |
137 | Dashboard > Manage Jenkins > Credentials > System Global credentials (unrestricted) > Add credentials >
138 | kind: Secret text
139 | Scope: Global
140 | Secret: ******
141 | ID: DOCKERHUB_PASS
142 | Des: DOCKERHUB_PASS
143 | Create
144 | ```
145 |
146 |
147 | ### Github integrate with Jenkins.
148 | ```
149 | +++++++++++++++ GITHUB ACCOUNT ++++++++++++++++++++++
150 | Github > Repository > Settings > Webhooks > Add Webhooks >
151 | Payload UR : http://:8080/github-webhook/
152 | Content type : application/json
153 |
154 | Just the push event.
155 |
156 | +++++++++++++++ JENKINS SERVER ++++++++++++++++++++++
157 |
158 | Jenkins > project-1 > Configure > Build Triggers >
159 | GitHub hook trigger for GITScm polling
160 | ```
161 |
162 |
163 |
164 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
165 |
166 |
167 |
168 | ## `************************* EOF *************************`
169 |
--------------------------------------------------------------------------------
/ubuntu/devops_real_time_project/project_1/project_1_overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunnydevops2022/DevOps/46b07005a552ceec51f0b806abf9e1e8c7d7a7f5/ubuntu/devops_real_time_project/project_1/project_1_overview.png
--------------------------------------------------------------------------------
/ubuntu/devops_real_time_project/project_1/sonarqube_installation_p1.md:
--------------------------------------------------------------------------------
1 | ## SONARQUBE INSTALLATION
2 |
3 | ## Pre-Requisites
4 |
5 | ### Jenkins Server Details:
6 | ```
7 | Operating System : Ubuntu
8 | Hostname : sonarqube
9 | RAM : 2 GB
10 | CPU : 1 Core
11 | EC2 Instance : t2.small
12 | ```
13 |
14 | #### Update repository of ubuntu
15 | ```
16 | ## Download URL: https://www.sonarsource.com/products/sonarqube/downloads/
17 |
18 | sudo -i
19 | sudo apt update
20 | ```
21 |
22 | ### Change time zone
23 | ```
24 | date
25 | timedatectl
26 | sudo timedatectl set-timezone Asia/Kolkata
27 | timedatectl
28 | date
29 | ```
30 |
31 | ### Change time hostname
32 | ```
33 | hostnamectl set-hostname sonarqube
34 | bash
35 | ```
36 |
37 | ### Install Java
38 | ```
39 | java -version
40 | apt-get install openjdk-17-jdk -y ## For sonarqube-10.0.0.68432.zip
41 | apt-get install openjdk-11-jdk -y ## For sonarqube-8.9.2.46101.zip
42 | java -version
43 | ```
44 |
45 | ### Install Sonarqube
46 | ```
47 | cd /opt/
48 | wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-10.0.0.68432.zip
49 | OR
50 | wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-8.9.2.46101.zip
51 | apt install unzip -y
52 | unzip sonarqube-10.0.0.68432.zip
53 | ls
54 | rm -rf sonarqube-10.0.0.68432.zip
55 | mv sonarqube-10.0.0.68432 sonarqube
56 | ls
57 | ```
58 |
59 | ### Create sonar user
60 | ```
61 | useradd -d /opt/sonarqube sonar
62 | cat /etc/passwd | grep sonar
63 | ls -ld /opt/sonarqube
64 | chown -R sonar:sonar /opt/sonarqube
65 | ls -ld /opt/sonarqube
66 | ```
67 |
68 | ### Create custom service for sonar
69 | ```
70 | cat >> /etc/systemd/system/sonarqube.service <:9000
121 |
122 | U: admin
123 | P: admin
124 |
125 | New Pass: admin@123
126 | ```
127 |
--------------------------------------------------------------------------------
/ubuntu/devops_real_time_project/project_1_in_english/jenkins_ansible_installation_p1.md:
--------------------------------------------------------------------------------
1 | ## ++++++++++++++++++ JENKINS INSTALLATION ++++++++++++++++++
2 |
3 | ## Pre-Requisites
4 |
5 | ### Jenkins Server Details:
6 | ```
7 | Operating System : Ubuntu
8 | Hostname : jenkins-ansible
9 | RAM : 2 GB
10 | CPU : 1 Core
11 | EC2 Instance : t2.small
12 | ```
13 |
14 | #### Update repository of ubuntu
15 | ```
16 | sudo -i
17 | sudo apt-get update
18 | ```
19 |
20 | ### Change time zone
21 | ```
22 | date
23 | timedatectl
24 | sudo timedatectl set-timezone Asia/Kolkata
25 | timedatectl
26 | date
27 | ```
28 |
29 | ### Change hostname
30 | ```
31 | hostname
32 | hostnamectl set-hostname jenkins-ansible
33 | bash
34 | hostname
35 | ```
36 |
37 | ### Install Java
38 | ```
39 | java -version
40 | apt-get install openjdk-11-jdk
41 | java -version
42 | ```
43 |
44 | ### Install Jenkins
45 | ```
46 | curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
47 | /usr/share/keyrings/jenkins-keyring.asc > /dev/null
48 |
49 | echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
50 | https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
51 | /etc/apt/sources.list.d/jenkins.list > /dev/null
52 |
53 | sudo apt-get update
54 | sudo apt-get install jenkins=2.361.3 -y
55 | ```
56 |
57 | ### Service start
58 | ```
59 | systemctl start jenkins
60 | ```
61 |
62 | ### Service enable & check status
63 | ```
64 | systemctl enable jenkins
65 | systemctl status jenkins
66 | ```
67 |
68 | ### Check 8080 port is used or not
69 | ```
70 | netstat -plant | grep 8080
71 | ```
72 |
73 | ### Check version & Open jenkins on browser
74 | ```
75 | jenkins --version
76 |
77 | URL: http://:8080
78 | ```
79 |
80 | ### Get Jenkins Administrator password using this command
81 | ```
82 | sudo cat /var/lib/jenkins/secrets/initialAdminPassword
83 | ```
84 |
85 |
86 |
87 |
88 |
89 |
90 | ## ++++++++++++++++++ ANSIBLE INSTALLATION ++++++++++++++++++
91 |
92 | ### Add Ansible repository
93 | ```
94 | sudo apt-add-repository ppa:ansible/ansible
95 | ```
96 |
97 | ### Now fetch latest update & install Ansible
98 | ```
99 | sudo apt update
100 | sudo apt-get install ansible -y
101 | ```
102 |
103 | ### Now check Ansible version
104 | ```
105 | ansible --version
106 | ```
107 |
108 |
109 |
110 |
111 |
112 |
113 | ## ++++++++++++++++++ MAVEN INSTALLATION ++++++++++++++++++
114 |
115 | ### Check version before install
116 | ```
117 | mvn --version
118 | ```
119 |
120 | ### Change dir to /opt and download maven
121 | ```
122 | cd /opt/
123 | ls
124 | wget https://dlcdn.apache.org/maven/maven-3/3.9.3/binaries/apache-maven-3.9.3-bin.zip
125 | apt-get install unzip -y
126 | unzip apache-maven-3.9.3-bin.zip
127 | ls
128 | rm -rf apache-maven-3.9.3-bin.zip
129 | ls
130 | ```
131 |
132 | ### Configure maven home path
133 | ```
134 | vim ~/.bashrc
135 |
136 | ## Add end of the file & save it.
137 | export M2_HOME=/opt/apache-maven-3.9.3
138 | export PATH=$PATH:$M2_HOME/bin
139 |
140 | source ~/.bashrc
141 | ```
142 |
143 | ### Check version again now
144 | ```
145 | mvn --version
146 | mvn --help
147 | ```
148 |
149 | ## `************************* EOF *************************`
150 |
--------------------------------------------------------------------------------
/ubuntu/devops_real_time_project/project_1_in_english/kubernetes_installation_ec2_p1.md:
--------------------------------------------------------------------------------
1 | # KUBERNETES CLUSTER INSTALLATION
2 |
3 | ## Pre-Requisites
4 |
5 | ### Kubernetes Cluster Server Details:
6 | ```
7 | Operating System : Ubuntu
8 | Hostname : k8-master
9 | RAM : 2 GB
10 | CPU : 2 Core
11 | EC2 Instance : t3a.small
12 | Disk Size : 30 GB
13 | ```
14 |
15 | # ON MASTER NODE
16 |
17 | ### Switch to root user & Update repository of ubuntu
18 | ```
19 | sudo -i
20 | sudo apt update
21 | ```
22 |
23 | ### Start by disabling the swap memory
24 | ```
25 | sudo swapoff -a
26 | sed -i 's/^\(.*swap.*\)$/#\1/' /etc/fstab
27 | ```
28 |
29 | ### Change time hostname
30 | ```
31 | hostname
32 | sudo hostnamectl set-hostname k8-master
33 | bash
34 | hostname
35 | ```
36 |
37 | ### Change time zone
38 | ```
39 | date
40 | timedatectl
41 | sudo timedatectl set-timezone Asia/Kolkata
42 | timedatectl
43 | date
44 | ```
45 |
46 | ### Install Docker, start service
47 | ```
48 | sudo apt-get update
49 | sudo apt-get install docker.io -y
50 | sudo systemctl start docker
51 | ```
52 |
53 |
54 | ### Check the installation (and version) by entering the following
55 | ```
56 | docker --version
57 | ```
58 |
59 |
60 | ### The product_uuid can be checked by using the command
61 | ```
62 | sudo cat /sys/class/dmi/id/product_uuid
63 | ```
64 |
65 |
66 | ### Set Docker to launch at boot by entering the following
67 | ```
68 | sudo systemctl enable docker
69 | ```
70 |
71 |
72 | ### Verify Docker is running
73 | ```
74 | sudo systemctl status docker
75 | ```
76 |
77 |
78 | ### Add Kubernetes Repo
79 | ```
80 | sudo apt-get install -y apt-transport-https ca-certificates curl
81 | curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
82 | echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
83 | ```
84 |
85 | ### Install kubeadm kubelet kubectl
86 | ```
87 | sudo apt-get update
88 | sudo apt-get install -y kubelet kubeadm kubectl
89 | sudo apt-mark hold kubelet kubeadm kubectl
90 | ```
91 |
92 | ### Verify the installation with kubeadm
93 | ```
94 | kubeadm version
95 | kubectl version --short
96 | ```
97 |
98 | ### Initialize Kubernetes on Master Node
99 | ```
100 | sudo kubeadm init --pod-network-cidr=10.244.0.0/16
101 | ```
102 |
103 | ### Enter the following to create a directory for the cluster: To start using your cluster, you need to run the following as a regular user
104 | ```
105 | sudo mkdir -p $HOME/.kube
106 | sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
107 | sudo chown $(id -u):$(id -g) $HOME/.kube/config
108 | ```
109 |
110 |
111 | ### Now check to see if the kubectl command is activated
112 | ```
113 | kubectl get nodes
114 |
115 | NAME STATUS ROLES AGE VERSION
116 | k8-master NotReady control-plane 44s v1.27.3
117 | ```
118 |
119 | ### Deploy Pod Network to Cluster
120 | ```
121 | sudo kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
122 | ```
123 |
124 | ### Verify that everything is running and communicating
125 | ```
126 | kubectl get pod --all-namespaces
127 | ```
128 |
129 | ### Cross check your cluster is running status
130 | ```
131 | kubectl get nodes
132 | ```
133 |
134 | ### Remove taint from k8-master node
135 | ```
136 | ## For v1.27.1
137 | kubectl taint nodes k8-master node-role.kubernetes.io/control-plane:NoSchedule-
138 | ```
139 |
140 |
141 |
142 | # KUBERNETES CLUSTER TESTING
143 |
144 | ### Check pod status
145 | ```
146 | kubectl get pod
147 | ```
148 |
149 | ### Create testing.yml and insert below content
150 |
151 | vim testing.yaml
152 | ```
153 | apiVersion: v1
154 | kind: Pod
155 | metadata:
156 | name: testing
157 | spec:
158 | containers:
159 | - name: testing
160 | image: nginx
161 | ```
162 |
163 | ### Check pod status
164 | ```
165 | kubectl apply -f testing.yaml
166 | ```
167 |
168 | ### Check pod status
169 | ```
170 | kubectl get pod
171 | ```
172 |
173 | ### After check delete the pod
174 | ```
175 | kubectl delete -f testing.yaml
176 | ```
177 |
178 | ## `************************* EOF *************************`
179 |
--------------------------------------------------------------------------------
/ubuntu/devops_real_time_project/project_1_in_english/kubernetes_installation_p1.md:
--------------------------------------------------------------------------------
1 | # KUBERNETES CLUSTER INSTALLATION
2 |
3 | ## Pre-Requisites
4 |
5 | ### Kubernetes Cluster Server Details:
6 | ```
7 | Operating System : Ubuntu
8 | Hostname : k8-master
9 | RAM : 2 GB
10 | CPU : 2 Core
11 | EC2 Instance : t3a.small
12 | ```
13 |
14 | # ON MASTER NODE
15 |
16 | ### Switch to root user & Update repository of ubuntu
17 | ```
18 | sudo -i
19 | sudo apt update
20 | ```
21 |
22 | ### Start by disabling the swap memory
23 | ```
24 | sudo swapoff -a
25 | sed -i 's/^\(.*swap.*\)$/#\1/' /etc/fstab
26 | ```
27 |
28 | ### Change time hostname
29 | ```
30 | hostname
31 | sudo hostnamectl set-hostname k8-master
32 | bash
33 | hostname
34 | ```
35 |
36 | ### Change time zone
37 | ```
38 | date
39 | timedatectl
40 | sudo timedatectl set-timezone Asia/Kolkata
41 | timedatectl
42 | date
43 | ```
44 |
45 | ### Install Docker with the command
46 | ```
47 | sudo apt-get install -y \
48 | apt-transport-https \
49 | ca-certificates \
50 | curl \
51 | gnupg-agent \
52 | software-properties-common
53 | ```
54 |
55 | ### Add Docker’s official GPG key
56 | ```
57 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
58 | ```
59 |
60 |
61 | ### Add Docker Repo
62 | ```
63 | sudo add-apt-repository \
64 | "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
65 | $(lsb_release -cs) \
66 | stable"
67 | ```
68 |
69 | ### Install the latest version of Docker Engine and containerd
70 | ```
71 | sudo apt-get install -y docker-ce docker-ce-cli containerd.io
72 | ```
73 |
74 |
75 | ### Check the installation (and version) by entering the following
76 | ```
77 | docker --version
78 | ```
79 |
80 |
81 | ### The product_uuid can be checked by using the command
82 | ```
83 | sudo cat /sys/class/dmi/id/product_uuid
84 | ```
85 |
86 |
87 | ### Set Docker to launch at boot by entering the following
88 | ```
89 | sudo systemctl enable docker
90 | ```
91 |
92 |
93 | ### Verify Docker is running
94 | ```
95 | sudo systemctl status docker
96 | ```
97 |
98 |
99 | ### Add Kubernetes Repo
100 | ```
101 | {
102 | curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
103 | echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
104 | }
105 | ```
106 |
107 | ### Install kubeadm kubelet kubectl
108 | ```
109 | apt update && apt-get install -y kubelet=1.21* kubeadm=1.21* kubectl=1.21* ## For 1.21 version
110 | sudo apt-mark hold kubelet kubeadm kubectl
111 | ```
112 |
113 | ### Verify the installation with kubeadm
114 | ```
115 | kubeadm version
116 | kubectl version --short
117 | ```
118 |
119 | ### Initialize Kubernetes on Master Node
120 | ```
121 | sudo kubeadm init --pod-network-cidr=10.244.0.0/16
122 | ```
123 |
124 | ### Enter the following to create a directory for the cluster: To start using your cluster, you need to run the following as a regular user
125 | ```
126 | sudo mkdir -p $HOME/.kube
127 | sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
128 | sudo chown $(id -u):$(id -g) $HOME/.kube/config
129 | ```
130 |
131 |
132 | ### Now check to see if the kubectl command is activated
133 | ```
134 | kubectl get nodes
135 |
136 | NAME STATUS ROLES AGE VERSION
137 | master-node NOtReady master 8m3s v1.18.5
138 | ```
139 |
140 | ### Deploy Pod Network to Cluster
141 | ```
142 | sudo kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
143 | ```
144 |
145 | ### Verify that everything is running and communicating
146 | ```
147 | kubectl get pod --all-namespaces
148 | ```
149 |
150 | ### Cross check your cluster is running status
151 | ```
152 | kubectl get nodes
153 | ```
154 |
155 | ### Remove taint from k8-master node
156 | ```
157 | kubectl taint nodes k8-master node-role.kubernetes.io/control-plane:NoSchedule- ## v1.27.1
158 | OR
159 | kubectl taint nodes k8-master node-role.kubernetes.io/master:NoSchedule- ## v1.21.14
160 |
161 | ```
162 |
163 |
164 |
165 | # KUBERNETES CLUSTER TESTING
166 |
167 | ### Check pod status
168 | ```
169 | kubectl get pod
170 | ```
171 |
172 | ### Create testing.yml and insert below content
173 |
174 | vim testing.yaml
175 | ```
176 | apiVersion: v1
177 | kind: Pod
178 | metadata:
179 | name: testing
180 | spec:
181 | containers:
182 | - name: testing
183 | image: nginx
184 | ```
185 |
186 | ### Check pod status
187 | ```
188 | kubectl apply -f testing.yaml
189 | ```
190 |
191 | ### Check pod status
192 | ```
193 | kubectl get pod
194 | ```
195 |
196 | ### After check delete the pod
197 | ```
198 | kubectl delete -f testing.yaml
199 | ```
200 |
201 | ## `************************* EOF *************************`
202 |
--------------------------------------------------------------------------------
/ubuntu/devops_real_time_project/project_1_in_english/project_1.md:
--------------------------------------------------------------------------------
1 | ### Last Tested
2 | ```
3 | Date: 07-May-2023
4 | ```
5 | ## +++++++++++++++++++++++++++ PART-1 ++++++++++++++++++++++++++++
6 |
7 | ### Overview of project-1
8 |
9 |
10 |
11 |
12 |
13 |
14 | ## +++++++++++++++++++++++++++ PART-2 ++++++++++++++++++++++++++++
15 |
16 | ### Configure all below pre-requisites for project.
17 |
18 |
19 |
20 | 1. **[Install Jenkins & Ansible & Maven ](https://github.com/sunnydevops2022/DevOps/blob/master/ubuntu/devops_real_time_project/project_1_in_english/jenkins_ansible_installation_p1.md)**
21 |
22 | 1. **[Install Sonarqube](https://github.com/sunnydevops2022/DevOps/blob/master/ubuntu/devops_real_time_project/project_1_in_english/sonarqube_installation_p1.md)**
23 |
24 | 1. **[Install Kubernetes Cluster](https://github.com/sunnydevops2022/DevOps/blob/master/ubuntu/devops_real_time_project/project_1_in_english/kubernetes_installation_ec2_p1.md)**
25 |
26 | 1. **[Git Account](https://github.com/)**
27 |
28 | 1. **[Dockerhub Account](https://hub.docker.com/)**
29 |
30 |
31 |
32 |
33 |
34 | ## +++++++++++++++++++++++++++ PART-3 ++++++++++++++++++++++++++++
35 |
36 | ### Configure jenkins pipeline job.
37 | ```
38 | Login Jenkins > New Item > project-1 > Pipeline > OK
39 |
40 | Pipeline:
41 | Definition: Pipeline script from SCM
42 |
43 | SCM: Git
44 |
45 | Repositories:
46 | Repository URL: https://github.com/sunnydevops2022/devops_real_time_project_1_english.git
47 |
48 | Branch Specifier
49 | */main
50 |
51 | Script Path: Jenkinsfile
52 | ```
53 |
54 |
55 | ### Jenkins integration with Sonarqube server.
56 |
57 |
58 |
59 | ### Login Sonarqube server
60 | ```
61 | Sonarqube > My Account > Security > Generate Tokens
62 | Name : porject-1
63 | Type : Global Analysis Token
64 | Expires : 30 Days
65 | Generate
66 |
67 | After that copy token & save it.
68 | ```
69 |
70 | ### Go to Jenkins and create credential for Sonar token
71 | ```
72 | Dashboard > Manage Jenkins > Credentials > System Global credentials (unrestricted) > Add credentials >
73 | kind: Secret text
74 | Scope: Global
75 | Secret: ******
76 | ID: SONAR_TOKEN
77 | Des: SONAR_TOKEN
78 | Create
79 |
80 | ++++++
81 |
82 | Dashboard > Manage Jenkins > Credentials > System Global credentials (unrestricted) > Add credentials >
83 | kind: Secret text
84 | Scope: Global
85 | Secret: ******
86 | ID: SONAR_PRIVATE_IP
87 | Des: SONAR_PRIVATE_IP
88 | Create
89 |
90 | ```
91 |
92 |
93 | ### Configure inventry file & Password less authentication with Kubernetes server.
94 | ```
95 | +++++++++++++++ KUBERNETES SERVER ++++++++++++++++++++++
96 |
97 | passwd root
98 | cp -r /etc/ssh/sshd_config /etc/ssh/sshd_config_orig
99 | sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
100 | sed -i "s/PasswordAuthentication no/PasswordAuthentication yes/g" /etc/ssh/sshd_config
101 | systemctl restart sshd.service
102 |
103 | +++++++++++++++ ANSIBLE SERVER ++++++++++++++++++++++
104 |
105 | cat /etc/ansible/hosts
106 | > /etc/ansible/hosts
107 | cat /etc/ansible/hosts
108 |
109 | vim /etc/ansible/hosts
110 |
111 | [kubernetes]
112 |
113 |
114 | cat /etc/ansible/hosts
115 | su - jenkins
116 | ansible -m ping kubernetes -u root
117 | ssh root@
118 | ssh-keygen
119 | ssh-copy-id root@
120 | ssh root@
121 |
122 | ansible -m ping kubernetes -u root
123 | ```
124 |
125 |
126 | ### Create credential for Dockerhub server login.
127 | ```
128 | Dashboard > Manage Jenkins > Credentials > System Global credentials (unrestricted) > Add credentials >
129 | kind: Secret text
130 | Scope: Global
131 | Secret: ******
132 | ID: DOCKERHUB_USER
133 | Des: DOCKERHUB_USER
134 | Create
135 |
136 | ##################################
137 |
138 | Dashboard > Manage Jenkins > Credentials > System Global credentials (unrestricted) > Add credentials >
139 | kind: Secret text
140 | Scope: Global
141 | Secret: ******
142 | ID: DOCKERHUB_PASS
143 | Des: DOCKERHUB_PASS
144 | Create
145 | ```
146 |
147 |
148 | ### Github integrate with Jenkins.
149 | ```
150 | +++++++++++++++ GITHUB ACCOUNT ++++++++++++++++++++++
151 | Github > Repository > Settings > Webhooks > Add Webhooks >
152 | Payload UR : http://:8080/github-webhook/
153 | Content type : application/json
154 |
155 | Just the push event.
156 |
157 | +++++++++++++++ JENKINS SERVER ++++++++++++++++++++++
158 |
159 | Jenkins > project-1 > Configure > Build Triggers >
160 | GitHub hook trigger for GITScm polling
161 | ```
162 |
163 |
164 |
165 |
166 |
167 |
168 | ## `************************* EOF *************************`
169 |
--------------------------------------------------------------------------------
/ubuntu/devops_real_time_project/project_1_in_english/project_1_overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunnydevops2022/DevOps/46b07005a552ceec51f0b806abf9e1e8c7d7a7f5/ubuntu/devops_real_time_project/project_1_in_english/project_1_overview.png
--------------------------------------------------------------------------------
/ubuntu/devops_real_time_project/project_1_in_english/sonarqube_installation_p1.md:
--------------------------------------------------------------------------------
1 | ## SONARQUBE INSTALLATION
2 |
3 | ## Pre-Requisites
4 |
5 | ### Jenkins Server Details:
6 | ```
7 | Operating System : Ubuntu
8 | Hostname : sonarqube
9 | RAM : 2 GB
10 | CPU : 1 Core
11 | EC2 Instance : t2.small
12 | ```
13 |
14 | #### Update repository of ubuntu
15 | ```
16 | ## Download URL: https://www.sonarsource.com/products/sonarqube/downloads/
17 |
18 | sudo -i
19 | sudo apt update
20 | ```
21 |
22 | ### Change time zone
23 | ```
24 | date
25 | timedatectl
26 | sudo timedatectl set-timezone Asia/Kolkata
27 | timedatectl
28 | date
29 | ```
30 |
31 | ### Change time hostname
32 | ```
33 | hostnamectl set-hostname sonarqube
34 | bash
35 | ```
36 |
37 | ### Install Java
38 | ```
39 | java -version
40 | apt-get install openjdk-17-jdk -y ## For sonarqube-10.0.0.68432.zip
41 | apt-get install openjdk-11-jdk -y ## For sonarqube-8.9.2.46101.zip
42 | java -version
43 | ```
44 |
45 | ### Install Sonarqube
46 | ```
47 | cd /opt/
48 | wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-10.0.0.68432.zip
49 | OR
50 | wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-8.9.2.46101.zip
51 | apt install unzip -y
52 | unzip sonarqube-10.0.0.68432.zip
53 | ls
54 | rm -rf sonarqube-10.0.0.68432.zip
55 | mv sonarqube-10.0.0.68432 sonarqube
56 | ls
57 | ```
58 |
59 | ### Create sonar user
60 | ```
61 | useradd -d /opt/sonarqube sonar
62 | cat /etc/passwd | grep sonar
63 | ls -ld /opt/sonarqube
64 | chown -R sonar:sonar /opt/sonarqube
65 | ls -ld /opt/sonarqube
66 | ```
67 |
68 | ### Create custom service for sonar
69 | ```
70 | cat >> /etc/systemd/system/sonarqube.service <:9000
121 |
122 | U: admin
123 | P: admin
124 |
125 | New Pass: admin@123
126 | ```
127 |
--------------------------------------------------------------------------------
/ubuntu/docker/docker_installation_on_aws.md:
--------------------------------------------------------------------------------
1 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
2 |
3 | Connect with me:
4 |
5 |
6 | - Click 👉 **[Whatsapp DevOps Jobs Group](https://chat.whatsapp.com/J1oriqe9ckc9NolOiStPti)**
7 | - Click 👉 **[Telegram DevOps Jobs Group](https://t.me/DevOps_Linux_Jobs)**
8 | - Click 👉 **[YouTube](https://www.youtube.com/@sunnygodiwal007/)**
9 | - Click 👉 **[GitHub](https://github.com/sunnydevops2022/)**
10 | - Click 👉 **[LinkedIn](https://www.linkedin.com/in/sunnygodiwal/)**
11 |
12 |
13 |
14 |
🔥 DOCKER INSTALLATION ON UBUNTU (AWS) 🔥
15 |
16 | #### `**** Please Like & Subscribe My Channel To Motivate Me ****`
17 |
18 |
19 | #### Switch to root user & change hostname
20 | ```
21 | sudo -i
22 |
23 | hostnamectl set-hostname docker
24 |
25 | bash
26 | ```
27 |
28 |
29 |
30 | #### Uninstall old versions
31 |
32 | ```
33 | sudo apt-get remove docker docker-engine docker.io containerd runc
34 | ```
35 |
36 |
37 |
38 | #### Set up the repository
39 | ```
40 | sudo apt-get update
41 |
42 | sudo apt-get install \
43 | ca-certificates \
44 | curl \
45 | gnupg \
46 | lsb-release
47 | ```
48 |
49 |
50 |
51 | #### Add Docker’s official GPG key
52 | ```
53 | sudo mkdir -p /etc/apt/keyrings
54 |
55 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
56 | ```
57 |
58 |
59 |
60 | #### Use the following command to set up the repository
61 | ```
62 | echo \
63 | "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
64 | $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
65 | ```
66 |
67 |
68 |
69 | #### Install Docker Engine
70 | ```
71 | sudo apt-get update
72 |
73 | sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
74 | ```
75 |
76 |
77 |
78 | #### Start Docker service
79 | ```
80 | systemctl start docker
81 |
82 | systemctl enable docker
83 |
84 | systemctl status docker
85 | ```
86 |
87 |
88 |
89 | #### Check docker version
90 |
91 | ```
92 | docker version
93 |
94 | docker --version
95 | ```
96 |
97 |
98 |
99 | #### Run demo sample container
100 | ```
101 | docker container ls
102 |
103 | docker image ls
104 |
105 | docker run -itd httpd
106 |
107 | docker container ls
108 |
109 | docker image ls
110 | ```
111 |
112 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
113 |
114 | You will get all steps github repo link in the description box.
115 |
116 | We'll provide DevOps real time project in upcoming video in this channel. So please subscribe my channel.
117 |
118 | ## `************************* EOF *************************`
119 |
120 |
--------------------------------------------------------------------------------
/ubuntu/jenkins/jenkins_installation.md:
--------------------------------------------------------------------------------
1 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
2 |
3 | Connect with me:
4 |
5 |
6 | - Click 👉 **[Whatsapp DevOps Jobs Group](https://chat.whatsapp.com/J1oriqe9ckc9NolOiStPti)**
7 | - Click 👉 **[Telegram DevOps Jobs Group](https://t.me/DevOps_Linux_Jobs)**
8 | - Click 👉 **[YouTube](https://www.youtube.com/@sunnygodiwal007/)**
9 | - Click 👉 **[GitHub](https://github.com/sunnydevops2022/)**
10 | - Click 👉 **[LinkedIn](https://www.linkedin.com/in/sunnygodiwal/)**
11 |
12 |
13 |
14 |
🔥 JENKINS INSTALLATION ON UBUNTU 🔥
15 |
16 | #### `**** Please Like & Subscribe My Channel To Motivate Me ****`
17 |
18 |
19 | #### Install Java Prerequisite
20 | ```
21 | $ sudo su
22 | $ sudo apt update
23 | $ hostname
24 | $ hostnamectl set-hostname jenkins
25 | $ bash
26 | $ java -version
27 | $ apt-get install openjdk-11-jdk -y
28 | $ java -version
29 | ```
30 |
31 |
32 |
33 |
34 | #### Install Jenkins
35 | ```
36 | $ wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
37 | $ echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list
38 | $ sudo apt-get update
39 | $ sudo apt-cache madison jenkins
40 | $ sudo apt-get install jenkins -y ## jenkins=2.361.3
41 | $ sudo systemctl start jenkins
42 | $ sudo systemctl enable jenkins
43 | $ sudo systemctl status jenkins
44 | ```
45 |
46 |
47 |
48 |
49 |
50 | #### Access Jenkins via Browser
51 | ```
52 | http://[public_server_ip]:8080
53 | ```
54 |
55 |
56 |
57 |
58 | #### Update firewall rules in SG
59 | ```
60 | Open Port : 8080
61 | ```
62 |
63 |
64 |
65 |
66 | #### Check about jenkins version details
67 | ```
68 | http://[public_server_ip]/about/
69 | ```
70 |
71 |
72 |
73 |
74 |
75 | #### Get Jenkins Administrator password using this command
76 | ```
77 | $ sudo cat /var/lib/jenkins/secrets/initialAdminPassword
78 | ```
79 |
80 |
81 |
82 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
83 |
84 |
85 | We'll provide DevOps real time project in upcoming video in this channel. So please subscribe my channel.
86 |
87 | ## `************************* EOF *************************`
88 |
89 |
--------------------------------------------------------------------------------
/ubuntu/jenkins_on_container/jenkins_installation_on_docker_container.md:
--------------------------------------------------------------------------------
1 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
2 |
3 | Connect with me:
4 |
5 |
6 | - Click 👉 **[Whatsapp DevOps Jobs Group](https://chat.whatsapp.com/J1oriqe9ckc9NolOiStPti)**
7 | - Click 👉 **[Telegram DevOps Jobs Group](https://t.me/DevOps_Linux_Jobs)**
8 | - Click 👉 **[YouTube](https://www.youtube.com/@sunnygodiwal007/)**
9 | - Click 👉 **[GitHub](https://github.com/sunnydevops2022/)**
10 | - Click 👉 **[LinkedIn](https://www.linkedin.com/in/sunnygodiwal/)**
11 |
12 |
13 |
14 |
🔥 JENKINS INSTALLATION ON DOCKER CONTAINER 🔥
15 |
16 | ## Prerequisite
17 | - Install Docker => https://www.youtube.com/watch?v=G7HgR_2Onks
18 |
19 |
20 |
21 | ### STEP 1
22 | #### Check Docker service status
23 | ```
24 | systemctl status docker
25 | ```
26 |
27 |
28 |
29 | ### STEP 2
30 | #### Check docker version
31 |
32 | ```
33 | docker version
34 | docker --version
35 | ```
36 |
37 |
38 |
39 | ### STEP 3
40 | #### Check any docker container or images exist or not
41 | ```
42 | docker container ls
43 | docker image ls
44 | ```
45 |
46 |
47 |
48 | ### STEP 4
49 | #### Create a directory & change permission of that directory
50 | ```
51 | mkdir my_jenkins
52 | chmod -R 777 my_jenkins/
53 | ls -ld my_jenkins/
54 | ```
55 |
56 |
57 |
58 | ### STEP 5
59 | #### Finally will run jenkins on docker container
60 | ```
61 | docker run -itd -p 8080:8080 -p 50000:50000 -v /root/my_jenkins:/var/jenkins_home jenkins/jenkins:lts-jdk11
62 |
63 | docker container ls
64 | ```
65 |
66 |
67 |
68 | ### STEP 6
69 | #### Now we'll try to open jenkins dashboard from browser
70 | ```
71 | http:[server_ip_add:8080]
72 |
73 | NOTE: Open port 8080 in security group
74 | ```
75 |
76 |
77 |
78 | ### STEP 7
79 | #### Get password from jenkins container
80 | ```
81 | docker exec -it bda3398d0842 /bin/bash
82 | cat /var/jenkins_home/secrets/initialAdminPassword
83 | ```
84 |
85 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
86 |
87 |
88 | We'll provide DevOps real time project in upcoming video in this channel. So please subscribe my channel.
89 |
90 | ## `************************* EOF *************************`
91 |
92 |
--------------------------------------------------------------------------------
/ubuntu/kubernetes/minikube_installation_on_aws.md:
--------------------------------------------------------------------------------
1 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
2 |
3 | Connect with me:
4 |
5 |
6 | - Click 👉 **[Whatsapp DevOps Jobs Group](https://chat.whatsapp.com/J1oriqe9ckc9NolOiStPti)**
7 | - Click 👉 **[Telegram DevOps Jobs Group](https://t.me/DevOps_Linux_Jobs)**
8 | - Click 👉 **[YouTube](https://www.youtube.com/@sunnygodiwal007/)**
9 | - Click 👉 **[GitHub](https://github.com/sunnydevops2022/)**
10 | - Click 👉 **[LinkedIn](https://www.linkedin.com/in/sunnygodiwal/)**
11 |
12 |
13 |
14 |
🔥 MINIKUBE INSTALLATION ON UBUNTU 🔥
15 |
16 |
17 |
18 | #### What you’ll need (Prerequisite)
19 | ```
20 | - 2 CPUs or more
21 | - 2 GB of free memory
22 | - 20 GB of free disk space
23 | - Internet connection
24 |
25 | NOTE : "t3.small" perfect suit for this lab
26 | ```
27 |
28 |
29 |
30 | ## 🔹STEP-1
31 | #### Change hostname
32 | ```
33 | whoami
34 | sudo hostnamectl set-hostname terraform
35 | bash
36 | hostname
37 | ```
38 |
39 |
40 |
41 | ## 🔹STEP-2
42 | #### Update Ubuntu packages install required package for this lab
43 | ```
44 | sudo apt-get update -y
45 | sudo apt-get install apt-transport-https curl conntrack
46 | ```
47 |
48 |
49 |
50 | ## 🔹STEP-3
51 | #### Install Docker
52 | ```
53 | curl -fsSL https://get.docker.com -o get-docker.sh
54 |
55 | sudo sh get-docker.sh
56 | ls -l /var/run/docker.sock
57 | id
58 | sudo usermod -aG docker $USER && newgrp docker
59 | id
60 | docker --version
61 | ```
62 |
63 |
64 |
65 | ## 🔹STEP-4
66 | #### Install Kubectl
67 | ```
68 | curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x ./kubectl && sudo mv ./kubectl /usr/local/bin/kubectl
69 |
70 | sudo chmod +x /usr/local/bin/kubectl
71 | ls -l /usr/local/bin/kubectl
72 | kubectl version --short
73 | ```
74 |
75 |
76 |
77 | ## 🔹STEP-5
78 | #### Install Minikube
79 | ```
80 | curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
81 | ls -l
82 | sudo install minikube-linux-amd64 /usr/local/bin/minikube
83 | minikube version
84 | ```
85 |
86 |
87 |
88 | ## 🔹STEP-6
89 | #### Start Minikube
90 | ```
91 | kubectl cluster-info
92 | minikube start
93 |
94 | kubectl cluster-info
95 | ```
96 |
97 |
98 |
99 | ## 🔹STEP-7
100 | #### Check Minikube status
101 | ```
102 | minikube status
103 | kubectl get nodes
104 | ```
105 |
106 |
107 |
108 | ## 🔹STEP-8
109 | #### Check Minikube all component status
110 | ```
111 | kubectl get po -A
112 | ```
113 |
114 |
115 |
116 | ## 🔹STEP-9
117 | #### Create Nginx pod to validate our 1 node minikube cluster
118 | ```
119 | vim pod.yml
120 | ```
121 |
122 | ```
123 | apiVersion: v1
124 | kind: Pod
125 | metadata:
126 | name: nginx
127 | spec:
128 | containers:
129 | - name: nginx
130 | image: nginx
131 | ports:
132 | - containerPort: 80
133 | ```
134 |
135 |
136 |
137 | ## 🔹STEP-10
138 | #### Run & check Nginx Pod status
139 | ```
140 | kubectl apply -f pod.yml
141 |
142 | kubectl get pod
143 | ```
144 |
145 |
146 |
147 | ## 🔹STEP-11
148 | #### Delete minikube cluster
149 | ```
150 | minikube delete --all
151 | ```
152 |
153 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
154 |
155 | You will get all steps github repo link in the description box & you will get important video's link related to DevOps.
156 |
157 | 👉 We'll provide DevOps real time project in upcoming video in this channel. So please subscribe my channel.
158 |
159 | ## `************************* EOF *************************`
160 |
--------------------------------------------------------------------------------
/ubuntu/terraform/terraform_installation.md:
--------------------------------------------------------------------------------
1 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
2 |
3 | Connect with me:
4 |
5 |
6 | - Click 👉 **[Whatsapp DevOps Jobs Group](https://chat.whatsapp.com/J1oriqe9ckc9NolOiStPti)**
7 | - Click 👉 **[Telegram DevOps Jobs Group](https://t.me/DevOps_Linux_Jobs)**
8 | - Click 👉 **[YouTube](https://www.youtube.com/@sunnygodiwal007/)**
9 | - Click 👉 **[GitHub](https://github.com/sunnydevops2022/)**
10 | - Click 👉 **[LinkedIn](https://www.linkedin.com/in/sunnygodiwal/)**
11 |
12 |
13 |
14 |
🔥 TERRAFORM INSTALLATION ON UBUNTU 🔥
15 |
16 |
17 |
18 | ## 🔹STEP-1
19 | #### Update Ubuntu packages
20 | ```
21 | $ sudo -i
22 | $ apt-get update
23 | ```
24 |
25 |
26 |
27 | ## 🔹STEP-2
28 | #### Change hostname
29 | ```
30 | $ hostnamectl set-hostname terraform
31 | $ bash
32 | $ hostname
33 | ```
34 |
35 |
36 |
37 | ## 🔹STEP-3
38 | #### Check Terraform version exist or not ?
39 | ```
40 | $ terraform -v
41 | ```
42 |
43 |
44 |
45 | ## 🔹STEP-4
46 | #### Install Terraform
47 | ```
48 | $ wget https://releases.hashicorp.com/terraform/1.3.4/terraform_1.3.4_linux_amd64.zip
49 | $ apt-get install unzip
50 | $ unzip terraform_1.3.4_linux_amd64.zip
51 | $ ls -l
52 | $ cp terraform /usr/bin/
53 | ```
54 |
55 |
56 |
57 | ## 🔹STEP-5
58 | #### Now check Terraform version
59 | ```
60 | $ terraform -v
61 | ```
62 |
63 | 🔥🔥 👉 Please Like & Subscribe My Channel To Motivate Me 🔥🔥 🙏 👍
64 |
65 | You will get all steps github repo link in the description box & you will get important video's link related to DevOps.
66 |
67 | 👉 We'll provide DevOps real time project in upcoming video in this channel. So please subscribe my channel.
68 |
69 | ## `************************* EOF *************************`
70 |
--------------------------------------------------------------------------------