tpage
2018-05-29 4a88a3658a3037885cb8a292d1ccb48a37d4e399
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 <p class="tip">
8 NOTE - This section is a WIP and will evolve over time.
9 </p>
10
11 ## Cluster Requirements
12
e73d29 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.
732ecb 14
e73d29 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
4a88a3 19 - Nexus requires 1Gi of storage.
e73d29 20
T 21 ## Cluster Access
22
23 - Learners are in LDAP and can access cluster via `oc login`
24 - Learners have access to LDAP bind credentials to be able to auth against gitlab
25
26 ## User privileges
27
28 - Learners will require privileges to run SCC containers i.e. GitLab
29
30 ## Labs Cheat Sheet
31
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 yourself.
33
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
4a88a3 74   - Whatever you do, __do not__ run `sudo rm -rf /`
e73d29 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
85   - `man command1` will open the man pages (manual pages) for a particular command.
86   - `man -k <search string>` will return a list of commands relevant to the search string you've entered.
87   - If you want to know more about `man` try `man man` for more `man` on `man` information.
88
89 - Run commands with root privileges
90   - `sudo command1` will run a command with escalated privileges. This is safer than logging on as
91
92 ## Openshift 101
93
94 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. An OpenShift cluster is what we shall be deploying all of our applications for this enablement upon.
95
96 - What is a container?
97
98   - A container is an iscolated 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 which have a complete seperation of concern from each other meaning they will not coflict.
99
100 - How do you control OpenShift
101   - 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 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
102
103 ## Ansible 101
104
105 Ansible is a tool which automates software provisioning, configuration management, and application deployment.
106
107 - How to run an Ansible playbook
108   - `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.