« SE4 Virtualisation TP Wasilewski » : différence entre les versions

De wiki-se.plil.fr
Aller à la navigation Aller à la recherche
mAucun résumé des modifications
mAucun résumé des modifications
Ligne 1 : Ligne 1 :
== Déroulé du TP ==
== Déroulé du TP ==


==== Target: discover technologies and use a web server ====
=== Target: discover technologies and use a web server ===
 
===== 1. Create VM =====


==== 1. Create VM ====
# Create a virtual machine on Proxmox (server is accessible through: [https://antifer.plil.info this link]) by cloning the template. The virtual machine must be named {{Inline-code | 1=team-XX}} with XX being your team number assigned at the beginning of the tutorial.
# Create a virtual machine on Proxmox (server is accessible through: [https://antifer.plil.info this link]) by cloning the template. The virtual machine must be named {{Inline-code | 1=team-XX}} with XX being your team number assigned at the beginning of the tutorial.
# Manual configure virtual machine's network to be persistent. Your VM's IP must be {{Inline-code | 1=10.99.XX.1/16}} with the gateway being {{Inline-code | 1=10.99.99.254}}.
# Manual configure virtual machine's network to be persistent. Your VM's IP must be {{Inline-code | 1=10.99.XX.1/16}} with the gateway being {{Inline-code | 1=10.99.99.254}}.
Ligne 12 : Ligne 11 :
# Reboot the VM and validate it.
# Reboot the VM and validate it.


===== 2. First web server =====
==== 2. First web server ====
 
# Install nginx. (Hint: if it fails, do not forget to configure your VM's DNS).
# Install nginx. (Hint: if it fails, do not forget to configure your VM's DNS).
# Setup a custom/cool static page.
# Setup a custom/cool static page.


===== 3. First load balancer =====
==== 3. First load balancer ====
 
# Install HAProxy 2.8 (Hint: Search "debian haproxy" on your favorite search engine)
# Install HAProxy 2.8 (Hint: Search "debian haproxy" on your favorite search engine)
# Redirect port 8888 to the previously installed nginx.
# Redirect port 8888 to the previously installed nginx.


===== 4. Docker time =====
==== 4. Docker time ====
 
# Install docker.
# Install docker.
# Pull nginx image.
# Pull nginx image.
Ligne 29 : Ligne 25 :
# Reconfigure HAProxy to use port 8889 onto the container.
# Reconfigure HAProxy to use port 8889 onto the container.


==== '''Target: discover technologies and use a web server''' ====
=== '''Target: discover technologies and use a web server''' ===
 
===== 5. First Docker image =====


==== 5. First Docker image ====
# Create a Docker image based on {{Inline-code|nginx:latest}} that use your previously created static page. This image will be named {{Inline-code|tXX-web}} and will use semantic versioning.
# Create a Docker image based on {{Inline-code|nginx:latest}} that use your previously created static page. This image will be named {{Inline-code|tXX-web}} and will use semantic versioning.
# Publish this new image on the common registry, located at {{Inline-code|http://10.99.99.254:5000}}. (Hint: you will have to update your Docker daemon configuration to allow this insecure registry).
# Publish this new image on the common registry, located at {{Inline-code|http://10.99.99.254:5000}}. (Hint: you will have to update your Docker daemon configuration to allow this insecure registry).


===== 6. Nomad installation =====
==== 6. Nomad installation ====
 
# Install nomad as a Debian package. See [https://developer.hashicorp.com/nomad/tutorials/get-started/gs-install the official documentation]
# Install nomad as a Debian package. See [https://developer.hashicorp.com/nomad/tutorials/get-started/gs-install the official documentation]
# Have Nomad running as client and server. Validate it through its interface which should be accessible through {{Inline-code|http://10.99.XX.1:4646}}. (Check it with {{Inline-code|curl}})
# Have Nomad running as client and server. Validate it through its interface which should be accessible through {{Inline-code|http://10.99.XX.1:4646}}. (Check it with {{Inline-code|curl}})


===== 7. Access Nomad UI from Zabeth =====
==== 7. Access Nomad UI from Zabeth ====
 
# Add a route on your Zabeth to view Nomad UI from it.
# Add a route on your Zabeth to view Nomad UI from it.


===== 8. First Nomad deployment =====
==== 8. First Nomad deployment ====
 
# Create a nomad job definition with {{Inline-code|nomad job init}} command.
# Create a nomad job definition with {{Inline-code|nomad job init}} command.
# Adapt it to deploy the container you created on step 5.
# Adapt it to deploy the container you created on step 5.


===== 9. Scale and load-balance =====
==== 9. Scale and load-balance ====
 
# Increase job definition count to run 3 container.
# Increase job definition count to run 3 container.
# Configure HAProxy to redirect port 8890 to those containers through service discovery.
# Configure HAProxy to redirect port 8890 to those containers through service discovery.


===== '''Target: setup a distributed service + deploy from CI''' =====
=== '''Target: setup a distributed service + deploy from CI''' ===
10. Reconfigure nomad to use the common consul and common nomad server
10. Reconfigure nomad to use the common consul and common nomad server


Ligne 64 : Ligne 55 :
13. Update global haproxy configuration to redirect to the the newly deployed web service
13. Update global haproxy configuration to redirect to the the newly deployed web service


 
=== '''Target: build and deploy more complex services''' ===
'''Target: build and deploy more complex services'''
 
14. Create new repo as the web repo to build and push a dockerized DHCP server
14. Create new repo as the web repo to build and push a dockerized DHCP server


Ligne 73 : Ligne 62 :
16. Create a new repo to build and push on S3 a debootstrap image of latest debian version
16. Create a new repo to build and push on S3 a debootstrap image of latest debian version


 
=== '''Target: boot an OS from the network''' ===
'''Target: boot an OS from the network'''
 
17. Update web server to host an ipxe configuration file boot this new OS
17. Update web server to host an ipxe configuration file boot this new OS


Ligne 83 : Ligne 70 :


=== Extra parts for experimented SE4 ===
=== Extra parts for experimented SE4 ===
'''Target: build a custom OS'''


=== '''Target: build a custom OS''' ===
19. Build a kernel (Bonus: less than 50 Mo + boot time < 2s)
19. Build a kernel (Bonus: less than 50 Mo + boot time < 2s)


Ligne 91 : Ligne 78 :
21. Build an init that starts network interfaces
21. Build an init that starts network interfaces


 
=== '''Target: create a logging service''' ===
'''Target: create a logging service'''
 
22. Create a script / service that request user credentials, checks its validity against /etc/passwd, then mount dynamically user's home from rbd
22. Create a script / service that request user credentials, checks its validity against /etc/passwd, then mount dynamically user's home from rbd



Version du 9 mars 2024 à 15:03

Déroulé du TP

Target: discover technologies and use a web server

1. Create VM

  1. Create a virtual machine on Proxmox (server is accessible through: this link) by cloning the template. The virtual machine must be named team-XX with XX being your team number assigned at the beginning of the tutorial.
  2. Manual configure virtual machine's network to be persistent. Your VM's IP must be 10.99.XX.1/16 with the gateway being 10.99.99.254.
  3. Update /etc/hostnameto reflect the VM's name to the hostname
  4. Update /etc/hosts with the two previous updates
  5. Ensure it can ping google.
  6. Reboot the VM and validate it.

2. First web server

  1. Install nginx. (Hint: if it fails, do not forget to configure your VM's DNS).
  2. Setup a custom/cool static page.

3. First load balancer

  1. Install HAProxy 2.8 (Hint: Search "debian haproxy" on your favorite search engine)
  2. Redirect port 8888 to the previously installed nginx.

4. Docker time

  1. Install docker.
  2. Pull nginx image.
  3. Copy your custom static page into the container.
  4. Reconfigure HAProxy to use port 8889 onto the container.

Target: discover technologies and use a web server

5. First Docker image

  1. Create a Docker image based on nginx:latest that use your previously created static page. This image will be named tXX-web and will use semantic versioning.
  2. Publish this new image on the common registry, located at http://10.99.99.254:5000. (Hint: you will have to update your Docker daemon configuration to allow this insecure registry).

6. Nomad installation

  1. Install nomad as a Debian package. See the official documentation
  2. Have Nomad running as client and server. Validate it through its interface which should be accessible through http://10.99.XX.1:4646. (Check it with curl)

7. Access Nomad UI from Zabeth

  1. Add a route on your Zabeth to view Nomad UI from it.

8. First Nomad deployment

  1. Create a nomad job definition with nomad job init command.
  2. Adapt it to deploy the container you created on step 5.

9. Scale and load-balance

  1. Increase job definition count to run 3 container.
  2. Configure HAProxy to redirect port 8890 to those containers through service discovery.

Target: setup a distributed service + deploy from CI

10. Reconfigure nomad to use the common consul and common nomad server

11. Create git repo on Gitlab / Store dockerfile + static page

12. Update job definition in repo / setup CI / deploy new configuration to global nomad

13. Update global haproxy configuration to redirect to the the newly deployed web service

Target: build and deploy more complex services

14. Create new repo as the web repo to build and push a dockerized DHCP server

15. Create a new repo as the web repo to build and push a dockerized TFTP server with ipxe

16. Create a new repo to build and push on S3 a debootstrap image of latest debian version

Target: boot an OS from the network

17. Update web server to host an ipxe configuration file boot this new OS

18. Mount `/home/xxx` as rbd volume from Ceph

Now the new OS boots and use remote storage for users.

Extra parts for experimented SE4

Target: build a custom OS

19. Build a kernel (Bonus: less than 50 Mo + boot time < 2s)

20. Build an init that displays your team ID on the terminal (Bonus: pimped init banner)

21. Build an init that starts network interfaces

Target: create a logging service

22. Create a script / service that request user credentials, checks its validity against /etc/passwd, then mount dynamically user's home from rbd

23. Improve script and update initrd to have a window manager starting after logging

Notation des élèves

La notation du TP est décomposée en deux parties.

14 points sont liés à l’achèvement des différentes étapes décrites précédemment.

6 points sont liés à la performance. En effet; à la fin de chaque étape, il sera noté le classement des équipes.

Equipe \ Etape 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23