Skip to content

Commit 923bc44

Browse files
committed
Add docs on handling Octavia certs
1 parent 7778a58 commit 923bc44

File tree

1 file changed

+146
-0
lines changed

1 file changed

+146
-0
lines changed

source/operations_and_monitoring.rst

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,152 @@ The images stored locally in the seed host can be seen using ``docker image ls``
269269
Old and redundant images can be identified from their names and tags, and
270270
removed using ``docker image rm``.
271271

272+
Octavia
273+
+++++++
274+
275+
Octavia uses mutual TLS to secure communication between the amphorae and
276+
Octavia services. It uses a private CA to sign both client and server
277+
certificates. We use the kolla-ansible built-in support for generating these
278+
certificates:
279+
280+
.. code-block:: console
281+
282+
kayobe# kayobe kolla ansible run octavia-certificates
283+
284+
This command will output certificates and keys in ``${KOLLA_CONFIG_PATH}/octavia-certificates``
285+
286+
Copy the relevant certificates into your kayobe-config:
287+
288+
.. code-block:: console
289+
290+
kayobe# cd ${KAYOBE_CONFIG_PATH}/environments/$KAYOBE_ENVIRONMENT/kolla/config/octavia
291+
kayobe# cp $KOLLA_CONFIG_PATH/octavia-certificates/client_ca/client_ca.cert.pem .
292+
kayobe# cp $KOLLA_CONFIG_PATH/octavia-certificates/client_ca/client.cert-and-key.pem .
293+
kayobe# cp $KOLLA_CONFIG_PATH/octavia-certificates/client_ca/server_ca.cert.pem .
294+
kayobe# cp $KOLLA_CONFIG_PATH/octavia-certificates/client_ca/server_ca.key.pem .
295+
296+
Encrypt any files containing the keys:
297+
298+
.. code-block:: console
299+
300+
kayobe# ansible-vault encrypt client.cert-and-key.pem --vault-password-file ~/vault
301+
Encryption successful
302+
kayobe# ansible-vault encrypt server_ca.key.pem --vault-password-file ~/vault
303+
Encryption successful
304+
305+
Checking certificate expiry
306+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
307+
308+
.. code-block:: console
309+
310+
kayobe# ansible-vault decrypt client.cert-and-key.pem --vault-password-file ~/vault
311+
Decryption successful
312+
kayobe# openssl x509 -enddate -noout -in client.cert-and-key.pem
313+
notAfter=Aug 12 10:45:35 2022 GMT
314+
315+
Backing up the octavia-certificates directory
316+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
317+
318+
In the root of your kayobe-config checkout:
319+
320+
.. code-block:: console
321+
322+
kayobe# tools/backup-octavia-certificates.sh
323+
324+
This will output an encrypted backup to ``$KAYOBE_CONFIG_PATH/environments/$KAYOBE_ENVIRONMENT/kolla/certificates/octavia-certificates-backup.tar``
325+
Commit this file to store the backup.
326+
327+
Restoring octavia-certificates directory when regenerating certificates
328+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
329+
330+
In the root of your kayobe-config checkout:
331+
332+
.. code-block:: console
333+
334+
kayobe# tools/restore-octavia-certificates.sh
335+
336+
This will use the encrypted backup in ``$KAYOBE_CONFIG_PATH/environments/$KAYOBE_ENVIRONMENT/kolla/certificates/octavia-certificates-backup.tar``
337+
to restore ``${KOLLA_CONFIG_PATH}/octavia-certificates``. This will allow you
338+
to reuse the client CA.
339+
340+
Rotating client.cert-and-key.pem
341+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
342+
343+
This has a life time of 1 year.
344+
345+
1) Follow the steps to restore octavia-certificates so you can reuse the client CA.
346+
2) Make sure your config allows you to regenerate a certificate with the same common name
347+
348+
.. code-block:: console
349+
:caption: $KOLLA_CONFIG_PATH/octavia-certificates/client_ca/index.txt.attr
350+
351+
unique_subject = no
352+
353+
3) Remove the old files relating to the client certificate:
354+
355+
.. code-block:: console
356+
357+
kayobe# rm $KOLLA_CONFIG_PATH/octavia-certificates/client_ca/{client.cert-and-key.pem,client.csr.pem,client.cert.pem}
358+
359+
4) Regenerate the certificates
360+
361+
.. code-block:: console
362+
363+
kayobe# kayobe kolla ansible run octavia-certificates
364+
365+
5) Backup your octavia-certificates directory (see previous section).
366+
367+
6) Copy your new certificate to the correct location:
368+
369+
.. code-block:: console
370+
371+
cd ${KAYOBE_CONFIG_PATH}/environments/$KAYOBE_ENVIRONMENT/kolla/config/octavia
372+
kayobe# cp $KOLLA_CONFIG_PATH/octavia-certificates/client_ca/client_ca.cert.pem .
373+
kayobe# cp $KOLLA_CONFIG_PATH/octavia-certificates/client_ca/client.cert-and-key.pem .
374+
kayobe# ansible-vault encrypt client.cert-and-key.pem --vault-password-file ~/vault
375+
Encryption successful
376+
377+
7) Reconfigure octavia
378+
379+
.. code-block:: console
380+
381+
kayobe# kayobe overcloud service reconfigure -kt octavia
382+
383+
8) Run tempest with the `octavia` test list to check it is working.
384+
385+
9) Commit and push any changes.
386+
387+
Rotating the CAs
388+
~~~~~~~~~~~~~~~~
389+
390+
The CAs have a 10 year lifetime. Simply delete the relevant directory under
391+
``$KOLLA_CONFIG_PATH/octavia-certificates/`` and regenerate it with:
392+
393+
.. code-block:: console
394+
395+
kayobe# kayobe kolla ansible run octavia-certificates
396+
397+
Copy the relevant certificates into your kayobe-config.
398+
399+
.. code-block:: console
400+
401+
kayobe# cd ${KAYOBE_CONFIG_PATH}/environments/$KAYOBE_ENVIRONMENT/kolla/config/octavia
402+
kayobe# cp $KOLLA_CONFIG_PATH/octavia-certificates/client_ca/client_ca.cert.pem .
403+
kayobe# cp $KOLLA_CONFIG_PATH/octavia-certificates/client_ca/client.cert-and-key.pem .
404+
kayobe# cp $KOLLA_CONFIG_PATH/octavia-certificates/client_ca/server_ca.cert.pem .
405+
kayobe# cp $KOLLA_CONFIG_PATH/octavia-certificates/client_ca/server_ca.key.pem .
406+
407+
Encrypt any files containing the keys.
408+
409+
.. code-block:: console
410+
411+
kayobe# ansible-vault encrypt client.cert-and-key.pem --vault-password-file ~/vault
412+
Encryption successful
413+
kayobe# ansible-vault encrypt server_ca.key.pem --vault-password-file ~/vault
414+
Encryption successful
415+
416+
Follow any instructions in the `upstream docs <https://docs.openstack.org/octavia/latest/admin/guides/operator-maintenance.html>`_.
417+
272418
Backup of the OpenStack Control Plane
273419
=====================================
274420

0 commit comments

Comments
 (0)