summaryrefslogtreecommitdiffstats
path: root/deployment/README.rst
blob: f2e7064616c183e34e702776b262556952576543 (plain)
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
=====================================
Deployment of OpenShift 3.x On VMWare
=====================================

-----------
What is it?
-----------

It is end-to-end deployment tool for deployment of OpenShift 3.x and
OpenShift Container Storage (OCS) on top of the VMWare cloud platform.
It is set of `Ansible <https://github.com/ansible/ansible>`__ playbooks,
which wraps the
`openshift-ansible <https://github.com/openshift/openshift-ansible>`__ library.

This wrapper adds additional things, which are needed and not provided by
mentioned library. Such as following:

- Node provisioning.

- Node preparation.

- Gather info about newly provisioned nodes and installed OpenShift (including
  storage part). Providing, as an output, config file for automated test cases.

- Run post-config actions which do required, for automated testing, stuff.

--------------------------
What can it do? It can ...
--------------------------

- ... deploy OpenShift 3.6, 3.7, 3.9, 3.10 and 3.11 on top of
  the VMWare cloud platform.

- ... deploy containerized and standalone GlusterFS clusters.
  The GlusterFS versions are configurable and depend on the used repositories.

- ... use downstream repositories for package installation.

- ... use any docker registry for getting container images.

-------------------
VMWare requirements
-------------------

- DHCP configured for all the new VMs.

- New VMs get deployed from VMWare 'template'. So, should be created proper
  VMWare template. It can be bare RHEL7. Or somehow updated RHEL7.

- One OpenShift cluster is expected to be, at least, 5 VMs large. So,
  there should be enough resources for it.

-----
Usage
-----

1) Create VMWare template VM using RHEL7
----------------------------------------

- Add SSH public key(s) for password-less connection required by Ansible

.. code-block:: console

    $ ssh-copy-id username@ip_address_of_the_vm_which_will_be_used_as_template

- Make sure that default user SSH key pair is the same on the “Ansible” machine

2) Install dependencies
-----------------------

Install following dependencies on the machine where you are going to run
deployment.

- Install “pip”, “git” and “libselinux-python” if not installed yet:

.. code-block:: console

    $ yum install python-pip git libselinux-python

- Install “tox” if not installed yet:

.. code-block:: console

    $ pip install git+git://github.com/tox-dev/tox.git@2.9.1#egg=tox

Considering the fact that it is 'end-to'end' deployment tool,
deployment always will run on the separate machine compared to the machines
of deployed cluster.

3) Configure tool before starting deployment
--------------------------------------------

Open “ocp-on-vmware.ini” file with any text editor and provide correct values
for all the config options. All of the options have inline descriptions in
the same file.

5) Deploy OpenShift:
--------------------

OpenShift can be deployed using following command:

.. code-block:: console

    $ tox -e ocp3.X -- python ocp-on-vmware.py --no_confirm --verbose

Replace 'X' in the 'ocp3.X' part of the command to
the proper minor version of the OpenShift. Allowed are following values:
'ocp3.6', 'ocp3.7', 'ocp3.9', 'ocp3.10' and 'ocp3.11'. The same is true for
below commands too.


6) Install OpenShift Container Storage
--------------------------------------

Use following command for brownfield installation of
OpenShift Container Storage on top of the already
deployed (in previous step) OpenShift cluster:

.. code-block:: console

    $ tox -e ocp3.X -- python add-node.py \
      --verbose --node_type=storage --node_number=3 --no_confirm

Note that if “--node_number=Y” is not provided, then 3 nodes will be installed
by default. Type of storage (CNS or CRS) is defined in
“ocp-on-vmware.ini” file. Where "CNS" is containerized GlusterFS and
"CRS" is standalone GlusterFS installations.


7) Clean up deployed cluster
----------------------------

If deplyoed cluster is not needed anymore, it can be cleaned up using following
command:

.. code-block:: console

    $ tox -e ocp3.x -- python  ocp-on-vmware.py --clean


------------------------
History of the code base
------------------------

Originally, code base was forked from
`openshift-ansible-contrib <https://github.com/openshift/openshift-ansible-contrib>`__
project.
It supported only OpenShift 3.6 with restricted set of features at that moment.
Project was exactly 'forked', and not 'used directly', just because that
'restricted set of features' didn't satisfy
our (OpenShift Storage Quality Assurance team) needs and environments.
Our needs were usage of VMWare cloud platform with configured DHCP for new VMs.

So, for ability to have end-to-end deployment tool, we forked it and started
actively work on it. Not having time for long review process of the source
project PRs (Pull Requests).
Then this 'fork' envolved a lot. It started supporting bunch of OpenShift
versions in the single code base. In addition to the addon of
other new features.
And, finally, this code came to the repo with 'automated test cases' which are
used with this deployment tool in CI.