Ravi Srinivasan
2019-01-03 65a905a7bcbf8888b54f57534d7a2e42088281a4
commit | author | age
1a8071 1 # DevOps Culture & Practice
D 2
3 ## Learner Outcomes
4ba1c2 4 * Provide an immersive experience for students through practical application of DevOps culture using modern software development practices.
RS 5
6 * Allow students to experience the cultural shift they need to make in order to begin a successful DevOps journey.
1a8071 7
6c5da4 8 ## Cluster Information
ME 9
4ba1c2 10 An OpenShift Cluster is required to complete the lab exercises. Students will receive by email (and by the instructors on site) the following information regarding the OpenShift cluster:
RS 11  - <**CLUSTER_URL**> -- Openshift Webconsole/API Server URL
12  - <**APPS_URL**> -- Wildcard subdomain for the exposed applications deployed in the Cluster
74d1f1 13
4ba1c2 14 ## Learner Pre-requisites
RS 15 The following table lists the software requirements for running the lab exercises:
16
dea1fe 17  | Software | Version | Check |
RR 18  | -------- | ------- | ----- |
145763 19  | OCP CLI | v3.11 | $ oc version &#124; grep -i --color oc  <br><span style="color:red">oc </span> v3.11.0+0cbc58b |
a06958 20  | Ansible | => v2.5 | $ ansible --version &#124; grep -i --color ansible <br> <span style="color:red">ansible</span> 2.7.2 <br> .... <br>|
RS 21  | NodeJS | v8.x LTS | $ node -v <br> v8.11.3|
dea1fe 22  | Git Installed | | $ git --version <br> git version 2.17.1|
RR 23  | Google Chrome Web Browser | (>59) | click [here](chrome://version/) if Google Chrome is your default browser else copy the link `chrome://version/` in your Chome |
a06958 24  | Docker latest | Community Edition | $ docker --version <br> Docker version 18.05.0-ce, build f150324|
RS 25  | JDK | v1.8 | $ java -version <br>java version "1.8.0_131"<br>Java(TM) SE Runtime Environment (build 1.8.0_131-b11)<br>Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)|
6c5da4 26  | Access to an OpenShift cluster | | `oc login -u <username> -p <password> <CLUSTER_URL>` |
a06958 27  | Text editor such as Atom, IntelliJ or Visual Studio Code <br><br> (The exercises were created using `VSCode`, so the screenshots will match its layout and color schemes) | - | - |
dea1fe 28
4ba1c2 29 The lab exercises have been tested on the following operating systems
RS 30  * Fedora 29 64-bit
31  * Microsoft Windows 10 Pro 64-bit
32  * macOS 10.14 "Mojave"
33
34  **NOTE**
35  > You will need administrator or super user level access on your system to install the prerequisite software for all the three operating systems.
36  Locked down systems with restricted accounts are not supported.
a06958 37
RS 38  > You can use any text editor to edit lab files. Using an editor that provides syntax highlighting and automatic indentation is helpful. We recommend ***Atom*** or ***Visual Studio Code***  for this course.
4ba1c2 39
RS 40 ### Linux
41
42 1. Download and Install Node.js version 8.x LTS
43 ```bash
44 wget https://nodejs.org/dist/latest-v8.x/node-v8.14.0-linux-x64.tar.gz
45 tar -xvzf node-v8.14.0-linux-x64.tar.gz -C /usr/local/
46 ```
47 Edit your ***.bashrc*** file and add the ***node*** binary to your ***PATH*** environment variable
48 ```bash
49 echo 'export PATH=/usr/local/node-v8.14.0/bin:$PATH' >> $HOME/.bashrc
50 ```
51
52 2. Install OpenJDK version 1.8
53 ```bash
54 dnf install java-1.8.0-openjdk-devel
55 ```
56
57 3. Install Google Chrome version 70 or higher by downloading and running the the 64-bit RPM installer from https://google.com/chrome
58 ```bash
59 dnf install google-chrome-stable_current_x86_64.rpm
60 ```
61 4. Install Docker, Git and Ansible
62 ```bash
63 dnf install git ansible docker
64 systemctl enable docker
65 systemctl start docker
66 ```
67 5. Download and uncompress the OpenShift 3.11 client binary archive. Copy the ***oc*** binary to ***/usr/local/bin*** folder on your system
68 ```bash
69 wget https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz
70 tar -xvzf openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz
71 cp openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/oc /usr/local/bin/
72 chmod +x /usr/local/bin/oc
73 ```
74 6. Download and install Atom text editor RPM installer from https://atom.io/download/rpm, or the Visual Studio Code RPM installer from https://code.visualstudio.com/docs/?dv=linux64_rpm
75 ```bash
76 dnf install <rpm_name>
77 ```
78
79 ### macOS
80 1. Install HomeBrew for macOS by following the installation instructions at https://brew.sh/
81
82 2. Install Node.js version 8.x LTS using the brew command, and follow the instructions to add the **node** binary to the **PATH** environment variable.
83 ```bash
84 brew install node@8
85 ```
86 3. Install JDK version 1.8 for MacOS by using the installer from the Oracle website at https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
87
88 4. Install Google Chrome version 70 or higher by downloading it from https://google.com/chrome
89
90 5. Install Docker for Mac by following the instructions from https://store.docker.com/editions/community/docker-ce-desktop-mac
91
92 6. Install Git using brew
93 ```bash
94 brew install git
95 ```
96
a06958 97 7. You need Ansible version 2.5 or greater to run the exercise playbooks. If you have not installed Ansible, or have an older version, install or upgrade it using brew
4ba1c2 98 ```bash
RS 99 brew install ansible
100 ```
101 8. Download and install Atom text editor from https://atom.io/download/mac, or Visual Studio Code from https://code.visualstudio.com/docs/?dv=osx
102
103 9. Download and uncompress the OpenShift 3.11 client binary archive. Copy the ***oc*** binary to ***/usr/local/bin*** folder on your system
104 ```bash
a06958 105 curl -L -O https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-mac.zip
4ba1c2 106 unzip openshift-origin-client-tools-v3.11.0-0cbc58b-mac.zip
RS 107 cp openshift-origin-client-tools-v3.11.0-0cbc58b-mac/oc /usr/local/bin/
108 chmod +x /usr/local/bin/oc
109 ```
110
111 ### Microsoft Windows
112
65a905 113 You will be adding several directories to the ***PATH*** environment variable. Follow the instructions at https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/ to edit the ***PATH*** environment variable on Windows 10.
RS 114
4ba1c2 115 1. Download the 64-bit Node.js 8.x LTS Windows binary archive file from https://nodejs.org/dist/latest-v8.x/node-v8.14.0-win-x64.zip.
RS 116
117 Extract the zip file archive under a suitable folder in the ***C:\*** drive. Make sure that your directory name does not have any spaces in it.
118
119 Add the directory where you uncompressed the zip file to the ***PATH*** environment variable, so that the ***node.exe*** and ***npm.cmd*** executable files are available in the system path.
120
121 2. Install JDK version 1.8 for Windows 64-bit by using the installer from the Oracle website at https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
122
123 Ensure that you install the JDK into a directory which has no spaces in its name. Add the ***JAVA_HOME\bin*** directory to the ***PATH*** environment variable, so that the ***java.exe*** and ***javac.exe*** executable files are available in the system path.
124
125 3. Install Google Chrome version 70 or higher by downloading it from https://google.com/chrome
126
127 4. Install Docker for Windows by following the instructions from https://hub.docker.com/editions/community/docker-ce-desktop-windows
128
129 5. Download and install Git for Windows by using the 64-bit installer from https://github.com/git-for-windows/git/releases/download/v2.20.0.windows.1/Git-2.20.0-64-bit.exe.
130
131 Follow the instructions at https://www.atlassian.com/git/tutorials/install-git#windows to install and verify your Git installation.
132
133 6. Download and install Atom text editor from https://github.com/atom/atom/releases/download/v1.33.0/AtomSetup-x64.exe, or Visual Studio Code from https://code.visualstudio.com/docs/?dv=win64
134
135 7. You will use a custom container image for running OpenShift client commands, and Ansible playbooks. You will map a directory on your local Windows system containing Ansible playbooks to a directory inside the container, and run the Ansible playbooks from within the container.
136
137 Execute the following commands to run Ansible playbooks on Windows systems:
138
139 * Pull the container image containing the tools and utilities that are required for running Ansible playbooks:
140 ```bash
65a905 141 docker pull quay.io/jrigsbee/do500-toolbox
4ba1c2 142 ```
RS 143
65a905 144 * Launch the container and run a quick test:
4ba1c2 145 ```bash
65a905 146 docker run -it -v C:/do500-workspace:/home/tool-box/workarea:Z quay.io/jrigsbee/do500-toolbox /bin/bash
4ba1c2 147 ```
RS 148
149 The ***C:/do500-workspace*** directory on your Windows system contains the lab files and Ansible playbooks for the lab exercises.
150
65a905 151 * Once you are inside the container, you can log in to the OpenShift cluster using the OpenShift ***oc*** command-line client, and verify that Ansible is installed:
4ba1c2 152 ```bash
RS 153 bash-4.4$ oc login -u <username> -p <password> <CLUSTER_URL>
65a905 154 bash-4.4$ oc version
RS 155 bash-4.4$ ansible --version
156 bash-4.4$ exit
4ba1c2 157 ```
RS 158
65a905 159 Your instructor will provide the ***username*** and ***password*** information for the OpenShift cluster when you are ready to run the lab exercises.
4ba1c2 160
1a8071 161 ## Git and Containers 101
D 162  - Git tutorial covering the basics - https://try.github.io/
163  - Handy guide for those new to containers - https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction/
0f4d08 164
b66742 165 ## Setup your IDE
4ba1c2 166 The following plug-ins are useful for providing syntax highlighting for various lab files:
b66742 167  - YAML Syntax Highlighter
D 168  - JavaScript Syntax Highlighter
169  - Vue.js
4ba1c2 170  - ESlint
RS 171  - Jenkinsfile