tpage
2018-05-29 fd96bdef35f9d6eb63d7ec304c5389e9b1c0a262
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 <p class="tip">
8 NOTE - This section is a WIP and will evolve over time.
9 </p>
10
11 ## Cluster Requirements
12
6a2a43 13 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 14
6a2a43 15 - Jenkins requires 5Gi of Persistent Storage and 4Gi of RAM
T 16 - GitLab requires 2Gi of storage and 2Gi of RAM
17 - PostgreSQL requires 1Gi of Storage and 512Mi of RAM
18 - Redis requires 512Mi of storage
c87b68 19 - Nexus requires 1Gi of storage.
6a2a43 20
T 21 ## Cluster Access
22
23 - Learners are in LDAP and can access cluster via `oc login`
fd96bd 24 - Learners have access to LDAP bind credentials to be able to auth against GitLab
6a2a43 25
T 26 ## User privileges
27
28 - Learners will require privileges to run SCC containers i.e. GitLab
29
30 ## Labs Cheat Sheet
31
fd96bd 32 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 33
T 34 - Changing Directory
35
36   - `cd dir_name` Changes directory to `dir_name` within your current working directory
37   - `cd /path/to/dir` Changes to the absolute location specified
38   - `cd ..` Changes to the parent directory
39   - `cd -` Changes to the previous diretory
40
41 - Creating a blank file or directory
42
43   - `touch file_name` Creates a blank file named `file_name` within the current directory
44   - `mkdir dir_name` Creates a new directory named `dir_name` within the current directory
45
46 - Listing files within current directory
47
48   - `ls` prints a list of the files within your current directory
49   - `ls -l` prints a list of the files within your current directory with more detail
50
51 - Quickly see the contents of a file
52
53   - `cat file_name` prints the contents of `file_name` to the console
54
55 - Move or rename a file
56
57   - `mv file_name dest_dir` will move the file from the current directory to `dest_dir`
58   - `mv file_name new_name` will rename the file to `new_name`
59
60 - Open a file
61
62   - `open file_name` will open the file as though it had been double clicked in a standard user interface
63
64 - Copy a file or directory
65
66   - `cp file_name dest_dir` will create a copy of the file in the destination directory
67   - `cp file_name copied_name` will create a copy of the file in the same directory and it shall be called `copied_name`
68   - `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
69
70 - Delete a file or directory
71
72   - `rm file_name` will delete the file
73   - `rm -rf dir_name` will delete the directory and all of its contents
fd96bd 74   - Whatever you do, _do not_ run `sudo rm -rf /`
6a2a43 75
T 76 - Search for a string within an input
77
78   - `grep 'substring' file_name` will print all lines in the file which contain the string 'substring'
79
80 - Place the output of one command into the input of another
81
82   - `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
83
84 - Find out how to do things in the terminal
fd96bd 85
6a2a43 86   - `man command1` will open the man pages (manual pages) for a particular command.
T 87   - `man -k <search string>` will return a list of commands relevant to the search string you've entered.
88   - If you want to know more about `man` try `man man` for more `man` on `man` information.
89
90 - Run commands with root privileges
fd96bd 91   - `sudo command1` will run a command with escalated privileges. This is safer than logging on as root user.
6a2a43 92
T 93 ## Openshift 101
94
fd96bd 95 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 96
T 97 - What is a container?
98
fd96bd 99   - 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 100
fd96bd 101 - How do you control OpenShift?
T 102   - 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 103
T 104 ## Ansible 101
105
106 Ansible is a tool which automates software provisioning, configuration management, and application deployment.
107
108 - How to run an Ansible playbook
109   - `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.