Ravi Srinivasan
2019-02-28 0a4347dbd063df448950cab7e5b6c4b035f08aec
commit | author | age
2b2c52 1 # Rogue Cluster
D 2
6a2a43 3 > This section contains information needed when setting up the cluster, and a command line cheat sheet to help with completing exercises.
T 4
5 ---
2b2c52 6
D 7 ## Cluster Requirements
8
6a2a43 9 Learners will create 3 to 4 project namespaces running lightweight NodeJS app \* 2 and a MongoDB in up to three of these namespace (dev, test, uat for example). The learners ci-cd namespace will house GitLab, Nexus and Jenkins as well as any slave pods used by Jenkins.
2b2c52 10
9d88c3 11 - Jenkins requires 5Gi of Persistent Storage and 4Gi of RAM
T 12 - GitLab requires 2Gi of storage and 2Gi of RAM
13 - PostgreSQL requires 1Gi of Storage and 512Mi of RAM
14 - Redis requires 512Mi of storage
15 - Nexus requires 1Gi of storage.
6a2a43 16
T 17 ## Cluster Access
18
9d88c3 19 - Learners are in LDAP and can access cluster via `oc login`
T 20 - Learners have access to LDAP bind credentials to be able to auth against GitLab
6a2a43 21
T 22 ## User privileges
23
9d88c3 24 - Learners deploying GitLab will require privileges to run SCC containers
6a2a43 25
T 26 ## Labs Cheat Sheet
27
fd96bd 28 This cheat sheet will give you some of the most useful commands and tips which you will need to complete the exercises. This should be most helpful to non-techies who need to get up to speed with command line techniques. If you come across anything else which would be useful during the enablement, write it on a post-it and add it to the real time retro or raise a pull request.
6a2a43 29
9d88c3 30 - Changing Directory
6a2a43 31
9d88c3 32   - `cd dir_name` Changes directory to `dir_name` within your current working directory
T 33   - `cd /path/to/dir` Changes to the absolute location specified
34   - `cd ..` Changes to the parent directory
35   - `cd -` Changes to the previous diretory
6a2a43 36
9d88c3 37 - Creating a blank file or directory
6a2a43 38
9d88c3 39   - `touch file_name` Creates a blank file named `file_name` within the current directory
T 40   - `mkdir dir_name` Creates a new directory named `dir_name` within the current directory
6a2a43 41
9d88c3 42 - Listing files within current directory
6a2a43 43
9d88c3 44   - `ls` prints a list of the files within your current directory
T 45   - `ls -l` prints a list of the files within your current directory with more detail
6a2a43 46
9d88c3 47 - Quickly see the contents of a file
6a2a43 48
9d88c3 49   - `cat file_name` prints the contents of `file_name` to the console
6a2a43 50
9d88c3 51 - Move or rename a file
6a2a43 52
9d88c3 53   - `mv file_name dest_dir` will move the file from the current directory to `dest_dir`
T 54   - `mv file_name new_name` will rename the file to `new_name`
6a2a43 55
9d88c3 56 - Open a file
6a2a43 57
9d88c3 58   - `open file_name` will open the file as though it had been double clicked in a standard user interface
6a2a43 59
9d88c3 60 - Copy a file or directory
6a2a43 61
9d88c3 62   - `cp file_name dest_dir` will create a copy of the file in the destination directory
T 63   - `cp file_name copied_name` will create a copy of the file in the same directory and it shall be called `copied_name`
64   - `cp -r dir_name dest_dir` will copy a directory to the destination location. Note the `-r` flag is necessary to copy the contents of the directory
6a2a43 65
9d88c3 66 - Delete a file or directory
6a2a43 67
9d88c3 68   - `rm file_name` will delete the file
T 69   - `rm -rf dir_name` will delete the directory and all of its contents
70   - Whatever you do, _do not_ run `sudo rm -rf /`
6a2a43 71
9d88c3 72 - Search for a string within an input
6a2a43 73
9d88c3 74   - `grep 'substring' file_name` will print all lines in the file which contain the string 'substring'
6a2a43 75
9d88c3 76 - Place the output of one command into the input of another
6a2a43 77
9d88c3 78   - `command1 | command2` will run command 1 then run command 2 with the input of the result of command 1. e.g. `ls | grep 'file'` will give you all files in the current directory which have 'file' in their name
6a2a43 79
9d88c3 80 - Find out how to do things in the terminal
fd96bd 81
9d88c3 82   - `man command1` will open the man pages (manual pages) for a particular command.
T 83   - `man -k <search string>` will return a list of commands relevant to the search string you've entered.
84   - If you want to know more about `man` try `man man` for more `man` on `man` information.
6a2a43 85
9d88c3 86 - Run commands with root privileges
T 87   - `sudo command1` will run a command with escalated privileges. This is safer than logging on as root user.
6a2a43 88
T 89 ## Openshift 101
90
fd96bd 91 OpenShift, or OpenShift Container Platform (OCP) is Red Hat's container platform. It is used to run and manage containerised applications with the aim of accelerated application development and deployment. We shall be deploying all of our applications for this enablement on an OpenShift cluster.
6a2a43 92
9d88c3 93 - What is a container?
6a2a43 94
9d88c3 95   - A container is an isolated space within the operating system which is made to look like its own computer. Things within the container can only see what is in itself and cannot see anything about the computer it is really running on. Additionally multiple containers can be deployed with no interaction between one another meaning they will not coflict.
6a2a43 96
9d88c3 97 - How do you control OpenShift?
T 98   - There are two main ways of controlling OpenShift and the containers which reside within it. The first way is using the web interface; from here is it possible to use clicks to deploy an application. The easiest way to do this is direct from the source code using a Source-to-image (S2I) which comes out of the box with OpenShift. It is also possible (and encouraged) to use the command line interface, using the `oc` command, to control OCP. The other option is to use Ansible to set the cluster to a defined standard, as set out in an Ansible playbook.
6a2a43 99
T 100 ## Ansible 101
101
102 Ansible is a tool which automates software provisioning, configuration management, and application deployment.
103
9d88c3 104 - How to run an Ansible playbook
T 105   - `ansible-playbook file.yml -i inventory_dir/` will run the Ansible playbook defined in file.yml (playbooks are defined in YAML format). The inventory directory will contain all of the information about what will be deployed. In the enablement we will use Ansible extensively, but the structure will be given to you to make this easier.