tpage
2018-05-29 707fafdc98962610273812f1c051fef0181f2cba
commit | author | age
732ecb 1 # Rogue Cluster
D 2
e73d29 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 ---
732ecb 6
D 7 ## Cluster Requirements
8
e73d29 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.
732ecb 10
707faf 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.
e73d29 16
T 17 ## Cluster Access
18
707faf 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
e73d29 21
T 22 ## User privileges
23
707faf 24 - Learners deploying GitLab will require privileges to run SCC containers
e73d29 25
T 26 ## Labs Cheat Sheet
27
be0752 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.
e73d29 29
707faf 30 - Changing Directory
e73d29 31
707faf 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
e73d29 36
707faf 37 - Creating a blank file or directory
e73d29 38
707faf 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
e73d29 41
707faf 42 - Listing files within current directory
e73d29 43
707faf 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
e73d29 46
707faf 47 - Quickly see the contents of a file
e73d29 48
707faf 49   - `cat file_name` prints the contents of `file_name` to the console
e73d29 50
707faf 51 - Move or rename a file
e73d29 52
707faf 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`
e73d29 55
707faf 56 - Open a file
e73d29 57
707faf 58   - `open file_name` will open the file as though it had been double clicked in a standard user interface
e73d29 59
707faf 60 - Copy a file or directory
e73d29 61
707faf 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
e73d29 65
707faf 66 - Delete a file or directory
e73d29 67
707faf 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 /`
e73d29 71
707faf 72 - Search for a string within an input
e73d29 73
707faf 74   - `grep 'substring' file_name` will print all lines in the file which contain the string 'substring'
e73d29 75
707faf 76 - Place the output of one command into the input of another
e73d29 77
707faf 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
e73d29 79
707faf 80 - Find out how to do things in the terminal
be0752 81
707faf 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.
e73d29 85
707faf 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.
e73d29 88
T 89 ## Openshift 101
90
be0752 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.
e73d29 92
707faf 93 - What is a container?
e73d29 94
707faf 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.
e73d29 96
707faf 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.
e73d29 99
T 100 ## Ansible 101
101
102 Ansible is a tool which automates software provisioning, configuration management, and application deployment.
103
707faf 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.