From c689c9b474d6587b2c01551f5bc2b3d2e3eb2d9f Mon Sep 17 00:00:00 2001 From: marcel-dempers Date: Fri, 6 Dec 2024 18:44:40 +1100 Subject: [PATCH] course updates on chapter 2 --- .../virtualization/README.md | 60 +++++++++++++++++-- course/course-diagram.svg | 4 +- 2 files changed, 56 insertions(+), 8 deletions(-) diff --git a/course/content/operating-systems/virtualization/README.md b/course/content/operating-systems/virtualization/README.md index 1138446..e89e700 100644 --- a/course/content/operating-systems/virtualization/README.md +++ b/course/content/operating-systems/virtualization/README.md @@ -57,8 +57,6 @@ There are a number of benefits why Virtual machines are great.
* Automation: Using automation software or tools can help recreate servers and roll out updates * Scalability: Ability to quickly add more servers when demands increase - - ## Virtualisation software There are many types of virtualization software that allows us to create Virtual machines
@@ -139,13 +137,17 @@ In this course we will get Ubuntu Linux from [ubuntu.com](https://ubuntu.com/) < ### Setup Network -One very important component of environments both for in data centers and in the cloud is the network. Servers communicate with one another over the network.
-Networks can be either public (like sitting on the internet) or private or a combination of public and private
+One very important component of environments both for in data centers and in the cloud is the network.
+Servers communicate with one another over the network.
+Networks can be either public (like sitting on the internet) or private or a combination of public and private
* Host-only Networks + `This can be used to create a network containing the host and a set of virtual machines, without the need for the host's physical network interface` * NAT Networks `Network Address Translation (NAT) is the simplest way of accessing an external network from a virtual machine. Usually, it does not require any configuration on the host network and guest system. For this reason, it is the default networking mode in Oracle VM VirtualBox.` * Cloud Networks +`This can be used to connect a local VM to a subnet on a remote cloud service.` +In order for a server to communicate with another server it needs to belong to a network, and in order to belong to a network, a server needs an IP address
An IP is a series of numbers and dots that identify a device that is part of a network.
Networks have an IP range.
@@ -173,6 +175,22 @@ When a device connects to a network its assigned an IP address by [DHCP](https:/ `Port Forwarding` allows us to forward certain ports from our machine to this virtual machine network. This is because the NAT Network is isolated so we need to setup any connections between us and the virtual machine
+Now to create the network, we can briefly walk through the VirtualBox UI and look at the default NAT Network that is created.
+In this walk through, I'd like you to get a bit more of an understanding of networks, so I would prefer if we create our own and not rely on the default one
The default network could be subject to change which may cause it to break in the future.
+To create a network and setup a DHCP for it, we will use the `VBoxManage` command line.
+ +On Linux, if you have VirtualBox installed you can simply type VBoxManage in a terminal window and you should see its output.
+ +Let's create our NAT Network and a DHCP for it using the following commands: + +For Windows, you will need to add the following directory to your PATH environemnt variable: `C:\Program Files\Oracle\VirtualBox` +Once done, open a new PowerShell terminal +``` +VBoxManage natnetwork add --netname "my-website" --network "10.0.0.0/27" --enable --ipv6 off +VBoxManage dhcpserver add --netname "my-website" --ip "10.0.0.1" --netmask "255.255.255.224" --lowerip "10.0.0.4" --upperip "10.0.0.30" --enable +VBoxManage natnetwork modify --netname "my-website" --dhcp on +``` + ### Creating Virtual Machine On the main panel, we can click on `Machine` and `New` to get to the server creation page.
@@ -192,21 +210,51 @@ Next we create a hard disk, by filling out `Hard Disk File Location and Size` Then we press `Finish` to create the virtual server
+Now before starting the virtual server, we need to add it to our network we created.
We can do this from the settings page
+ ## Setup Server Access Now Virtual Box allows us to access our server by giving us a screen interface.
Now if we wanted to automate things later and remotly manage this server, we need to setup [SSH](https://en.wikipedia.org/wiki/Secure_Shell) access -Get the local IP to setup port forwarding in Virtual Box +Get the local IP to setup port forwarding in Virtual Box. +For this demo, we can set a non-standard port just incase you already have port `22` used on your system.
+Therefore the host port we will set it to `2222` and the Guest port (which is the virtual server) will set it as `22` ``` # grab the IP address from the `inet` section ip addr ``` +The IP address of the virtual server will be the "Guest IP" in the port forward rule.
+This means all traffic on our system from port `2222` will not be forwarded to port `22` of our virtual server. + +On our Virtual server, we will need to install SSH server.
-Install SSH server: ``` sudo apt-get update sudo apt-get install -y openssh-server ``` +Ensure that the SSH server is up and running + +``` +sudo service ssh status +sudo service ssh start +sudo service ssh status +``` + +We can now see the SSH service is running, but is disabled. So when our VM reboots it will not automatically start up. To make the SSH service start up automatically, we need to enable it. Let's do that + +``` +# enable SSH +sudo systemctl enable ssh + +# now we can see its enabled: +sudo service ssh status +``` + +Now on our system, we can open up Visual Studio code terminal and SSH to our Virtual server: + +``` +ssh -p 2222 @127.0.0.1 +``` diff --git a/course/course-diagram.svg b/course/course-diagram.svg index a97d583..98aedd4 100644 --- a/course/course-diagram.svg +++ b/course/course-diagram.svg @@ -1,2 +1,2 @@ -


- module: intro to GIT
- module: intro to IDEs and VSCode
- module: intro to GIT...
START HERE
START HERE
Course Introduction
Course Introduction

Chapter-1

Source controlΒ & GIT

Chapter-1...
Intro to GIT
Source Control
Intro to GIT...
1
1
Intro to Github
HostedSource Control
Intro to Github...
3
3
Intro to IDEs
VSCode
Intro to IDEs...
2
2


- module: intro to OS
- module: intro to servers & VMs
- module: intro to linux & command line
- module: intro to OS...

Chapter-2

Operating Systems

Chapter-2...
Intro toΒ 
Operating Systems for DevOps
Intro to...
Intro toΒ 
Servers &
Virtualisation
Intro to...
Intro toΒ 
Linux
Intro to...
Intro toΒ 
Command Line
Intro to...
Bash Scripting
for Beginners
Bash Scripting...


- module: intro to linux monitoring
- module: monitoring dashboards
- module: intro to linux monitoring...

Chapter-3

Monitoring

Chapter-3...
Intro toΒ 
Linux Monitoring
Intro to...
Introduction toΒ 
Grafana
Introduction to...
Introduction toΒ 
Prometheus
Introduction to...
-Β HTTP and status codes
- DNSΒ 
- SSL
Β  Β  - TCP \ UDP , portsΒ 
Β  Β  - Testing network accessΒ 
Β  Β  - Testing port is open
- Scripting (bash)Β Β \ automation
-Β HTTP and status codes...

Chapter-4

Web Servers

Chapter-4...
Intro to Web Servers
Intro to Web Ser...
Creating Web Servers with NGINX
Creating Web Ser...
The Basics of HTML and Web
The Basics of HT...
Create your own personal website
Create your own...
Get free SSL certificates
Get free SSL cer...
- Web Server Logs
- Web Server Metrics
- Web Server Logs...

Chapter-4.1

Web Server

Monitoring

Chapter-4.1...
Monitoring Logs
with Grafana Loki
Monitoring Logs...
Monitoring Logs
with fluentd
Monitoring Logs...
- What are CI/CD
- What is a pipeline
- Automation
- Deployments
- What are CI/CD...

Chapter-5

CI / CD Pipelines

Chapter-5...
Setup a basic CI/CD pipeline
Setup a basic C...
What is CI/CD
What is CI/CD
Automate Website Deployments
Automate Websi...
-Β what are containers and why they exist
- challenges with our web server
- how docker solves it,
- create docker fileΒ 
- run container scriptΒ 
-Β what are containers and why they exist...

Chapter-6

Docker & Containers

Chapter-6...
Intro to Docker
Intro to Doc...
Migrate our Website to Docker
Migrate our We...
-Β benefits of compose
- no script needed
- can easily start and build container with short command
-Β  can run many containers
- less scripts
-Β benefits of compose...

Chapter-7

Docker Compose

Chapter-7...
Intro to Docker Compose
Intro to Docker...
Creating a Compose file
Creating a C...
- what is infrastructure as code ?
- IaC Tools
- Terraform
- Cloud Init
- Automation
- what is infrastructure as code ?...

Chapter-8

Infrastructure as Code

Chapter-8...
- What is the cloud
- Virtual Machines in the Cloud
- Examples
- Migrate our servers to Cloud
- What is the cloud...

Chapter-9

Introduction to Cloud

Chapter-9...
Intro to IaC
Intro to IaC
Intro to Cloud Init
Intro to Cloud...
Intro to Terraform
Intro to Terr...
🚧 under construction
🚧 under construction
✍🏽 pre-production
✍🏽 pre-production
%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22%F0%9F%8E%AC%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3BfontSize%3D28%3BfontColor%3D%2300FFFF%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22-1960%22%20y%3D%22295%22%20width%3D%2260%22%20height%3D%2250%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3EΒ 
πŸš€Β ready
%3CmxGraphMo...
πŸš€
πŸš€
πŸš€
πŸš€
🚧
🚧
🚧
🚧
✍🏽
✍🏽
🎦
🎦
🎦
🎦
✍🏽
✍🏽
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
1
1
2
2
3
3
4
4
5
5
🎦
🎦
🎦 production
🎦 production
πŸš€
πŸš€
%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22%F0%9F%8E%AC%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3BfontSize%3D28%3BfontColor%3D%2300FFFF%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22-1960%22%20y%3D%22295%22%20width%3D%2260%22%20height%3D%2250%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3EΒ βœ…Β published
%3CmxGraphModel...
✍🏽
✍🏽
0
0
1
1
2
2
3
3
4
4
4.1
4...
5
5
6
6
7
7
8
8
9
9
πŸš€
πŸš€
Text is not SVG - cannot display
\ No newline at end of file +




Learn about:
* Source Control
* GIT
* Hosted GIT such as Github
* IDE Tools such as Visual Studio Code
* How to manage code & scripts as a DevOps engineer
Learn about:...
START HERE
START HERE
Course Introduction
Course Introduction

Chapter-1

Source controlΒ & GIT

Chapter-1...
Intro to GIT
Source Control
Intro to GIT...
1
1
Intro to Github
HostedSource Control
Intro to Github...
3
3
Intro to IDEs
VSCode
Intro to IDEs...
2
2


- module: intro to OS
- module: intro to servers & VMs
- module: intro to linux & command line
- module: intro to OS...

Chapter-2

Operating Systems

Chapter-2...
Intro toΒ 
Operating Systems for DevOps
Intro to...
Intro toΒ 
Servers &
Virtualisation
Intro to...
Intro toΒ 
Linux
Intro to...
Intro toΒ 
Command Line
Intro to...
Bash Scripting
for Beginners
Bash Scripting...


- module: intro to linux monitoring
- module: monitoring dashboards
- module: intro to linux monitoring...

Chapter-3

Monitoring

Chapter-3...
Intro toΒ 
Linux Monitoring
Intro to...
Introduction toΒ 
Grafana
Introduction to...
Introduction toΒ 
Prometheus
Introduction to...
-Β HTTP and status codes
- DNSΒ 
- SSL
Β  Β  - TCP \ UDP , portsΒ 
Β  Β  - Testing network accessΒ 
Β  Β  - Testing port is open
- Scripting (bash)Β Β \ automation
-Β HTTP and status codes...

Chapter-4

Web Servers

Chapter-4...
Intro to Web Servers
Intro to Web Ser...
Creating Web Servers with NGINX
Creating Web Ser...
The Basics of HTML and Web
The Basics of HT...
Create your own personal website
Create your own...
Get free SSL certificates
Get free SSL cer...
- Web Server Logs
- Web Server Metrics
- Web Server Logs...

Chapter-4.1

Web Server

Monitoring

Chapter-4.1...
Monitoring Logs
with Grafana Loki
Monitoring Logs...
Monitoring Logs
with fluentd
Monitoring Logs...
- What are CI/CD
- What is a pipeline
- Automation
- Deployments
- What are CI/CD...

Chapter-5

CI / CD Pipelines

Chapter-5...
Setup a basic CI/CD pipeline
Setup a basic C...
What is CI/CD
What is CI/CD
Automate Website Deployments
Automate Websi...
-Β what are containers and why they exist
- challenges with our web server
- how docker solves it,
- create docker fileΒ 
- run container scriptΒ 
-Β what are containers and why they exist...

Chapter-6

Docker & Containers

Chapter-6...
Intro to Docker
Intro to Doc...
Migrate our Website to Docker
Migrate our We...
-Β benefits of compose
- no script needed
- can easily start and build container with short command
-Β  can run many containers
- less scripts
-Β benefits of compose...

Chapter-7

Docker Compose

Chapter-7...
Intro to Docker Compose
Intro to Docker...
Creating a Compose file
Creating a C...
- what is infrastructure as code ?
- IaC Tools
- Terraform
- Cloud Init
- Automation
- what is infrastructure as code ?...

Chapter-8

Infrastructure as Code

Chapter-8...
- What is the cloud
- Virtual Machines in the Cloud
- Examples
- Migrate our servers to Cloud
- What is the cloud...

Chapter-9

Introduction to Cloud

Chapter-9...
Intro to IaC
Intro to IaC
Intro to Cloud Init
Intro to Cloud...
Intro to Terraform
Intro to Terr...
🚧 under construction
🚧 under construction
✍🏽 pre-production
✍🏽 pre-production
%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22%F0%9F%8E%AC%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3BfontSize%3D28%3BfontColor%3D%2300FFFF%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22-1960%22%20y%3D%22295%22%20width%3D%2260%22%20height%3D%2250%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3EΒ 
πŸš€Β ready
%3CmxGraphMo...
πŸš€
πŸš€
πŸš€
πŸš€
🚧
🚧
🚧
🚧
✍🏽
✍🏽
🎦
🎦
🎦
🎦
✍🏽
✍🏽
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
🚧
1
1
2
2
3
3
4
4
5
5
🎦
🎦
🎦 production
🎦 production
πŸš€
πŸš€
%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22%F0%9F%8E%AC%22%20style%3D%22text%3Bhtml%3D1%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3BfontSize%3D28%3BfontColor%3D%2300FFFF%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22-1960%22%20y%3D%22295%22%20width%3D%2260%22%20height%3D%2250%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3EΒ βœ…Β published
%3CmxGraphModel...
✍🏽
✍🏽
0
0
1
1
2
2
3
3
4
4
4.1
4...
5
5
6
6
7
7
8
8
9
9
πŸš€
πŸš€
Text is not SVG - cannot display
\ No newline at end of file