Differences

This shows you the differences between two versions of the page.

Link to this comparison view

devops:laboratoare:06 [2021/07/30 17:56]
oana.minciu.th
devops:laboratoare:06 [2022/07/29 18:35] (current)
bogdan.croitoru
Line 1: Line 1:
 ===== FINAL PROJECT ===== ===== FINAL PROJECT =====
  
-1. (5p) Create a new student<​number>​ branch from the following Git repository: https://​gitlab.sschool.ro.thales/​bogdan.croitoru/devops-final-project, starting from branch ​"develop"+1. (5p) Create a new student<​number>​ branch from the following Git repository: https://​gitlab.sschool.ro.thales/​oana/devops-ss-2022/​-/​tree/​develop, starting from branch develop
  
-2. (5p) Modify the Jenkinsfile and add a new stage that will execute the "ps -aux" command 
- Select your term-vm as the running node (also from the Jenkinsfile) 
  
-3. (5p) Filter out the output of the above command by searching for the Jenkins Java process ​and redirect it to a "process_details.txt" ​file+2. (5p) Modify ​the Jenkinsfile ​and add new stage that will execute the "ps -aux" ​command. Select your term-vm as the running node (also from the Jenkinsfile)
  
 +
 +3. (5p) Filter out the output of the above command by searching for the Jenkins Java process and redirect it to a "​process_details.txt"​ file
 <​note>​You can use a specific command to filter by "​home\/​jenkins"</​note>​ <​note>​You can use a specific command to filter by "​home\/​jenkins"</​note>​
 +
  
 4. (5p) Add a post block with "​always"​ option, "​archiveArtifacts"​ to select all the "​*.txt"​ files 4. (5p) Add a post block with "​always"​ option, "​archiveArtifacts"​ to select all the "​*.txt"​ files
  
-5. (5p) Create a new file in the repo root with the name "​exam.sh"​ 
- Add a shebang and print the following text: "I am <​NAME>​ and I will get a nice grade!"​ 
- Commit and push and check the Jenkins triggered job. 
  
 +5. (5p) Create a new file in the repo root with the name "​exam.sh"​
 +        Add a shebang and print the following text: "I am <​NAME>​ and I will get a nice grade!"​
 +        Commit and push and check the Jenkins triggered job.
 <note tip>​Hint:​ make sure the script has executable rights</​note>​ <note tip>​Hint:​ make sure the script has executable rights</​note>​
  
 6. (15p) Create a dockerfile starting from the "​nexus.app.de.corp.thales:​5000/​thales/​ee/​oana/​debugbox:​latest"​ image, with the following steps: 6. (15p) Create a dockerfile starting from the "​nexus.app.de.corp.thales:​5000/​thales/​ee/​oana/​debugbox:​latest"​ image, with the following steps:
- a) copy the "​exam.sh"​ file in /opt/ +        ​a) copy the "​exam.sh"​ file in /opt/ 
- b) change your working directory to /opt/ +        b) change your working directory to /opt/ 
- c) create a new user with the id "1000 + <​student_number>"​ + (using WORKDIR directive in Dockerfile) 
- d) expose port 1234+        ​c) create a new user with the id "1000 + <​student_number>"​ 
 + Exemplu comandă pentru adăugarea unui utilizator: useradd –create-home –shell /bin/bash –uid 1000 –user-group devops 
 +        ​d) expose port 1234 
 + (using EXPOSE directive)
  
 7. (15p) Update the Jenkinsfile with 2 new stages (name them as you like): 7. (15p) Update the Jenkinsfile with 2 new stages (name them as you like):
- ==> build the Docker image with the name "​dockerimage-<​student_number>"​ +        ​==> build the Docker image with the name "​dockerimage-<​student_number>"​ 
- ==> start a container using the generated image that will execute the "​exam.sh"​ script+        ==> start a container using the generated image that will execute the "​exam.sh"​ script
 <​note>​The container should: <​note>​The container should:
   * remove by itself after the run is finished   * remove by itself after the run is finished
   * have port 1234 exposed   * have port 1234 exposed
 </​note>​ </​note>​
-<note tip>​Hint:​ **-it** for running docker containers will block the terminal. ​The **-d** option instead of **-it** or **-ti** will make sure the container runs in detached mode, which is suitable for Jenkins ​operations.</​note>​+<note tip>​Hint:​ **-it** for running docker containers will block the terminal. ​Before you use it in Jenkins ​make sure if you actually need it.</​note>​
  
-8. (15pUnset the PROXY environment variables using the following command: +8. 
-  +  * (5pCheck the "my.yaml" file in your branch ​and fix the problems
-<​note>​"unset no_proxy http_proxy https_proxy HTTP_PROXY HTTPS_PROXY NO_PROXY"</​note>​  +  * (10pSet the following ​properties:
-  * Create a new file in the root of the Git repository, with the name "​kubernetes_details.txt"​ +
-  * Identify using kubectl the master node INTERNAL-IP ​and write it on a new line in the "​kubernetes_details.txt" file +
-  * Create a new Kubernetes namespace called "​final_project_<​student_number>"​. +
- +
-9. (15pCreate a new "​my.yaml"​ file in your branch with the following ​details:+
 <​note>​ <​note>​
   * metadata => name: student<​number>​   * metadata => name: student<​number>​
Line 47: Line 46:
 </​note>​ </​note>​
   * Create a new pod based on it.   * Create a new pod based on it.
-  + 
-10. (10p) Start the newly created pod and describe it+9. (10p) Check the newly created pod and describe it
   * Get the value of the "​Container ID" field and write it as a new line in the "​kubernetes_details.txt"​ file   * Get the value of the "​Container ID" field and write it as a new line in the "​kubernetes_details.txt"​ file
-  * Delete ​the pod.+ 
 +10. (10p) Show the logs for the running ​pod using kubectl commands and redirect the output to <​student_no>​_pod_logs.txt
  
 11. (5p) Create a pull request to the "​develop"​ branch 11. (5p) Create a pull request to the "​develop"​ branch
 +
 +12. (5p) Complete feedback form, located here: https://​forms.gle/​Jwp9RoaBUHSYJ4uv5
  
devops/laboratoare/06.1627657011.txt.gz · Last modified: 2021/07/30 17:56 by oana.minciu.th
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0