Skip to content

Commit ac8d884

Browse files
authored
Merge branch 'stackhpc/2023.1' into feature/2023.1/cis
2 parents fd2efb3 + d0ad042 commit ac8d884

File tree

62 files changed

+26238
-18721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+26238
-18721
lines changed

.github/workflows/stackhpc-all-in-one.yml

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ jobs:
167167
VM_NETWORK: ${{ inputs.vm_network }}
168168
VM_SUBNET: ${{ inputs.vm_subnet }}
169169
VM_INTERFACE: ${{ inputs.vm_interface }}
170-
VM_VOLUME_SIZE: ${{ inputs.upgrade && '45' || '35' }}
170+
VM_VOLUME_SIZE: ${{ inputs.upgrade && '50' || '40' }}
171171
VM_TAGS: '["skc-ci-aio", "PR=${{ github.event.number }}"]'
172172

173173
- name: Terraform Plan
@@ -179,6 +179,7 @@ jobs:
179179
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
180180

181181
- name: Terraform Apply
182+
id: tf_apply
182183
run: |
183184
for attempt in $(seq 5); do
184185
if terraform apply -auto-approve; then
@@ -355,6 +356,7 @@ jobs:
355356
if: inputs.upgrade
356357

357358
- name: Tempest tests
359+
id: tempest
358360
run: |
359361
mkdir -p tempest-artifacts
360362
docker run -t --rm \
@@ -366,16 +368,55 @@ jobs:
366368
env:
367369
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
368370

371+
- name: StackHPC OpenStack tests
372+
id: stackhpc-openstack-tests
373+
continue-on-error: true
374+
run: |
375+
mkdir -p sot-results
376+
docker run -t --rm \
377+
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
378+
-v $(pwd)/sot-results:/stack/sot-results \
379+
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
380+
$KAYOBE_IMAGE \
381+
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/playbook-run.sh '$KAYOBE_CONFIG_PATH/ansible/stackhpc-openstack-tests.yml'
382+
env:
383+
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
384+
385+
- name: Collect diagnostic information
386+
id: diagnostics
387+
run: |
388+
mkdir -p diagnostics
389+
sudo -E docker run -t --rm \
390+
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
391+
-v $(pwd)/diagnostics:/stack/diagnostics \
392+
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
393+
$KAYOBE_IMAGE \
394+
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/playbook-run.sh '$KAYOBE_CONFIG_PATH/ansible/diagnostics.yml'
395+
env:
396+
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
397+
if: ${{ !cancelled() && steps.tf_apply.outcome == 'success' }}
398+
369399
- name: Upload test result artifacts
370400
uses: actions/upload-artifact@v4
371401
with:
372-
name: tempest-results-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ inputs.neutron_plugin }}${{ inputs.upgrade && '-upgrade' }}
373-
path: tempest-artifacts/*
402+
name: test-results-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ inputs.neutron_plugin }}${{ inputs.upgrade && '-upgrade' || '' }}
403+
path: |
404+
diagnostics/
405+
tempest-artifacts/
406+
sot-results/
407+
if: ${{ !cancelled() && (steps.tempest.outcome == 'success' || steps.stackhpc-openstack-tests.outcome == 'success' || steps.diagnostics.outcome == 'success') }}
374408

375409
- name: Fail if any Tempest tests failed
376410
run: |
377411
test $(wc -l < tempest-artifacts/failed-tests) -lt 1
378412
413+
- name: Fail if any StackHPC OpenStack tests failed
414+
run: |
415+
echo "Some StackHPC OpenStack tests failed."
416+
echo "See HTML results artifact (sot-results) for details."
417+
exit 1
418+
if: steps.stackhpc-openstack-tests.outcome == 'failure'
419+
379420
- name: Destroy
380421
run: terraform destroy -auto-approve
381422
working-directory: ${{ github.workspace }}/terraform/aio

.github/workflows/stackhpc-container-image-build.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@ on:
3434
required: false
3535
default: true
3636
push-dirty:
37-
description: Push scanned images that have vulnerabilities?
37+
description: Push scanned images that have critical vulnerabilities?
3838
type: boolean
3939
required: false
40-
# NOTE(Alex-Welsh): This default should be flipped once we resolve existing failures
41-
default: true
40+
default: false
4241

4342
env:
4443
ANSIBLE_FORCE_COLOR: True
@@ -136,6 +135,10 @@ jobs:
136135
run: |
137136
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b /usr/local/bin v0.49.0
138137
138+
- name: Install yq
139+
run: |
140+
curl -sL https://github.com/mikefarah/yq/releases/download/v4.42.1/yq_linux_amd64.tar.gz | tar xz && sudo mv yq_linux_amd64 /usr/bin/yq
141+
139142
- name: Install Kayobe
140143
run: |
141144
mkdir -p venvs &&
@@ -176,7 +179,7 @@ jobs:
176179
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
177180

178181
- name: Create build logs output directory
179-
run: mkdir image-build-logs
182+
run: mkdir image-build-logs
180183

181184
- name: Build kolla overcloud images
182185
id: build_overcloud_images
@@ -235,9 +238,16 @@ jobs:
235238
run: cp image-build-logs/image-scan-output/clean-images.txt image-build-logs/push-attempt-images.txt
236239
if: inputs.push
237240

241+
# NOTE(seunghun1ee): This always appends dirty images with CVEs severity lower than critical.
242+
# This should be reverted when it's decided to filter high level CVEs as well.
238243
- name: Append dirty images to push list
239244
run: |
240245
cat image-build-logs/image-scan-output/dirty-images.txt >> image-build-logs/push-attempt-images.txt
246+
if: ${{ inputs.push }}
247+
248+
- name: Append images with critical vulnerabilities to push list
249+
run: |
250+
cat image-build-logs/image-scan-output/critical-images.txt >> image-build-logs/push-attempt-images.txt
241251
if: ${{ inputs.push && inputs.push-dirty }}
242252

243253
- name: Push images
@@ -249,7 +259,7 @@ jobs:
249259
250260
while read -r image; do
251261
# Retries!
252-
for i in {1..5}; do
262+
for i in {1..5}; do
253263
if docker push $image; then
254264
echo "Pushed $image"
255265
break
@@ -283,8 +293,15 @@ jobs:
283293
run: if [ $(wc -l < image-build-logs/push-failed-images.txt) -gt 0 ]; then cat image-build-logs/push-failed-images.txt && exit 1; fi
284294
if: ${{ !cancelled() }}
285295

286-
- name: Fail when images failed scanning
287-
run: if [ $(wc -l < image-build-logs/dirty-images.txt) -gt 0 ]; then cat image-build-logs/dirty-images.txt && exit 1; fi
296+
# NOTE(seunghun1ee): Currently we want to mark the job fail only when critical CVEs are detected.
297+
# This can be used again instead of "Fail when critical vulnerabilities are found" when it's
298+
# decided to fail the job on detecting high CVEs as well.
299+
# - name: Fail when images failed scanning
300+
# run: if [ $(wc -l < image-build-logs/image-scan-output/dirty-images.txt) -gt 0 ]; then cat image-build-logs/image-scan-output/dirty-images.txt && exit 1; fi
301+
# if: ${{ !inputs.push-dirty && !cancelled() }}
302+
303+
- name: Fail when critical vulnerabilities are found
304+
run: if [ $(wc -l < image-build-logs/image-scan-output/critical-images.txt) -gt 0 ]; then cat image-build-logs/image-scan-output/critical-images.txt && exit 1; fi
288305
if: ${{ !inputs.push-dirty && !cancelled() }}
289306

290307
# NOTE(mgoddard): Trigger another CI workflow in the

doc/source/configuration/cephadm.rst

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
================
2-
Cephadm & Kayobe
3-
================
1+
====
2+
Ceph
3+
====
44

55
This section describes how to use the Cephadm integration included in StackHPC
6-
Kayobe configuration since Xena to deploy Ceph.
6+
Kayobe configuration to deploy Ceph.
77

88
The Cephadm integration takes the form of custom playbooks that wrap
99
around the Ansible `stackhpc.cephadm collection
@@ -19,10 +19,10 @@ create or modify Ceph cluster deployments. Supported features are:
1919
Resources
2020
=========
2121

22-
- https://docs.ceph.com/en/pacific/cephadm/index.html
23-
- https://docs.ceph.com/en/pacific/
2422
- https://docs.ceph.com/en/quincy/cephadm/index.html
2523
- https://docs.ceph.com/en/quincy/
24+
- https://docs.ceph.com/en/reef/cephadm/index.html
25+
- https://docs.ceph.com/en/reef/
2626
- https://github.com/stackhpc/ansible-collection-cephadm
2727

2828
Configuration
@@ -107,7 +107,7 @@ OSD specification
107107
~~~~~~~~~~~~~~~~~
108108

109109
The following example is a basic OSD spec that adds OSDs for all
110-
available disks:
110+
available disks with encryption at rest:
111111

112112
.. code:: yaml
113113
@@ -118,9 +118,10 @@ available disks:
118118
host_pattern: "*"
119119
data_devices:
120120
all: true
121+
encrypted: true
121122
122123
More information about OSD service placement is available
123-
`here <https://docs.ceph.com/en/pacific/cephadm/services/osd/#advanced-osd-service-specifications>`__.
124+
`here <https://docs.ceph.com/en/quincy/cephadm/services/osd/#advanced-osd-service-specifications>`__.
124125

125126
Container image
126127
~~~~~~~~~~~~~~~
@@ -264,6 +265,24 @@ post-deployment configuration is applied. Commands in the
264265
``cephadm_commands_post`` list are executed after the rest of the Ceph
265266
post-deployment configuration is applied.
266267

268+
Messenger v2 encryption in transit
269+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
270+
271+
Messenger v2 is the default on-wire protocol since the Nautilus release. It
272+
supports `encryption of data in transit
273+
<https://docs.ceph.com/en/quincy/rados/configuration/msgr2/#connection-mode-configuration-options>`_,
274+
but this is not used by default. It may be enabled as follows:
275+
276+
.. code:: yaml
277+
278+
# A list of commands to pass to cephadm shell -- ceph. See stackhpc.cephadm.commands
279+
# for format.
280+
cephadm_commands_pre:
281+
# Enable messenger v2 encryption in transit.
282+
- "config set global ms_cluster_mode secure"
283+
- "config set global ms_service_mode secure"
284+
- "config set global ms_client_mode secure"
285+
267286
Manila & CephFS
268287
~~~~~~~~~~~~~~~
269288

doc/source/configuration/vault.rst

Lines changed: 54 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -84,47 +84,6 @@ Setup Vault on the seed node
8484
ansible-vault encrypt --vault-password-file ~/vault.pass $KAYOBE_CONFIG_PATH/environments/$KAYOBE_ENVIRONMENT/vault/seed-vault-keys.json
8585
ansible-vault encrypt --vault-password-file ~/vault.pass $KAYOBE_CONFIG_PATH/environments/$KAYOBE_ENVIRONMENT/vault/overcloud.key
8686
87-
Setup HAProxy config for Vault
88-
------------------------------
89-
90-
1. Create the HAProxy config to reverse proxy the Vault HA container
91-
92-
Set the vault_front to the external VIP address or internal VIP address depending on the installation. Set the vault_back to the IPs of the control nodes.
93-
94-
Set the following in etc/kayobe/kolla/config/haproxy/services.d/vault.cfg or if environments are being used etc/kayobe/environments/$KAYOBE_ENVIRONMENT/kolla/config/haproxy/services.d/vault.cfg
95-
96-
.. code-block::
97-
98-
# Delete "verify none" if not using self-signed/unknown issuer
99-
{% raw %}
100-
frontend vault_front
101-
mode tcp
102-
option tcplog
103-
bind {{ kolla_internal_vip_address }}:8200
104-
default_backend vault_back
105-
106-
backend vault_back
107-
mode tcp
108-
option httpchk GET /v1/sys/health
109-
# https://www.vaultproject.io/api-docs/system/health
110-
# 200: initialized, unsealed, and active
111-
# 501: not initialised (required for bootstrapping)
112-
# 503: sealed (required for bootstrapping)
113-
http-check expect rstatus (200|501|503)
114-
115-
{% for host in groups['control'] %}
116-
{% set host_name = hostvars[host].ansible_facts.hostname %}
117-
{% set host_ip = 'api' | kolla_address(host) %}
118-
server {{ host_name }} {{ host_ip }}:8200 check check-ssl verify none inter 2000 rise 2 fall 5
119-
{% endfor %}
120-
{% endraw %}
121-
122-
2. Deploy HAProxy with the new Vault service configuration:
123-
124-
.. code-block::
125-
126-
kayobe overcloud service deploy --skip-tags os_capacity -kt haproxy
127-
12887
Setup Vault HA on the overcloud hosts
12988
-------------------------------------
13089

@@ -215,6 +174,55 @@ Create the backend TLS and RabbitMQ TLS certificates
215174
216175
ansible-vault encrypt --vault-password-file ~/vault.pass $KAYOBE_CONFIG_PATH/environments/$KAYOBE_ENVIRONMENT/kolla/certificates/<controller>-key.pem
217176
177+
.. _vault-haproxy:
178+
179+
HAProxy integration
180+
===================
181+
182+
It is possible to expose the overcloud Vault service via the Kolla Ansible HAProxy load balancer.
183+
This provides a single highly available API endpoint, as well as monitoring of the Vault backends when combined with Prometheus.
184+
HAProxy integration is no longer required for generating OpenStack control plane certificates, making it possible to deploy Vault and generate certificates before any containers have been deployed by Kolla Ansible.
185+
186+
1. Create the HAProxy config to reverse proxy the Vault HA container
187+
188+
Set the vault_front to the external VIP address or internal VIP address depending on the installation. Set the vault_back to the IPs of the control nodes.
189+
190+
Set the following in etc/kayobe/kolla/config/haproxy/services.d/vault.cfg or if environments are being used etc/kayobe/environments/$KAYOBE_ENVIRONMENT/kolla/config/haproxy/services.d/vault.cfg
191+
192+
.. code-block::
193+
194+
# Delete "verify none" if not using self-signed/unknown issuer
195+
{% raw %}
196+
frontend vault_front
197+
mode tcp
198+
option tcplog
199+
bind {{ kolla_internal_vip_address }}:8200
200+
default_backend vault_back
201+
202+
backend vault_back
203+
mode tcp
204+
option httpchk GET /v1/sys/health
205+
# https://www.vaultproject.io/api-docs/system/health
206+
# 200: initialized, unsealed, and active
207+
# 429: standby
208+
http-check expect rstatus (200|429)
209+
210+
{% for host in groups['control'] %}
211+
{% set host_name = hostvars[host].ansible_facts.hostname %}
212+
{% set host_ip = 'api' | kolla_address(host) %}
213+
server {{ host_name }} {{ host_ip }}:8200 check check-ssl verify none inter 2000 rise 2 fall 5
214+
{% endfor %}
215+
{% endraw %}
216+
217+
2. If HAProxy has not yet been deployed, continue to :ref:`certificates deployment <vault-certificates>`.
218+
If HAProxy has been deployed, it may be redeployed with the new Vault service configuration:
219+
220+
.. code-block::
221+
222+
kayobe overcloud service deploy -kt haproxy
223+
224+
.. _vault-certificates:
225+
218226
Certificates deployment
219227
=======================
220228

@@ -231,6 +239,7 @@ Enable the required TLS variables in kayobe and kolla
231239
232240
# Whether TLS is enabled for the external API endpoints. Default is 'no'.
233241
kolla_enable_tls_external: yes
242+
kolla_public_openrc_cacert: "{{ '/etc/pki/tls/certs/ca-bundle.crt' if os_distribution in ['centos', 'rocky'] else '/etc/ssl/certs/ca-certificates.crt' }}"
234243
235244
See :ref:`tempest-cacert` for information on adding CA certificates to the trust store when running Tempest.
236245

@@ -240,6 +249,7 @@ Enable the required TLS variables in kayobe and kolla
240249
241250
# Whether TLS is enabled for the internal API endpoints. Default is 'no'.
242251
kolla_enable_tls_internal: yes
252+
kolla_admin_openrc_cacert: "{{ '/etc/pki/tls/certs/ca-bundle.crt' if os_distribution in ['centos', 'rocky'] else '/etc/ssl/certs/ca-certificates.crt' }}"
243253
244254
See :ref:`os-capacity` for information on adding CA certificates to the trust store when deploying the OpenStack Capacity exporter.
245255

@@ -291,6 +301,8 @@ Enable the required TLS variables in kayobe and kolla
291301
Barbican integration
292302
====================
293303

304+
Barbican integration depends on :ref:`HAProxy integration <vault-haproxy>`.
305+
294306
Enable Barbican in kayobe
295307
-------------------------
296308

@@ -341,7 +353,7 @@ Configure Barbican
341353
enabled_secretstore_plugins=vault_plugin
342354
343355
[vault_plugin]
344-
vault_url = https://{{ kolla_internal_vip_address }}:8200
356+
vault_url = https://{{ kolla_internal_fqdn }}:8200
345357
use_ssl = True
346358
{% raw %}
347359
ssl_ca_crt_file = {{ openstack_cacert }}

0 commit comments

Comments
 (0)