From 68448900423ac14b39003f5d39887a7d55be6331 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Thu, 14 Dec 2023 11:29:22 +0530
Subject: [PATCH 01/30] Update day-04
---
day-04 | 84 +++++++++++-----------------------------------------------
1 file changed, 16 insertions(+), 68 deletions(-)
diff --git a/day-04 b/day-04
index 1b12b6e..8b1c4c9 100644
--- a/day-04
+++ b/day-04
@@ -40,7 +40,6 @@ S : STEPS
SINGLE STAGE: this pipeline will have only one stage.
-
pipeline {
agent any
@@ -54,18 +53,6 @@ pipeline {
}
-pipeline {
- agent any
-
- stages {
- stage('raham') {
- steps {
- sh 'touch file2'
- }
- }
- }
-}
-
MULTI STAGE: this pipeline will have more than one stage.
EXAMPLE-1:
@@ -86,23 +73,6 @@ pipeline {
}
}
-EXAMPLE-2:
-pipeline {
- agent any
-
- stages {
- stage('cpu') {
- steps {
- sh 'lscpu'
- }
- }
- stage('mem') {
- steps {
- sh 'lsmem'
- }
- }
- }
-}
CI PIPELINE:
@@ -193,25 +163,6 @@ pipeline {
}
}
-EXAMPLE-2:
-pipeline {
- agent any
-
- stages {
- stage('one') {
- steps {
- git 'https://github.com/devopsbyraham/jenkins-java-project.git'
- sh '''
- mvn compile
- mvn test
- mvn package
- mvn install
- mvn clean package
- '''
- }
- }
- }
-}
USER INPUT:
pipeline {
@@ -329,26 +280,23 @@ ALTERNATIVES: NGINX, IIS, WEBSPHERE, JBOSS, GLASSFISH
SETUP:
-INSTALL JAVA: amazon-linux-extras install java-openjdk11 -y
-
-STEP-1: DOWNLOAD TOMCAT (dlcdn.apache.org)
+vim tomcat.sh
+#
+amazon-linux-extras install java-openjdk11 -y
wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.83/bin/apache-tomcat-9.0.83.tar.gz
-
-STEP-2: EXTRACT THE FILES
tar -zxvf apache-tomcat-9.0.83.tar.gz
-
-STEP-3: CONFIGURE USER, PASSWORD & ROLES
-vim apache-tomcat-9.0.83/conf/tomcat-users.xml
-
- 56
- 57
- 58
-
-STEP-4: DELETE LINE 21 AND 22
-vim apache-tomcat-9.0.83/webapps/manager/META-INF/context.xml
-
-STEP-5: STARTING TOMCAT
+sed -i '56 a\' apache-tomcat-9.0.83/conf/tomcat-users.xml
+sed -i '57 a\' apache-tomcat-9.0.83/conf/tomcat-users.xml
+sed -i '58 a\' apache-tomcat-9.0.83/conf/tomcat-users.xml
+sed -i '59 a\' apache-tomcat-9.0.83/conf/tomcat-users.xml
+sed -i '56d' apache-tomcat-9.0.83/conf/tomcat-users.xml
+sed -i '21d' apache-tomcat-9.0.83/webapps/manager/META-INF/context.xml
+sed -i '22d' apache-tomcat-9.0.83/webapps/manager/META-INF/context.xml
sh apache-tomcat-9.0.83/bin/startup.sh
+#
+
+NOTE:
+copy code from # to # and run the script i.e, sh tomcat.sh
CONNECTION:
COPY PUBLIC IP:8080
@@ -394,9 +342,9 @@ pipeline {
steps {
deploy adapters: [
tomcat9(
- credentialsId: '056c3140-9f77-44c0-8b85-1f1435b918ea',
+ credentialsId: 'give cred id that you create',
path: '',
- url: 'http://3.84.101.170:8080/'
+ url: 'http://3.84.101.170:8080/'#(give tomcat url)
)
],
contextPath: 'netflix',
From 9493ecc664400088cb926e85bc51e2ef00e8a8fd Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Thu, 14 Dec 2023 15:24:57 +0530
Subject: [PATCH 02/30] Update day-04
---
day-04 | 3 +++
1 file changed, 3 insertions(+)
diff --git a/day-04 b/day-04
index 8b1c4c9..a45e859 100644
--- a/day-04
+++ b/day-04
@@ -298,6 +298,9 @@ sh apache-tomcat-9.0.83/bin/startup.sh
NOTE:
copy code from # to # and run the script i.e, sh tomcat.sh
+TO SHUTDOWN THE TOMCAT SERVER:
+sh apache-tomcat-9.0.83/bin/shutdown.sh
+
CONNECTION:
COPY PUBLIC IP:8080
manager apps -- > username: tomcat & password: raham123
From 8f9369da7f300c92874c1568c5f71a3d666a2609 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Fri, 15 Dec 2023 12:25:20 +0530
Subject: [PATCH 03/30] Create nexus-pipeline
---
nexus-pipeline | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
create mode 100644 nexus-pipeline
diff --git a/nexus-pipeline b/nexus-pipeline
new file mode 100644
index 0000000..dc33a88
--- /dev/null
+++ b/nexus-pipeline
@@ -0,0 +1,44 @@
+pipeline {
+ agent any
+
+ stages {
+ stage('checkout') {
+ steps {
+ git 'https://github.com/summu97/jenkins-java-project.git'
+ }
+ }
+ stage('build') {
+ steps {
+ sh 'mvn compile'
+ }
+ }
+ stage('test') {
+ steps {
+ sh 'mvn test'
+ }
+ }
+ stage('Artifact') {
+ steps {
+ sh 'mvn clean package'
+ }
+ }
+ stage('nexus'){
+ steps{
+ nexusArtifactUploader artifacts: [[artifactId: 'myweb', classifier: '', file: 'target/myweb-1.2.3.war', type: '.war']], credentialsId: '4296f906-995a-493e-b590-a9feeb7d8ebd', groupId: 'in.javahome', nexusUrl: '47.128.253.7:8081', nexusVersion: 'nexus3', protocol: 'http', repository: 'qwer', version: '1.2.2'
+ }
+ }
+ stage('Deployment') {
+ steps {
+ deploy adapters: [
+ tomcat9(
+ credentialsId: 'a73d7166-7ab5-4b64-bb5a-db27783eb31e',
+ path: '',
+ url: 'http://54.254.193.223:8080/'
+ )
+ ],
+ contextPath: 'netflix',
+ war: 'target/*.war'
+ }
+ }
+ }
+}
From 0656c91d5a1b99d57bd58e06300c1f2558c6c0ae Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Tue, 19 Dec 2023 17:31:37 +0530
Subject: [PATCH 04/30] Rename day-6 to day-06
---
day-6 => day-06 | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename day-6 => day-06 (100%)
diff --git a/day-6 b/day-06
similarity index 100%
rename from day-6
rename to day-06
From e8fab479da7b2b5a7931de0e53889ee375cc19b0 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Thu, 21 Dec 2023 13:00:41 +0530
Subject: [PATCH 05/30] Create project-ansible-jenkins
---
project-ansible-jenkins | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 project-ansible-jenkins
diff --git a/project-ansible-jenkins b/project-ansible-jenkins
new file mode 100644
index 0000000..77e03c9
--- /dev/null
+++ b/project-ansible-jenkins
@@ -0,0 +1,36 @@
+pipeline {
+ agent any
+
+ stages {
+ stage('checkout') {
+ steps {
+ git 'https://github.com/summu97/jenkins-java-project.git'
+ }
+ }
+ stage ('build'){
+ steps {
+ sh 'mvn compile'
+ }
+ }
+ stage ('test') {
+ steps {
+ sh 'mvn test'
+ }
+ }
+ stage ('artifact') {
+ steps {
+ sh 'mvn clean package'
+ }
+ }
+ stage ('nexus') {
+ steps {
+ nexusArtifactUploader artifacts: [[artifactId: 'myweb', classifier: '', file: 'target/myweb-1.2.3.war', type: '.war']], credentialsId: '20d3d740-8e7c-4994-95ed-57261696f691', groupId: 'in.javahome', nexusUrl: '18.142.50.68:8081', nexusVersion: 'nexus3', protocol: 'http', repository: 'abcde', version: '1.2.3'
+ }
+ }
+ stage ('deploy') {
+ steps {
+ ansiblePlaybook credentialsId: '304feef9-30d1-4777-bc05-623f8b3fce66', disableHostKeyChecking: true, installation: 'ansible', inventory: '/etc/ansible/hosts', playbook: '/etc/ansible/playbook.yml', vaultTmpPath: ''
+ }
+ }
+ }
+}
From d6ef5c038b50b28e3e05550d0d599e8dd5e3d310 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Sat, 23 Dec 2023 10:26:55 +0530
Subject: [PATCH 06/30] Update day-08
---
day-08 | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/day-08 b/day-08
index d8ff568..e390bb5 100644
--- a/day-08
+++ b/day-08
@@ -104,3 +104,13 @@ dev-2: mysql -- > ms
test-1: python -- > py
test-2: NumPy and Pandas -- > n & p
+- hosts: all
+ tasks:
+ - name: installing apache
+ yum: name=httpd state=present
+ - name: installing mysql
+ yum: name=mysql state=present
+ - name: installing python
+ yum: name=python3 state=present
+
+
From 1f036712c4f895179aaa516e42722b2cdfcec845 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Wed, 27 Dec 2023 21:27:26 +0530
Subject: [PATCH 07/30] Create LAMP-stack
---
LAMP-stack | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
create mode 100644 LAMP-stack
diff --git a/LAMP-stack b/LAMP-stack
new file mode 100644
index 0000000..d0dddb5
--- /dev/null
+++ b/LAMP-stack
@@ -0,0 +1,47 @@
+The LAMP stack is a popular open-source software stack used for web development.
+Linux
+Apache
+MySQL
+PHP
+-> PHP is a server-side scripting language used for developing dynamic web pages
+
+1. Install Apache:
+sudo apt update
+sudo apt install apache2
+sudo systemctl start apache2
+sudo systemctl enable apache2 (this is similar to chkconfig)
+
+2. Install MySQL:
+sudo apt install mysql-server
+sudo systemctl start mysql
+sudo systemctl enable mysql
+
+3. Install PHP:
+sudo apt install php libapache2-mod-php php-mysql
+sudo systemctl restart apache2
+
+Test Your LAMP Stack:
+echo "" | sudo tee /var/www/html/info.php
+
+Additional Considerations:
+Ensure that your firewall allows traffic on the necessary ports (80 for HTTP, 443 for HTTPS).
+Secure your MySQL installation by running the MySQL secure installation script: sudo mysql_secure_installation.
+
+
+for amazon linux:
+sudo yum update
+sudo yum install httpd
+sudo service httpd start
+sudo chkconfig httpd on
+
+sudo yum install mysql-server
+sudo service mysqld start
+sudo chkconfig mysqld on
+
+sudo mysql_secure_installation
+This script will prompt you to set a root password, remove anonymous users, and more.
+
+sudo yum install php php-mysql
+sudo service httpd restart
+
+echo "" | sudo tee /var/www/html/info.php
From 40458bde927fa7a61efea57daecd49c33bbfe945 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Thu, 28 Dec 2023 20:03:17 +0530
Subject: [PATCH 08/30] Update LAMP-stack
---
LAMP-stack | 1 +
1 file changed, 1 insertion(+)
diff --git a/LAMP-stack b/LAMP-stack
index d0dddb5..3e2edd2 100644
--- a/LAMP-stack
+++ b/LAMP-stack
@@ -4,6 +4,7 @@ Apache
MySQL
PHP
-> PHP is a server-side scripting language used for developing dynamic web pages
+"stack" refers to a set of software that is commonly used together to enable the hosting of dynamic websites and web applications.
1. Install Apache:
sudo apt update
From cf6fd9dc3b1938bf4e3cd35ccad81ad470ebee3e Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Thu, 28 Dec 2023 20:04:14 +0530
Subject: [PATCH 09/30] Update LAMP-stack
---
LAMP-stack | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/LAMP-stack b/LAMP-stack
index 3e2edd2..d0fe756 100644
--- a/LAMP-stack
+++ b/LAMP-stack
@@ -2,7 +2,7 @@ The LAMP stack is a popular open-source software stack used for web development.
Linux
Apache
MySQL
-PHP
+PHP/Python/Perl
-> PHP is a server-side scripting language used for developing dynamic web pages
"stack" refers to a set of software that is commonly used together to enable the hosting of dynamic websites and web applications.
From 527542a955c21f9e94cb27aab3994b75afa9982f Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Thu, 28 Dec 2023 20:05:51 +0530
Subject: [PATCH 10/30] Update LAMP-stack
---
LAMP-stack | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/LAMP-stack b/LAMP-stack
index d0fe756..7b7168f 100644
--- a/LAMP-stack
+++ b/LAMP-stack
@@ -1,7 +1,11 @@
The LAMP stack is a popular open-source software stack used for web development.
Linux
+
Apache
+
MySQL
+MySQL: This is the relational database management system (RDBMS) used to store and manage the website's data.
+
PHP/Python/Perl
-> PHP is a server-side scripting language used for developing dynamic web pages
"stack" refers to a set of software that is commonly used together to enable the hosting of dynamic websites and web applications.
From 9683abe2bf53dff28c75ef54890c3e9d0989519c Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Thu, 28 Dec 2023 20:11:08 +0530
Subject: [PATCH 11/30] Update LAMP-stack
---
LAMP-stack | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/LAMP-stack b/LAMP-stack
index 7b7168f..b67f0ab 100644
--- a/LAMP-stack
+++ b/LAMP-stack
@@ -7,7 +7,10 @@ MySQL
MySQL: This is the relational database management system (RDBMS) used to store and manage the website's data.
PHP/Python/Perl
--> PHP is a server-side scripting language used for developing dynamic web pages
+-> PHP is a server-side scripting language used for developing dynamic web pages.
+
+WEB:"web" typically refers to the World Wide Web, which is a global information space accessible via the internet.
+
"stack" refers to a set of software that is commonly used together to enable the hosting of dynamic websites and web applications.
1. Install Apache:
From 05ebd039d2cfda36a4232b58565170c25a1486f2 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Thu, 28 Dec 2023 20:30:00 +0530
Subject: [PATCH 12/30] Update day-14
---
day-14 | 1 +
1 file changed, 1 insertion(+)
diff --git a/day-14 b/day-14
index 819edab..308cfbb 100644
--- a/day-14
+++ b/day-14
@@ -99,6 +99,7 @@ NOTE: When you download a command as binary file it need to be on /usr/local/bin
because all the commands in linux will be on /usr/local/bin
and need to give executable permission for that binary file to work as a command.
+A binary file is a computer file that contains data in a format that is not intended for humans to read.
POD:
From 975223130e09c97807aeb85ba7a8bb0fb89cfdab Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Tue, 2 Jan 2024 11:39:53 +0530
Subject: [PATCH 13/30] Create metric-server.sh
---
metric-server.sh | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 metric-server.sh
diff --git a/metric-server.sh b/metric-server.sh
new file mode 100644
index 0000000..41b8188
--- /dev/null
+++ b/metric-server.sh
@@ -0,0 +1,12 @@
+kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
+
+
+FOR MINIKUBE:
+minikube addons enable metrics-server #(only for minikube)
+
+FOR KOPS:
+https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/high-availability-1.21+.yaml
+
+kubectl top nodes
+kubectl top pods
+kubectl get po --watch
From 5c23c7ac0e54d0f776cc6eb02c6fcbc3a93cfa2d Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Tue, 2 Jan 2024 12:34:00 +0530
Subject: [PATCH 14/30] Update day-17
---
day-17 | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/day-17 b/day-17
index e298865..878a51a 100644
--- a/day-17
+++ b/day-17
@@ -211,7 +211,7 @@ kubectl get al1
now opne second terminal
kubectl get po
-kubectl exec mydeploy-6bd88977d5-7s6t8 -it -- /bin/bash
+kubectl exec pod_name_id -it -- /bin/bash (this will not take you inside )
go to terminal one
kubectl get all : it will observer for every 2 seconds
@@ -298,3 +298,23 @@ these 5 minutes is called as cooldown period
66 kubectl get po
67 history
+ 75 kubectl autoscale deploy swiggy-deploy --cpu-percent=20 --min=1 --max=10
+ 76 yum install stress -y
+ 77 amazon-linux-extras install epel -y
+ 78 yum install stress -y
+ 79 kubectl get po
+ 80 kubectl autoscale deploy swiggy-deploy --cpu-percent=20 --min=5 --max=10
+ 81 kubectl get po
+ 82 kubectl delete -f abc.yml
+ 83 kubectl create -f abc.yml
+ 84 kubectl get svc
+ 85 kubectl get deploy
+ 86 kubectl autoscale deploy swiggy-deploy --cpu-percent=20 --min=5 --max=10
+ 87 kubectl get autoscale
+ 88 kubectl edit deploy swiggy-deploy
+ 89 kubectl get po
+ 90 kubectl exec -it swiggy-deploy-74bf8bf7f7-9789s -- /bin/bash
+ 91 kubectl get po
+ 92 history
+
+
From e0a8781d8ce5b75e505915000e32e1da3480c1bb Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Tue, 2 Jan 2024 12:39:26 +0530
Subject: [PATCH 15/30] Update day-17
---
day-17 | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/day-17 b/day-17
index 878a51a..7ec7ad2 100644
--- a/day-17
+++ b/day-17
@@ -313,8 +313,18 @@ these 5 minutes is called as cooldown period
87 kubectl get autoscale
88 kubectl edit deploy swiggy-deploy
89 kubectl get po
- 90 kubectl exec -it swiggy-deploy-74bf8bf7f7-9789s -- /bin/bash
+ 90 kubectl exec -it swiggy-deploy-74bf8bf7f7-9789s -- /bin/bash *********
91 kubectl get po
92 history
+ 1 yum install stress -y**********
+ 2 stress*********
+ 3 uname -a
+ 4 cat /etc/os-release
+ 5 apt install stress -y
+ 6 stress
+ 7 stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 30s**********
+ 8 stress
+ 9 stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 30s
+ 10 history
From df47e6aead2a75b980bfbe01ed15b7ead9438ee7 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Tue, 2 Jan 2024 15:08:11 +0530
Subject: [PATCH 16/30] Update metric-server.sh
---
metric-server.sh | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/metric-server.sh b/metric-server.sh
index 41b8188..e3fa567 100644
--- a/metric-server.sh
+++ b/metric-server.sh
@@ -1,10 +1,9 @@
-kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
-
-
FOR MINIKUBE:
+kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
minikube addons enable metrics-server #(only for minikube)
FOR KOPS:
+kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/high-availability-1.21+.yaml
kubectl top nodes
From a4bc10cb56b9e63864ec77013f96796939df1a5d Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Tue, 2 Jan 2024 15:54:16 +0530
Subject: [PATCH 17/30] Update and rename metric-server.sh to metric-server.sh
, HPA
---
metric-server.sh | 11 -----------
metric-server.sh , HPA | 32 ++++++++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 11 deletions(-)
delete mode 100644 metric-server.sh
create mode 100644 metric-server.sh , HPA
diff --git a/metric-server.sh b/metric-server.sh
deleted file mode 100644
index e3fa567..0000000
--- a/metric-server.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-FOR MINIKUBE:
-kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
-minikube addons enable metrics-server #(only for minikube)
-
-FOR KOPS:
-kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
-https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/high-availability-1.21+.yaml
-
-kubectl top nodes
-kubectl top pods
-kubectl get po --watch
diff --git a/metric-server.sh , HPA b/metric-server.sh , HPA
new file mode 100644
index 0000000..fa68509
--- /dev/null
+++ b/metric-server.sh , HPA
@@ -0,0 +1,32 @@
+FOR MINIKUBE:
+kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
+minikube addons enable metrics-server #(only for minikube)
+
+FOR KOPS:
+kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
+https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/high-availability-1.21+.yaml
+
+kubectl top nodes
+kubectl top pods
+kubectl get po --watch (THIS WILL MONITOR ALL POD ACTIVITIES)
+
+
+
+HORIZONTAL POD AUTOSCALLING: HPA
+
+TO SET MIN AND MAX POD LEVELS:
+
+kubectl autoscale deploy deployment_name --cpu-percent=20 --min=5 --max=10
+
+STRESS ON PODS:
+
+ kubectl exec -it pod_name -- /bin/bash (this will execute command by going inside of pod)
+
+ if image OS is UBUNTU
+ for stress: apt install stress -y
+ run the last command to increase stress on pod
+ cmnd: stress
+
+ if image OS is linux
+ cmnd: amazon-linux-extras install epel -y
+ cmnd: yum install stress -y
From c97658ff69933cb1d496e88300600b5756275775 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Tue, 2 Jan 2024 16:41:04 +0530
Subject: [PATCH 18/30] Update day-17
---
day-17 | 101 ---------------------------------------------------------
1 file changed, 101 deletions(-)
diff --git a/day-17 b/day-17
index 7ec7ad2..2f9371e 100644
--- a/day-17
+++ b/day-17
@@ -227,104 +227,3 @@ now if the load gets down then after 5 minutes all the pods will go
these 5 minutes is called as cooldown period
-
- history:
- oot@ip-172-31-47-225 ~]# history
- 1 vim kops.sh
- 2 vim .bashrc
- 3 sh kops.sh
- 4 source .bashrc
- 5 sh kops.sh
- 6 kops validate cluster --wait 10m
- 7 cat kops.sh
- 8 kops validate cluster --wait 10m
- 9 export KOPS_STATE_STORE=s3://cloudanddevopsbyraham8899007.k8s.local
- 10 kops validate cluster --wait 10m
- 11 kubectl get svc
- 12 vim abc.yml
- 13 kubectl create -f abc.yml
- 14 kubectl get svc,deploy
- 15 kubectl delete -f abc.yml
- 16 vim abc.yml
- 17 kubectl create -f abc.yml
- 18 kubectl get svc,deploy
- 19 kubectl get po -o wide
- 20 kubectl delete -f abc.yml
- 21 vim abc.yml
- 22 kubectl create -f abc.yml
- 23 kubectl get svc,deploy
- 24 vim abc.yml
- 25 kubectl apply -f abc.yml
- 26 kubectl get svc,deploy
- 27 kubectl delete -f abc.yml
- 28 vim abc.yml
- 29 kubectl create -f abc.yml
- 30 kubectl get svc,deploy
- 31 kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
- 32 minikube addons enable metrics-server #(only for minikube)
- 33 kubectl top nodes
- 34 kubectl top pods
- 35 kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
- 36 kubectl top po
- 37 kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/high-availability-1.21+.yaml
- 38*
- 39 kubectl top po
- 40 kubectl top NO
- 41 kubectl top no
- 42 vim abc.yml
- 43 cat abc.yml
- 44 kubectl create -f abc.yml
- 45 vim abc.yml
- 46 kubectl create -f abc.yml
- 47 vim abc.yml
- 48 kubectl create -f abc.yml
- 49 vim abc.yml
- 50 cat abc.yml
- 51 vim abc.yml
- 52 kubectl create -f abc.yml
- 53 cat r
- 54 cat abc.yml
- 55 vim abc.yml
- 56 kubectl create -f abc.yml
- 57 vim abc.yml
- 58 kubectl create -f abc.yml
- 59 kubectl get po
- 60 kubectl get deploy
- 61 kubectl delete deploy swiggy-deploy
- 62 kubectl get deploy
- 63 kubectl autoscale deployment mydeploy --cpu-percent=20 --min=1 --max=10
- 64 kubectl get po
- 65 kubectl exec -it mydeploy-c5d4f9cbb-flsgk -- /bin/bash
- 66 kubectl get po
- 67 history
-
- 75 kubectl autoscale deploy swiggy-deploy --cpu-percent=20 --min=1 --max=10
- 76 yum install stress -y
- 77 amazon-linux-extras install epel -y
- 78 yum install stress -y
- 79 kubectl get po
- 80 kubectl autoscale deploy swiggy-deploy --cpu-percent=20 --min=5 --max=10
- 81 kubectl get po
- 82 kubectl delete -f abc.yml
- 83 kubectl create -f abc.yml
- 84 kubectl get svc
- 85 kubectl get deploy
- 86 kubectl autoscale deploy swiggy-deploy --cpu-percent=20 --min=5 --max=10
- 87 kubectl get autoscale
- 88 kubectl edit deploy swiggy-deploy
- 89 kubectl get po
- 90 kubectl exec -it swiggy-deploy-74bf8bf7f7-9789s -- /bin/bash *********
- 91 kubectl get po
- 92 history
-
- 1 yum install stress -y**********
- 2 stress*********
- 3 uname -a
- 4 cat /etc/os-release
- 5 apt install stress -y
- 6 stress
- 7 stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 30s**********
- 8 stress
- 9 stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 30s
- 10 history
-
From 2b3012db96d174db0382a4c5705e2380a8274ae6 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Wed, 3 Jan 2024 11:50:00 +0530
Subject: [PATCH 19/30] Create configmaps and secrets
---
configmaps and secrets | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 configmaps and secrets
diff --git a/configmaps and secrets b/configmaps and secrets
new file mode 100644
index 0000000..0244250
--- /dev/null
+++ b/configmaps and secrets
@@ -0,0 +1,28 @@
+to pass env variables using ENV
+
+kubectl create deploy deployname --image=mariadb
+kubectl set env deploy deployname MYSQL_ROOT_PASSWORD=sumo97
+cmnd: kubectl get po
+cmnd: kubectl delete deploy deployname
+
+to pass env variables using ENVFROM-file
+
+ vim abc
+MYSQL_ROOT_PASSWORD=sumo97
+MYSQL_USER=admin
+
+kubectl create cm cmname --from-env-file=abc
+kubectl get cm
+kubectl describe cm cmname
+kubectl create deploy deployname --image=mariadb
+kubectl get po
+kubectl set env deploy deployname --from=configmap/cmname
+kubectl get po
+kubectl delete deploy deployname
+
+SECRETS:
+kubectl create deploy deployname --image=mariadb
+kubectl get po
+kubectl create secret generic pswdname --from-literal=ROOT_PASSWORD=sumo97
+kubectl get secrets
+kubectl describe secrets
From 137a786cf6b783821fe3e145b04fff3c93bcd0df Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Sat, 20 Jan 2024 11:16:49 +0530
Subject: [PATCH 20/30] Rename day-01 to 01 - git
---
day-01 => 01 - git | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename day-01 => 01 - git (100%)
diff --git a/day-01 b/01 - git
similarity index 100%
rename from day-01
rename to 01 - git
From f8a816862769dc0c6ddbdcb72ea3f88d91b0ed90 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Sat, 20 Jan 2024 11:17:39 +0530
Subject: [PATCH 21/30] Rename day-10 to 10 - docker
---
day-10 => 10 - docker | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename day-10 => 10 - docker (100%)
diff --git a/day-10 b/10 - docker
similarity index 100%
rename from day-10
rename to 10 - docker
From 3b633386ff70b20d0f6f6c50b9f83df65e038886 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Sat, 20 Jan 2024 11:18:08 +0530
Subject: [PATCH 22/30] Rename day-11 to 11 - docker
---
day-11 => 11 - docker | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename day-11 => 11 - docker (100%)
diff --git a/day-11 b/11 - docker
similarity index 100%
rename from day-11
rename to 11 - docker
From eae9bee4041062d3cbce3765513438002e508103 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Sat, 20 Jan 2024 11:18:47 +0530
Subject: [PATCH 23/30] Rename day-12 to 12 - docker
---
day-12 => 12 - docker | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename day-12 => 12 - docker (100%)
diff --git a/day-12 b/12 - docker
similarity index 100%
rename from day-12
rename to 12 - docker
From d95c64dcdc11123bd875272d94a9dfe31fdf2767 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Sat, 20 Jan 2024 11:19:19 +0530
Subject: [PATCH 24/30] Rename day-13 to 13 - docker
---
day-13 => 13 - docker | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename day-13 => 13 - docker (100%)
diff --git a/day-13 b/13 - docker
similarity index 100%
rename from day-13
rename to 13 - docker
From eef5dd38198293fd1c8cb807f61b482e485c8837 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Sat, 20 Jan 2024 15:13:20 +0530
Subject: [PATCH 25/30] Rename day-20 to 20 - tfm
---
day-20 => 20 - tfm | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename day-20 => 20 - tfm (100%)
diff --git a/day-20 b/20 - tfm
similarity index 100%
rename from day-20
rename to 20 - tfm
From 110dae84a6a74b794468b5391fd1dc7f345d2812 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Sun, 21 Jan 2024 07:44:35 +0530
Subject: [PATCH 26/30] Rename day-06 to 06 - ansible
---
day-06 => 06 - ansible | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename day-06 => 06 - ansible (100%)
diff --git a/day-06 b/06 - ansible
similarity index 100%
rename from day-06
rename to 06 - ansible
From b3a2d67324e76598d752a83fa7e51cabc93b7705 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Sun, 21 Jan 2024 07:57:13 +0530
Subject: [PATCH 27/30] Update 06 - ansible
---
06 - ansible | 1 +
1 file changed, 1 insertion(+)
diff --git a/06 - ansible b/06 - ansible
index 980c7a8..8710217 100644
--- a/06 - ansible
+++ b/06 - ansible
@@ -222,3 +222,4 @@ TO EXECUTE: ansible-playbook playbbok.yml
- docker*
- java-1.8.0-openjdk*
- tree*
+ansible-playbook playbook.yml --syntax (this will show any errors in playbook)
From 0405791786b2e187950009604d3a8fe47fd2c3ac Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Sun, 21 Jan 2024 08:02:11 +0530
Subject: [PATCH 28/30] Rename day-07 to 07 - ansible
---
day-07 => 07 - ansible | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename day-07 => 07 - ansible (100%)
diff --git a/day-07 b/07 - ansible
similarity index 100%
rename from day-07
rename to 07 - ansible
From aae49be81aa149ee94cbbd43cd9a4c4475ead9aa Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Sun, 21 Jan 2024 08:10:59 +0530
Subject: [PATCH 29/30] Rename day-08 to 08 - ansible
---
day-08 => 08 - ansible | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename day-08 => 08 - ansible (100%)
diff --git a/day-08 b/08 - ansible
similarity index 100%
rename from day-08
rename to 08 - ansible
From 114e4edd90c88bc406e9c96ef343b3f72c56fdf5 Mon Sep 17 00:00:00 2001
From: summu97 <135579543+summu97@users.noreply.github.com>
Date: Sun, 21 Jan 2024 08:18:54 +0530
Subject: [PATCH 30/30] Rename day-09 to 09 - ansible
---
day-09 => 09 - ansible | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename day-09 => 09 - ansible (100%)
diff --git a/day-09 b/09 - ansible
similarity index 100%
rename from day-09
rename to 09 - ansible