Skip to content

Commit d928e29

Browse files
authored
Merge branch 'master' into nodecount
2 parents 69652a1 + a17b02b commit d928e29

13 files changed

Lines changed: 183 additions & 5 deletions

README.adoc

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,57 @@ Sometimes it's necessary to find out why a stack was not deployed as expected.
276276
link:README_debugging.adoc[Debugging] helps you find the root cause of the
277277
issue.
278278

279+
== OpenStack Integration
280+
281+
OpenShift on OpenStack takes advantage of the cloud provider to offer
282+
features such as dymaic storage to the OpenShift users. Auto scaling
283+
also requires communication with the OpenStack service. You must
284+
provide a set of OpenStack credentials so that OpenShift and the heat
285+
scaling mechanism can work correctly.
286+
287+
These are the same values used to create the Heat stack.
288+
289+
.Sample OSP Credentials - `osp_credentials.yaml`
290+
----
291+
---
292+
parameters:
293+
os_auth_url: http://10.0.x.x:5000/v2.0
294+
os_username: <username>
295+
os_password: <password>
296+
os_region_name: regionOne
297+
os_tenant_name: <tenant name>
298+
----
299+
300+
When invoking the stack creation, include this by adding `-e
301+
osp_credentials.yaml` to the command.
302+
303+
== [[ca-certificates]]OpenStack with SSL/TLS
304+
305+
If your OpenStack service is encrypted with SSL/TLS, you will need to
306+
provide the CA certificate so that the communication channel can be
307+
validated.
308+
309+
The CA certificate is provided as a literal string copy of contents of
310+
the CA certificate file, and can be included in an additional
311+
environment file:
312+
313+
.CA Certificate Parameter File `ca_certificates.yaml`
314+
----
315+
---
316+
parameters:
317+
ca_cert: |
318+
-----BEGIN CERTIFICATE-----
319+
...
320+
-----END CERTIFICATE-----
321+
----
322+
323+
When invoking the stack creation, includ this by adding `-e
324+
ca_certificates.yaml`.
325+
326+
You can include multiple CA certificate strings and all will be imported
327+
into the CA list on all instances.
328+
329+
279330
== Multiple Master Nodes
280331

281332
You can deploy OpenShift with multiple master hosts using the 'native'
@@ -385,15 +436,15 @@ when you create the stack.
385436

386437
Example of `env_ldap.yaml` using an Active Directory server:
387438

388-
```yaml
439+
.LDAP parameter file `env_ldap.yaml
440+
----
389441
parameter_defaults:
390442
ldap_hostname: <ldap hostname>
391443
ldap_ip: <ip of ldap server>
392444
ldap_url: ldap://<ldap hostname>:389/CN=Users,DC=example,DC=openshift,DC=com?sAMAccountName
393445
ldap_bind_dn: CN=Administrator,CN=Users,DC=example,DC=openshift,DC=com?sAMAccountName
394446
ldap_bind_password: <admin password>
395-
```
396-
447+
----
397448

398449
```bash
399450
heat stack-create my-openshift \
@@ -402,6 +453,8 @@ heat stack-create my-openshift \
402453
-f openshift-on-openstack/openshift.yaml
403454
```
404455

456+
If your LDAP service uses SSL, you will also need to add a link:#ca-certificates[CA Certficate] for the LDAP communications.
457+
405458
== Using Custom Yum Repositories
406459

407460
You can set additional Yum repositories on deployed nodes by passing `extra_repository_urls`
@@ -513,7 +566,7 @@ the `dns_nameserver` list.
513566
You will still need to set the API and wildcard entries, though.
514567

515568

516-
== Retrieving the CA certificate
569+
== Retrieving the OpenShift CA certificate
517570

518571
You can retrieve the CA certificate that was generated during the OpenShift
519572
installation by running

bastion.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ parameters:
201201
description: List of docker repository URLs which will be installed on each node, if a repo is insecure use '#insecure' suffix.
202202
default: ''
203203

204+
ca_cert:
205+
type: string
206+
description: Certificate Authority Certificate to be added to trust chain
207+
204208
resources:
205209

206210
# A VM to provide host based orchestration and other sub-services
@@ -235,6 +239,7 @@ resources:
235239
parts:
236240
- config: {get_resource: set_hostname}
237241
- config: {get_resource: included_files}
242+
- config: {get_resource: update_ca_cert}
238243
- config: {get_resource: rhn_register}
239244
- config: {get_resource: set_extra_repos}
240245
- config: {get_resource: set_extra_docker_repos}
@@ -295,9 +300,17 @@ resources:
295300
- path: /root/.ssh/id_rsa.pub
296301
permissions: 0600
297302
content: {get_param: ansible_public_key}
303+
- path: /etc/pki/ca-trust/source/anchors/ca.crt
304+
permissions: 0600
305+
content: {get_param: ca_cert}
298306
ssh_authorized_keys:
299307
- {get_param: ansible_public_key}
300308

309+
# Add CA Cert to trust chain
310+
update_ca_cert:
311+
type: OS::Heat::SoftwareConfig
312+
properties:
313+
config: {get_file: fragments/ca_cert.sh}
301314

302315
# Register the host with RHN for access to software packages
303316
rhn_register:

fragments/ca_cert.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
#
3+
# Register with subscription manager and enable required RPM respositories
4+
#
5+
# ENVVARS:
6+
# CA_CERT - a ca certificate to be added to trust chain
7+
8+
# Exit on command fail
9+
set -eu
10+
set -x
11+
12+
# Return the final non-zero exit code of a failed pipe (or 0 for success)
13+
set -o pipefail
14+
15+
# =============================================================================
16+
# MAIN
17+
# =============================================================================
18+
19+
if [ -f /etc/pki/ca-trust/source/anchors/ca.crt ] ; then
20+
update-ca-trust enable
21+
update-ca-trust extract
22+
else
23+
exit 0
24+
fi

infra.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ parameters:
228228
type: string
229229
hidden: true
230230

231+
ca_cert:
232+
type: string
233+
description: Certificate Authority Certificate to be added to trust chain
234+
231235
resources:
232236

233237
# Create a network connection on the internal communications network
@@ -299,6 +303,7 @@ resources:
299303
parts:
300304
- config: {get_resource: set_hostname}
301305
- config: {get_resource: included_files}
306+
- config: {get_resource: update_ca_cert}
302307
- config: {get_resource: rhn_register}
303308
- config: {get_resource: set_extra_repos}
304309
- config: {get_resource: set_extra_docker_repos}
@@ -347,9 +352,18 @@ resources:
347352
params:
348353
$IFNAME: eth1
349354
template: {get_file: fragments/ifcfg-eth}
355+
- path: /etc/pki/ca-trust/source/anchors/ca.crt
356+
permissions: 0600
357+
content: {get_param: ca_cert}
350358
ssh_authorized_keys:
351359
- {get_param: ansible_public_key}
352360

361+
# Add CA Cert to trust chain
362+
update_ca_cert:
363+
type: OS::Heat::SoftwareConfig
364+
properties:
365+
config: {get_file: fragments/ca_cert.sh}
366+
353367
# Attach to a source of software updates for RHEL
354368
rhn_register:
355369
type: OS::Heat::SoftwareConfig

loadbalancer_dedicated.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ parameters:
169169
type: string
170170
hidden: true
171171

172+
ca_cert:
173+
type: string
174+
description: Certificate Authority Certificate to be added to trust chain
175+
172176
resources:
173177
floating_ip_assoc:
174178
type: OS::Neutron::FloatingIPAssociation
@@ -233,6 +237,7 @@ resources:
233237
parts:
234238
- config: {get_resource: set_hostname}
235239
- config: {get_resource: included_files}
240+
- config: {get_resource: update_ca_cert}
236241
- config: {get_resource: rhn_register}
237242
- config: {get_resource: set_extra_repos}
238243
- config: {get_resource: set_extra_docker_repos}
@@ -278,9 +283,22 @@ resources:
278283
params:
279284
$WC_NOTIFY: { get_attr: ['wait_handle', 'curl_cli'] }
280285
template: {get_file: fragments/common_functions.sh}
286+
- path: /etc/pki/ca-trust/source/anchors/ca.crt
287+
permissions: 0600
288+
content: {get_param: ca_cert}
281289
ssh_authorized_keys:
282290
- {get_param: ansible_public_key}
283291

292+
# Add CA Cert to trust chain
293+
update_ca_cert:
294+
type: OS::Heat::SoftwareConfig
295+
properties:
296+
config:
297+
str_replace:
298+
params:
299+
$CA_CERT: {get_param: ca_cert}
300+
template: {get_file: fragments/ca_cert.sh}
301+
284302
# Connect to a software source for updates on RHEL
285303
rhn_register:
286304
type: OS::Heat::SoftwareConfig

loadbalancer_external.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ parameters:
167167
type: string
168168
hidden: true
169169

170+
ca_cert:
171+
type: string
172+
description: Certificate Authority Certificate to be added to trust chain
173+
170174
outputs:
171175
console_url:
172176
description: URL of the OpenShift web console

loadbalancer_neutron.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ parameters:
160160
type: string
161161
hidden: true
162162

163+
ca_cert:
164+
type: string
165+
description: Certificate Authority Certificate to be added to trust chain
166+
163167
resources:
164168
lb:
165169
type: OS::Neutron::LoadBalancer

loadbalancer_none.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ parameters:
171171
type: string
172172
hidden: true
173173

174+
ca_cert:
175+
type: string
176+
description: Certificate Authority Certificate to be added to trust chain
177+
174178
outputs:
175179
console_url:
176180
description: URL of the OpenShift web console

master.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ parameters:
221221
type: string
222222
hidden: true
223223

224+
ca_cert:
225+
type: string
226+
description: Certificate Authority Certificate to be added to trust chain
227+
224228
resources:
225229

226230
# Create a network connection on the internal communications network
@@ -291,6 +295,7 @@ resources:
291295
parts:
292296
- config: {get_resource: set_hostname}
293297
- config: {get_resource: included_files}
298+
- config: {get_resource: update_ca_cert}
294299
- config: {get_resource: rhn_register}
295300
- config: {get_resource: set_extra_repos}
296301
- config: {get_resource: set_extra_docker_repos}
@@ -339,9 +344,18 @@ resources:
339344
params:
340345
$IFNAME: eth1
341346
template: {get_file: fragments/ifcfg-eth}
347+
- path: /etc/pki/ca-trust/source/anchors/ca.crt
348+
permissions: 0600
349+
content: {get_param: ca_cert}
342350
ssh_authorized_keys:
343351
- {get_param: ansible_public_key}
344352

353+
# Add CA Cert to trust chain
354+
update_ca_cert:
355+
type: OS::Heat::SoftwareConfig
356+
properties:
357+
config: {get_file: fragments/ca_cert.sh}
358+
345359
# Attach to a source of software updates for RHEL
346360
rhn_register:
347361
type: OS::Heat::SoftwareConfig

node.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ parameters:
352352
Automatically scale up/down openshift nodes.
353353
default: false
354354

355+
ca_cert:
356+
type: string
357+
description: Certificate Authority Certificate to be added to trust chain
358+
355359
resources:
356360

357361
# Generate a string to distinguish one node from the others
@@ -402,6 +406,7 @@ resources:
402406
parts:
403407
- config: {get_resource: set_hostname}
404408
- config: {get_resource: included_files}
409+
- config: {get_resource: update_ca_cert}
405410
- config: {get_resource: rhn_register}
406411
- config: {get_resource: set_extra_repos}
407412
- config: {get_resource: set_extra_docker_repos}
@@ -456,9 +461,22 @@ resources:
456461
params:
457462
$IFNAME: eth1
458463
template: {get_file: fragments/ifcfg-eth}
464+
- path: /etc/pki/ca-trust/source/anchors/ca.crt
465+
permissions: 0600
466+
content: {get_param: ca_cert}
459467
ssh_authorized_keys:
460468
- {get_param: ansible_public_key}
461469

470+
# Add CA Cert to trust chain
471+
update_ca_cert:
472+
type: OS::Heat::SoftwareConfig
473+
properties:
474+
config:
475+
str_replace:
476+
params:
477+
$CA_CERT: {get_param: ca_cert}
478+
template: {get_file: fragments/ca_cert.sh}
479+
462480
# Connect to software update source for RHEL
463481
rhn_register:
464482
type: OS::Heat::SoftwareConfig

0 commit comments

Comments
 (0)