forked from lisenet/RHCA-study-notes
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEX280_study_notes.txt
140 lines (119 loc) · 5.48 KB
/
EX280_study_notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
######################################################################
## Tomas Nevar <[email protected]>
## Study notes for EX280 OpenShift Administration exam (RHEL 7)
######################################################################
## Exam objectives:
* OpenShift Container Platform general configuration and management.
- Understand and use the command line and web console.
- Create and delete projects.
- Import, export, and configure Kubernetes resources.
- Configure persistent registry storage.
- Examine resources and cluster status.
- View logs.
- Troubleshoot common problems.
* Docker image management.
- Understand and work with image registries.
- List images.
- Load images from archive files.
- Use image tags.
- Pull and push images.
* Users and Policies management.
- Create and delete users.
- Modify user passwords.
- Modify user and group permissions.
* Applications creation and management.
- Provision persistent application storage.
- Deploy applications using Source-to-Image (S2I).
- Use Git to configure applications.
- Edit and import application templates.
- Assemble an application from existing components.
- Deploy multi-container applications.
- Create containerized services.
- Create and edit external routes.
- Secure routes using TLS certificates.
* Monitoring and Tuning.
- Install and configure metrics.
- Limit resource usage.
- Scale applications to meet increased demand.
- Control pod placement across cluster nodes.
#---------------------------------------------------------------------
## *** Minishift Installation ***
$ wget https://github.com/minishift/minishift/releases/download/v1.34.1/minishift-1.34.1-linux-amd64.tgz
$ tar xf minishift-1.34.1-linux-amd64.tgz
$ export MINISHIFT_HOME=/mnt/images/minishift
$ minishift config set vm-driver virtualbox
$ minishift config set disk-size 32G
$ minishift config set memory 4096
$ minishift config set openshift-version v3.11.0
$ minishift config view
$ minishift start
$ oc login -u system:admin
$ minishift -h
Minishift is a command-line tool that provisions and manages single-node OpenShift clusters optimized for development workflows.
Usage:
minishift [command]
Available Commands:
addons Manages Minishift add-ons.
completion Outputs minishift shell completion for the given shell (bash or zsh)
config Modifies Minishift configuration properties.
console Opens or displays the OpenShift Web Console URL.
delete Deletes the Minishift VM.
docker-env Sets Docker environment variables.
help Help about any command
hostfolder Manages host folders for the Minishift VM.
image Exports and imports container images.
ip Gets the IP address of the running cluster.
logs Gets the logs of the running OpenShift cluster.
oc-env Sets the path of the 'oc' binary.
openshift Interacts with your local OpenShift cluster.
profile Manages Minishift profiles.
services Manage Minishift services
setup Configures pre-requisites for Minishift on the host machine
ssh Log in to or run a command on a Minishift VM with SSH.
start Starts a local OpenShift cluster.
status Gets the status of the local OpenShift cluster.
stop Stops the running local OpenShift cluster.
update Updates Minishift to the latest version.
version Gets the version of Minishift.
Flags:
--alsologtostderr log to standard error as well as files
-h, --help help for minishift
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--profile string Profile name (default "minishift")
--show-libmachine-logs Show logs from libmachine.
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs. Level varies from 1 to 5 (default 1).
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
Use "minishift [command] --help" for more information about a command.
#---------------------------------------------------------------------
## *** OpenShift ***
## Installation:
$ sudo yum install atomic-openshift-utils
$ ansible-playbook /usr/share/ansible/openshift-ansible/playbooks/prerequisites.yml
$ ansible-playbook /usr/share/ansible/openshift-ansible/playbooks/deplpoy_cluster.yml
## Post-installation:
$ oc login -u admin -p redhat --insecure-skip-tls-verify=true
$ oc get nodes --show labels
$ ssh master.lab.example.com
$ sudo -i
$ oc adm policy add-cluster-role-to-user cluster-admin admin
## Manage an OpenShift Instance Using oc:
$ oc login -u admin -p redhat https://master.lab.example.com
$ oc get projects
$ oc project default
$ oc get nodes
$ oc describe master master.lab.example.com
$ oc get pods -o wide
$ oc describe pod docker-registry-1-klmn4
$ oc exec pod docker-registry-1-klmn4 uptime
$ oc rsh pod docker-registry-1-klmn4
$ oc status -v
$ oc get events
$ oc get all
$ oc export pod docker-registry-1-klmn4 -o json
$ oc export svc,dc docker-registry --as-template=docker-registry
$ oc export --help ;# see Example section
## Deploy an app:
$ oc new-app --name=hello -i php:7.0 http://services.lab.example.com/php-helloworld