|
1 | 1 | [](https://gitter.im/openshift/openshift-ansible)
|
2 | 2 | [](https://travis-ci.org/openshift/openshift-ansible)
|
3 |
| -[](https://coveralls.io/github/openshift/openshift-ansible?branch=master) |
4 |
| - |
5 |
| -NOTICE |
6 |
| -====== |
7 |
| - |
8 |
| -Master branch is closed! A major refactor is ongoing in devel-40. |
9 |
| -Changes for 3.x should be made directly to the latest release branch they're |
10 |
| -relevant to and backported from there. |
11 |
| - |
12 |
| -WARNING |
13 |
| -======= |
14 |
| - |
15 |
| -This branch is under heavy development. If you are interested in deploying a |
16 |
| -working cluster, please utilize a release branch. |
17 | 3 |
|
18 | 4 | # OpenShift Ansible
|
19 |
| - |
20 | 5 | This repository contains [Ansible](https://www.ansible.com/) roles and
|
21 |
| -playbooks to install, upgrade, and manage |
22 |
| -[OpenShift](https://www.openshift.com/) clusters. |
23 |
| - |
24 |
| -## Getting the correct version |
25 |
| -When choosing an openshift release, ensure that the necessary origin packages |
26 |
| -are available in your distribution's repository. By default, openshift-ansible |
27 |
| -will not configure extra repositories for testing or staging packages for |
28 |
| -end users. |
29 |
| - |
30 |
| -We recommend using a release branch. We maintain stable branches |
31 |
| -corresponding to upstream Origin releases, e.g.: we guarantee an |
32 |
| -openshift-ansible 3.2 release will fully support an origin |
33 |
| -[1.2 release](https://github.com/openshift/openshift-ansible/tree/release-1.2). |
34 |
| - |
35 |
| -The most recent branch will often receive minor feature backports and |
36 |
| -fixes. Older branches will receive only critical fixes. |
37 |
| - |
38 |
| -In addition to the release branches, the master branch |
39 |
| -[master branch](https://github.com/openshift/openshift-ansible/tree/master) |
40 |
| -tracks our current work **in development** and should be compatible |
41 |
| -with the |
42 |
| -[Origin master branch](https://github.com/openshift/origin/tree/master) |
43 |
| -(code in development). |
44 |
| - |
| 6 | +playbooks for [OpenShift](https://www.openshift.com/) clusters. |
45 | 7 |
|
| 8 | +## Previous OpenShift Ansible 3.x releases |
| 9 | +For 3.x releases of OpenShift Ansible please reference the release branch for |
| 10 | +specific versions. The last 3.x release is |
| 11 | +[3.11 release](https://github.com/openshift/openshift-ansible/tree/release-3.11). |
46 | 12 |
|
47 |
| -**Getting the right openshift-ansible release** |
| 13 | +## OpenShift 4.x |
| 14 | +Installation of OpenShift 4.x uses a command-line installation wizard instead of |
| 15 | +Ansible playbooks. Learn more about the OpenShift Installer in this |
| 16 | +[overview](https://github.com/openshift/installer/blob/master/docs/user/overview.md#installer-overview). |
48 | 17 |
|
49 |
| -Follow this release pattern and you can't go wrong: |
| 18 | +For OpenShift 4.x, this repo only provides playbooks necessary for scaling up an |
| 19 | +existing 4.x cluster with RHEL hosts. |
50 | 20 |
|
51 |
| -| Origin/OCP | OpenShift-Ansible version | openshift-ansible branch | |
52 |
| -| ------------- | ----------------- |----------------------------------| |
53 |
| -| 1.3 / 3.3 | 3.3 | release-1.3 | |
54 |
| -| 1.4 / 3.4 | 3.4 | release-1.4 | |
55 |
| -| 1.5 / 3.5 | 3.5 | release-1.5 | |
56 |
| -| 3.*X* | 3.*X* | release-3.x | |
57 |
| - |
58 |
| -If you're running from the openshift-ansible **master branch** we can |
59 |
| -only guarantee compatibility with the newest origin releases **in |
60 |
| -development**. Use a branch corresponding to your origin version if |
61 |
| -you are not running a stable release. |
62 |
| - |
63 |
| - |
64 |
| -## Setup |
65 |
| - |
66 |
| -Install base dependencies: |
| 21 | +The [master branch](https://github.com/openshift/openshift-ansible/tree/master) |
| 22 | +tracks our current work **in development**. |
67 | 23 |
|
68 | 24 | Requirements:
|
69 | 25 |
|
70 | 26 | - Ansible >= 2.7.8
|
71 |
| -- Jinja >= 2.7 |
72 | 27 | - pyOpenSSL
|
73 |
| -- python-lxml |
74 |
| - |
75 |
| ----- |
76 |
| - |
77 |
| -Fedora: |
78 |
| - |
79 |
| -``` |
80 |
| -dnf install -y ansible pyOpenSSL python-cryptography python-lxml |
81 |
| -``` |
82 |
| - |
83 |
| -## Simple all-in-one localhost Installation |
84 |
| -This assumes that you've installed the base dependencies and you're running on |
85 |
| -Fedora or RHEL |
86 |
| -``` |
87 |
| -git clone https://github.com/openshift/openshift-ansible |
88 |
| -cd openshift-ansible |
89 |
| -sudo ansible-playbook -i inventory/hosts.localhost playbooks/prerequisites.yml |
90 |
| -sudo ansible-playbook -i inventory/hosts.localhost playbooks/deploy_cluster.yml |
91 |
| -``` |
| 28 | +- python2-openshift |
92 | 29 |
|
93 | 30 | # Quickstart
|
94 | 31 |
|
95 |
| -Install the new installer from https://www.github.com/openshift/installer |
96 |
| - |
97 |
| -Construct a proper install-config.yml, and make a copy called |
98 |
| -install-config-ansible.yml. |
99 |
| - |
100 |
| -## Hosts |
101 |
| -You will need the following hosts |
102 |
| - |
103 |
| -### Boostrap host |
104 |
| -This is a special host that is not part of the cluster but is required to be |
105 |
| -available to help the cluster bootstrap itself. This is not a bastion host, |
106 |
| -it will initially be part of the cluster and should be able to communicate with |
107 |
| -the masters in the cluster. |
108 |
| - |
109 |
| -### Masters |
110 |
| -You need 1 or 3 masters. |
111 |
| - |
112 |
| -### Workers |
113 |
| -You need 0 or more workers. Note, by default, masters are unschedulable so |
114 |
| -you will need one or more workers if you want to schedule workloads. |
115 |
| - |
116 |
| -## DNS |
117 |
| -4.x installs require specific dns records to be in place, and there is no way |
118 |
| -to complete an install without working DNS. You are in charge of ensuring the |
119 |
| -following DNS records are resolvable from your cluster, the openshift-ansible |
120 |
| -installer will not make any attempt to do any of this for you. |
121 |
| - |
122 |
| -First, the output of ```hostname``` on each host must be resolvable to other hosts. |
123 |
| -The nodes will communicate with each other based on this value. |
124 |
| - |
125 |
| -install-config.yml value of 'baseDomain' must be a working domain. |
126 |
| - |
127 |
| -### A records |
128 |
| -```sh |
129 |
| -<clustername>-api.<baseDomain> # ex: mycluster-api.example.com |
130 |
| -<clustername>-master-0.<baseDomain> # ex: mycluster-master-0.example.com |
131 |
| -<clustername>-etcd-0.<baseDomain> # ex: mycluster-etcd-0.example.com |
132 |
| -<clustername>-bootstrap.<baseDomain> # ex: mycluster-bootstrap.example.com |
133 |
| -``` |
134 |
| - |
135 |
| -Note: There should be a master/etcd record for each master host in your cluster |
136 |
| -(either 1 or 3). etcd hosts must be master hosts, and the records must resolve |
137 |
| -to the same host for each master/etcd record, respectively. |
138 |
| - |
139 |
| -### SRV records |
140 |
| -```sh |
141 |
| -SRV _etcd-client-ssl._tcp.<clustername>.<baseDomain> '1 1 2379 <clustername>-etcd-0.<baseDomain>' |
142 |
| -SRV _etcd-server-ssl._tcp.<clustername>.<baseDomain> '1 1 2380 <clustername>-etcd-0.<baseDomain>' |
143 |
| -... |
144 |
| -SRV _etcd-client-ssl._tcp.<clustername>.<baseDomain> '1 1 2379 <clustername>-etcd-<N-1>.<baseDomain>' |
145 |
| -SRV _etcd-server-ssl._tcp.<clustername>.<baseDomain> '1 1 2380 <clustername>-etcd-<N-1>.<baseDomain>' |
146 |
| - |
147 |
| -# ex: _etcd-client-ssl._tcp.mycluster.example.com '1 1 2379 mycluster-etcd-0.example.com' |
148 |
| -``` |
149 |
| - |
150 |
| -Consult with your DNS provider about the proper way to create SRV records. In |
151 |
| -any case, there should be a client and server SRV record for each etcd backend, |
152 |
| -and you MUST use the etcd FQDN you created earlier, not the master or any other |
153 |
| -record. |
| 32 | +## Install an OpenShift 4.x cluster |
| 33 | +Install a cluster using the [OpenShift Installer](https://www.github.com/openshift/installer). |
154 | 34 |
|
155 | 35 | ## Inventory
|
156 |
| -Check out inventory/40_basic_inventory.ini for an example. |
| 36 | +Create an inventory file with the `new_workers` group to identify the hosts which |
| 37 | +should be added to the cluster. |
| 38 | +```yaml |
| 39 | + |
| 40 | +--- |
| 41 | +[new_workers] |
| 42 | +mycluster-worker-0.example.com |
| 43 | +mycluster-worker-1.example.com |
| 44 | +mycluster-worker-2.example.com |
| 45 | +``` |
157 | 46 |
|
158 |
| -## Generate ignition configs |
159 |
| -Use the openshift-install command to generate ignition configs utilizing the |
160 |
| -install-config.yml you created earlier. This will consume the install-config.yml |
161 |
| -file, so ensure you have copied the file as mentioned previously. |
| 47 | +## Run the scaleup playbook |
162 | 48 |
|
163 |
| -```sh |
164 |
| -openshift-install create ignition-configs |
| 49 | +```bash |
| 50 | +ansible-playbook playbooks/openshift_node/scaleup.yml |
165 | 51 | ```
|
166 | 52 |
|
167 |
| -## Run playbook |
168 |
| -playbooks/deploy_cluster_40.yml |
169 |
| - |
170 | 53 | # Further reading
|
171 | 54 |
|
172 | 55 | ## Complete Production Installation Documentation:
|
|
0 commit comments