Ansible deployment of the Kolla containers
Go to file
Mark Goddard d66e95d1d9 Fix keystone fernet key rotation scheduling
Right now every controller rotates fernet keys. This is nice because
should any controller die, we know the remaining ones will rotate the
keys. However, we are currently over-rotating the keys.

When we over rotate keys, we get logs like this:

 This is not a recognized Fernet token <token> TokenNotFound

Most clients can recover and get a new token, but some clients (like
Nova passing tokens to other services) can't do that because it doesn't
have the password to regenerate a new token.

With three controllers, in crontab in keystone-fernet we see the once a day
correctly staggered across the three controllers:

ssh ctrl1 sudo cat /etc/kolla/keystone-fernet/crontab
0 0 * * * /usr/bin/fernet-rotate.sh
ssh ctrl2 sudo cat /etc/kolla/keystone-fernet/crontab
0 8 * * * /usr/bin/fernet-rotate.sh
ssh ctrl3 sudo cat /etc/kolla/keystone-fernet/crontab
0 16 * * * /usr/bin/fernet-rotate.sh

Currently with three controllers we have this keystone config:

[token]
expiration = 86400 (although, keystone default is one hour)
allow_expired_window = 172800 (this is the keystone default)

[fernet_tokens]
max_active_keys = 4

Currently, kolla-ansible configures key rotation according to the following:

   rotation_interval = token_expiration / num_hosts

This means we rotate keys more quickly the more hosts we have, which doesn't
make much sense.

Keystone docs state:

   max_active_keys =
     ((token_expiration + allow_expired_window) / rotation_interval) + 2

For details see:
https://docs.openstack.org/keystone/stein/admin/fernet-token-faq.html

Rotation is based on pushing out a staging key, so should any server
start using that key, other servers will consider that valid. Then each
server in turn starts using the staging key, each in term demoting the
existing primary key to a secondary key. Eventually you prune the
secondary keys when there is no token in the wild that would need to be
decrypted using that key. So this all makes sense.

This change adds new variables for fernet_token_allow_expired_window and
fernet_key_rotation_interval, so that we can correctly calculate the
correct number of active keys. We now set the default rotation interval
so as to minimise the number of active keys to 3 - one primary, one
secondary, one buffer.

This change also fixes the fernet cron job generator, which was broken
in the following cases:

* requesting an interval of more than 1 day resulted in no jobs
* requesting an interval of more than 60 minutes, unless an exact
  multiple of 60 minutes, resulted in no jobs

It should now be possible to request any interval up to a week divided
by the number of hosts.

Change-Id: I10c82dc5f83653beb60ddb86d558c5602153341a
Closes-Bug: #1809469
(cherry picked from commit 6c1442c385)
2019-06-18 19:06:21 +01:00
ansible Fix keystone fernet key rotation scheduling 2019-06-18 19:06:21 +01:00
contrib Update tacker CLI to openstack CLI in tacker demo 2018-07-24 07:02:48 +00:00
deploy-guide/source Remove the deprecated "giturl" option 2018-01-15 03:41:21 +00:00
doc Fix keystone fernet key rotation scheduling 2019-06-18 19:06:21 +01:00
etc/kolla Add support for deploying Monasca Grafana 2019-04-29 13:13:09 +00:00
kolla_ansible Use fernet for barbican crypto key 2018-07-26 22:01:30 +02:00
releasenotes Fix keystone fernet key rotation scheduling 2019-06-18 19:06:21 +01:00
specs Update the database connection for keystone 2018-04-22 23:22:15 +08:00
tests Fix keystone fernet key rotation scheduling 2019-06-18 19:06:21 +01:00
tools Merge "CI Test: Support being source of a Ceph upgrade" into stable/rocky 2019-06-07 08:46:04 +00:00
zuul.d OpenDev Migration Patch 2019-04-19 19:29:08 +00:00
.gitignore gitignore: Update path to vagrant environment dir 2017-12-19 13:26:55 +01:00
.gitreview OpenDev Migration Patch 2019-04-19 19:29:08 +00:00
.testr.conf Merge "Revert "Capture the log in default"" 2016-01-19 15:36:52 +00:00
.yamllint Verify YAML syntax in gates 2018-03-26 17:56:22 +02:00
LICENSE Add ASL license 2014-09-20 17:29:35 -07:00
README.rst Update the links to https 2019-01-14 13:36:55 +00:00
bindep.txt Make Ubuntu gate work 2016-11-03 16:07:47 +00:00
lower-constraints.txt oslo.config>=5.2.0 which is a dependency of kolla-ansible requires rfc3986>=1.2.0 2019-01-22 17:38:32 +08:00
requirements.txt Create /volumes when using external ceph 2019-04-02 10:53:21 +01:00
setup.cfg Delete the unused openrc-example 2018-06-09 02:27:17 -04:00
setup.py Updated from global requirements 2017-03-02 17:44:00 +00:00
test-requirements.txt Remove openstackdocstheme from test-requirements.txt file 2018-06-08 18:29:44 +08:00
tox.ini Fix py35/py36 and k-a-ubuntu-source gate jobs 2019-02-14 11:20:24 +00:00

README.rst

Team and repository tags

image

Kolla-Ansible Overview

The Kolla-Ansible is a deliverable project separated from Kolla project.

Kolla-Ansible deploys OpenStack services and infrastructure components in Docker containers.

Kolla's mission statement is:

To provide production-ready containers and deployment tools for operating
OpenStack clouds.

Kolla is highly opinionated out of the box, but allows for complete customization. This permits operators with little experience to deploy OpenStack quickly and as experience grows modify the OpenStack configuration to suit the operator's exact requirements.

Getting Started

Learn about Kolla-Ansible by reading the documentation online Kolla-Ansible.

Get started by reading the Developer Quickstart.

OpenStack services

Kolla-Ansible deploys containers for the following OpenStack projects:

Infrastructure components

Kolla-Ansible deploys containers for the following infrastructure components:

Directories

  • ansible - Contains Ansible playbooks to deploy OpenStack services and infrastructure components in Docker containers.
  • contrib - Contains demos scenarios for Heat, Magnum and Tacker and a development environment for Vagrant
  • doc - Contains documentation.
  • etc - Contains a reference etc directory structure which requires configuration of a small number of configuration variables to achieve a working All-in-One (AIO) deployment.
  • specs - Contains the Kolla-Ansible communities key arguments about architectural shifts in the code base.
  • tests - Contains functional testing tools.
  • tools - Contains tools for interacting with Kolla-Ansible.

Getting Involved

Need a feature? Find a bug? Let us know! Contributions are much appreciated and should follow the standard Gerrit workflow.

  • We communicate using the #openstack-kolla irc channel.
  • File bugs, blueprints, track releases, etc on Launchpad.
  • Attend weekly meetings.
  • Contribute code.

Contributors

Check out who's contributing code and contributing reviews.

Notices

Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries. Docker, Inc. and other parties may also have trademark rights in other terms used herein.