Commit Graph

335 Commits

Author SHA1 Message Date
Zuul
0ee6063173 Merge "Implement Security Context for Nova" 2019-06-04 21:16:34 +00:00
pd2839
9b42e8a1c0 Implement Security Context for Nova
Implement container security context for the following Nova resources:
 - Nova server deployment

Change-Id: I02743cff46d9a043ccb029547c819fafd9da3611
2019-06-03 12:31:18 -05:00
Gage Hugo
976cab856c Create separate users for helm test
Currently each service uses the same name for their helm test user,
"test". While this works when services are ran sequentially, when
multiple services are deployed and tested at the same time, it can
lead to a race condition where one service deletes the user before
the other is done testing, causing a failure.

This change makes it so that each service defines its own test user
in the form of [service]-test.

Change-Id: Idd7ad3bef78a039f23fb0dd79391e3588e94b73c
2019-06-03 11:26:18 -05:00
Zuul
c8a012c477 Merge "fix wrong mount key for scheduler and consoleauth" 2019-05-30 13:28:41 +00:00
Zuul
f8adab245b Merge "Point to OSH-images images" 2019-05-18 19:12:58 +00:00
JohnHaan
8157acc618 fix wrong mount key for scheduler and consoleauth
nova-scheduler and consoleauth define wrong
name for value of volume mount.

Change-Id: I398596fa65b15cae35e5df5a23bafd8e8db077a2
2019-05-17 16:35:05 +09:00
Jean-Philippe Evrard
1d335146fa Point to OSH-images images
We now have a process for OSH-images image building,
using Zuul, so we should point the images by default to those
images, instead of pointing to stale images.

Without this, the osh-images build process is completely not
in use, and updating the osh-images process or patching its
code has no impact on OSH.

This should fix it.

Change-Id: I672b8755bf9e182b15eff067479b662529a13477
2019-05-13 10:58:02 +02:00
Roy Tang (rt7380)
5df6fa3789 Expose Anti-Affinity Weight Setting.
Add weight default setting to anti-affinity.

Depends-on: Id8eb303674764ef8b0664f62040723aaf77e0a54
Change-Id: I09f96522cddf3a77dae73daca4557877eda5df50
2019-05-10 22:05:24 -05:00
Zuul
02af9df330 Merge "Use nova's ping method to find out if the service is alive" 2019-05-08 00:37:34 +00:00
Jiří Suchomel
baf5356a4f Use nova's ping method to find out if the service is alive
Currently there is fake rpc call "pod_health_probe_method_ignore_errors"
that is passed to the service, just to find out if it is responding. Because
such method does not exist, it is needed to catch and handle the exception
that is inevitably thrown by the service.

While this is technically working correctly, the exceptions pollute the
log files and make it harder for user to see possible real errors.

This is how the error looks like:

ERROR oslo_messaging.rpc.server [-] Exception during message handling: oslo_messaging.rpc.dispatcher.UnsupportedVersion: Endpoint does not support RPC version 1.0. Attempted method: pod_health_probe_method_ignore_errors
ERROR oslo_messaging.rpc.server Traceback (most recent call last):
ERROR oslo_messaging.rpc.server   File "/var/lib/openstack/lib/python3.6/site-packages/oslo_messaging/rpc/server.py", line 163, in _process_incoming
ERROR oslo_messaging.rpc.server     res = self.dispatcher.dispatch(message)
ERROR oslo_messaging.rpc.server   File "/var/lib/openstack/lib/python3.6/site-packages/oslo_messaging/rpc/dispatcher.py", line 276, in dispatch
ERROR oslo_messaging.rpc.server     raise UnsupportedVersion(version, method=method)
ERROR oslo_messaging.rpc.server oslo_messaging.rpc.dispatcher.UnsupportedVersion: Endpoint does not support RPC version 1.0. Attempted method: pod_health_probe_method_ignore_errors

This situation is new since https://review.openstack.org/#/c/639711/
which (correctly) increased the default level of logging. Before 639711
error messages from oslo (both real and ones that could be ignored) were not
present in nova logs at all.

Fortunatelly, nova's BaseAPI class provides 'ping' method that is can
be used for this basic purpose by all nova components.

Change-Id: I0062e74bed399206becb8d9e00f9ec805da864a3
2019-05-02 10:26:47 +02:00
Zuul
7f95467e3d Merge "Replace git.openstack.org URLs with opendev.org URLs" 2019-05-01 16:11:28 +00:00
Zuul
778f13f568 Merge "Start nova sshd container only if enabled" 2019-05-01 15:09:37 +00:00
Zuul
5361c3282a Merge "Add OpenSUSE Leap15 testing" 2019-04-26 16:44:16 +00:00
caoyuan
cb77d3adff Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I9a7bcee8727cb127d57ccb4dce1183895a4130cd
2019-04-25 00:37:57 +08:00
Zuul
22289a945c Merge "OSH: Add emptydirs for tmp" 2019-04-20 15:27:24 +00:00
Pete Birley
623c131292 OSH: Add emptydirs for tmp
This PS adds emptydirs backing the /tmp directory in pods, which
is required in most cases for full operation when using a read only
filesystem backing the container.

Additionally some yaml indent issues are resolved.

Change-Id: I9df8f70e913b911ff755600fa2f669d9c5dcb928
Signed-off-by: Pete Birley <pete@port.direct>
2019-04-20 08:55:44 -05:00
hagun.kim
360ee8255e Fix novnc init asset copy options
When novnc pod is re-run because of host reboot and so on,

novnc pod has existing volume /tmp/usr/share, which has 0444 permissions.

So init container occurs an error while it tries to copy asset files.

cp: cannot create regular file '/tmp/usr/share/novnc/index.html': Permission denied

With -f option, the init container can copy without errors.

Change-Id: I56d928b7f4a30a6be29b47560357a3b4f5eec764
Signed-off-by: hagun.kim <hagun.kim@samsung.com>
2019-04-19 16:48:50 +09:00
Zuul
3dfb927c2b Merge "Add an option to the health probe to test all pids" 2019-04-18 06:17:03 +00:00
Zuul
9928f5c819 Merge "Allow more generic overrides for nova placement-api" 2019-04-17 05:48:43 +00:00
Jean-Philippe Evrard
a828d38316 Add OpenSUSE Leap15 testing
There is currently no testing of the Leap 15 images in OSH.

This addresses it by:
- Using the values_overrides folder according to the multi-os
  spec, creating value override files there for changes that
  needs to happen on Leap 15 images.
- Point to the right images using the previously created folder,
  to allow using those in CI easily.
- Change CI to use previously created overrides.

Depends-On: https://review.openstack.org/#/c/651501
Change-Id: I520d3676195c62b253a19397c86b0d0fbabee710
2019-04-15 11:15:35 +02:00
Zuul
55b0f8aa0f Merge "Enable audit pipeline for nova" 2019-04-13 01:33:47 +00:00
Itxaka
6d7a909447 Allow more generic overrides for nova placement-api
With this patch we allow for a more easy way of overriding some of
the values that may be used in other distros while maintainting the
default values if those values are not overriden

The following values are introduced to be overriden:

conf:
  security:
  software:
    apache2:
      conf_dir:
      site_dir:
      mods_dir
      binary:
      extra_flags:
      a2enmod:
      a2dismod:

On which:
 * conf_dir: directory where to drop the config files for apache vhosts
 * site_dir: directory where to drop the enabled virtualhosts
 * mods_dir: directory where to drop any mod configuration
 * binary: the binary to use for launching apache
 * extra_flags: any flags that will be passed to the apache binary call
 * a2enmod: mods to enable
 * a2dismod: mods to disable
 * security: security configuration for apache

Notice that if there is no overrides given, it should not affect anything
and the templates will not be changed as the default values are set
to what they used to be

Change-Id: I4fcfde78c5c8fa65956aeae55108ffa1f10e6972
2019-04-12 14:03:36 +02:00
Zuul
3d681fe7bb Merge "Fix volumemounts indent issue" 2019-04-12 00:14:27 +00:00
Gage Hugo
9049ac752a Enable audit pipeline for nova
This change adds the keystonemiddleware audit paste filter[0]
and enables it for the nova-api services.

This provides the ability to audit API requests for nova.

[0] https://docs.openstack.org/keystonemiddleware/latest/audit.html

Change-Id: Ic6df044d83f4dee581c9cc0405f61d926e45bcab
2019-04-11 13:29:33 -05:00
Zuul
d544a556db Merge "Add nonvoting apparmor check job to openstack-helm" 2019-04-11 15:39:29 +00:00
Itxaka
715f4bcfff Fix volumemounts indent issue
Using {{- if for the volume mounts caused them to be added inline with
the previous line.

Removing the - from the if expression makes them be properly aligned on
the next line

Change-Id: Ia5e28366fb1f2ae7420b7f5217c10cbb94bc48ab
2019-04-10 11:56:26 +02:00
Gerry Kopec
52f8415deb Start nova sshd container only if enabled
Only start the sshd container of nova-compute pod if the capability is
enabled.  Defaults to off to allow cases where nova docker image does
not have ssh packages to run cleanly.

Story: 2003463
Task: 30441
Change-Id: I3acf5b654ecda23a93f6c28e865e1bbee14370aa
Signed-off-by: Gerry Kopec <Gerry.Kopec@windriver.com>
2019-04-10 00:36:07 -04:00
Gerry Kopec
5a7c6581ad Fix ssh config in nova to support cold migrations
- Fix .ssh/config file mapping
- Move private key from nova-compute-ssh container to nova-compute
  container.
- Map private and public keys to configmap-ssh which will default to
  the appropriate file permissions.
- Add additional config to /etc/ssh/sshd_config to allow passwordless
  root logins over appropriate subnet passed in from overrides.
- Remove chmods from sshd bash script as they are failing.

Depends on helm-toolkit supporting multiple containers per daemonset
pod.

Story: 2003463
Task: 24723
Change-Id: Idd2e802c293f1e14991ee787ade9a4936fb373ff
Signed-off-by: Gerry Kopec <Gerry.Kopec@windriver.com>
2019-04-09 22:24:46 +00:00
Steve Wilkerson
0abf9d2b20 Add nonvoting apparmor check job to openstack-helm
This adds a nonvoting apparmor check job to openstack-helm, which
allows for the removal of default apparmor profiles from the nova
chart. This job also includes overrides for using the default
docker apparmor profile for the neutron chart

Change-Id: I8f407f24b7f10c5d7cf10f21f73671f7e6c72767
2019-04-07 06:42:42 +00:00
Itxaka
114ff4eeba Add missing dependencies for spiceproxy in values
without the dependencies in the values.yaml, the role and rolebinding will
not be created by helm-toolkit as it uses those to create and generate the
role/rolebinding for the accounts

Change-Id: I711d5fc4a2a376a29daf526fc420790ea9cacf25
2019-04-04 21:49:53 +02:00
Itxaka
6c71637222 change the nova cache to dogpile.cache.memcached
Currently there are issues with using the memcache_pool backend as
the memcache driver for nova under python3[0][1] which doesnt seem
like they have a quick fix or something that is backportable to
rocky

This moves the default cache from oslo_cache.memcache_pool to
dogpile.cache.memcached so we can move forward with python3
enabled images.

[0] https://bugs.launchpad.net/cloud-archive/+bug/1812672
[1] https://bugs.launchpad.net/oslo.cache/+bug/1812935

Change-Id: I65a4770c374357a8e1c80d904bcd4af36217448f
2019-04-04 12:06:33 +00:00
Pete Birley
a71116c43d Nova: make rabbitmq queues ha
This PS tells nova to make rabbitmq queues ha when available.

Change-Id: I965d18ea5d5cdf5ab54bb33c6a46b4a92e039c5e
Signed-off-by: Pete Birley <pete@port.direct>
2019-03-29 20:18:03 +00:00
Itxaka
931e4eba54 Add an option to the health probe to test all pids
On some services it looks like the parent pid does not connect to
rabbitmq and its the children the ones that do instead, for example
in nova-scheduler from rocky version onwards.

The current health check only checks for the main parent pid to see
if it has an active connection to the rabbitmq port.

This patch adds a flag to allow the health probe to check all processes
for the mysql/rabbit connection instead of skipping any children process.

It also enables it by default for nova-scheduler as it wont affect older versions
than only run 1 process, but will work on later versions where
the main process forks.

Change-Id: I9677fd2aff11b563ab18059927ca12d5ace107ce
2019-03-20 18:14:34 +01:00
Itxaka
d4e882b04a Fix nova probes under python3
Under python3 an Exception no longer has the message attribute,
instead you can just str the exception to get the error message

Change-Id: Ibf88ae6b73f3bafcc2b99bb01e31bf8c25021e47
2019-03-20 13:18:33 +01:00
Zuul
87d3a2f63f Merge "Added volume related keys to pod mounts to ease the overriding" 2019-03-15 17:53:54 +00:00
Zuul
b1ecd6ab6b Merge "Add default-docker (enforce) AppArmor profile to nova" 2019-03-15 17:12:32 +00:00
Zuul
9e21287dd3 Merge "[nova] Do not throw out stdout of nova-manage --version" 2019-03-15 16:40:51 +00:00
Jiří Suchomel
a2a5dda47c Added volume related keys to pod mounts to ease the overriding
If user wants to add an extra volumeMounts/volume to a pod,
amd uses override values e.g. like this

pod:
  mounts:
    nova_placement:
      init_container: null
      nova_placement:
        volumeMounts:
          - name: nova-etc
          ...

helm template parser complains with

Warning: The destination item 'nova_placement' is a table and ignoring the source 'nova_placement' as it has a non-table value of: <nil>

So when we create empty values for such keys in values.yaml, the source
will be present and warning does not need to be shown.

Change-Id: Ib8dc53c3a54e12014025de8fafe16fbe9721c0da
2019-03-15 16:29:19 +00:00
Jiří Suchomel
f33c07b8fb [nova] Do not throw out stdout of nova-manage --version
"nova-manage --version" used to print to stderr, but
at least since Rocky it prints to stdout

Change-Id: I48e46612e17556babc35263355c6749c70fd8711
2019-03-14 12:05:24 +01:00
Hyunsun Moon
4fa1f8e800 [nova] Mount ceph-keyring volume when needed
Change-Id: I7370db4c9177976f90176c027f4d65a3fe5b5649
2019-03-13 07:55:31 +00:00
Zuul
00fff1d274 Merge "Health probe for Nova components" 2019-03-11 15:39:55 +00:00
Hemachandra Reddy
49b58b7e7d Health probe for Nova components
Health probe for Nova pods is used for both liveness
and readiness probe.

nova-compute, nova-conductor, nova-consoleauth and nova-scheduler:
Check if the rpc socket status on the nova pods to rabbitmq and
database are in established state.
sends an RPC call with a non-existence method to component's queue.
Probe is success if agent returns with NoSuchMethod error.
If agent is not reachable or fails to respond in time,
returns failure to probe.

novnc/spice proxy: uses Kubernetes tcp probe on corresponding ports
they expose.
Added code to catch nova config file not present exception.

Change-Id: Ib8e4b93486588320fd2d562c3bc90b65844e52e5
2019-03-06 19:34:49 +00:00
Zuul
1ad5467252 Merge "Increase default logging" 2019-03-06 04:09:58 +00:00
Jagan Kavva
a32b05bfab Add default-docker (enforce) AppArmor profile to nova
Change-Id: I5a60efd133c156ce2ecac31d22e94b25e4e837bf
2019-02-28 14:35:33 -06:00
Jean-Philippe Evrard
5890ebf4f8 Increase default logging
The current helm chart defaults drops logs of any warnings
(and above) for any logger outside of the namespace
of the deployed chart.

This is a problem, as logging could reveal important information for
operators. While this could be done with a value override, there
is no reason to hide warning, errors, or critical information that
are happening in the cycle of the operation of the software
deployed with the helm charts. For example, nothing would get
logged in oslo_service, which is a very important part of running
OpenStack.

This fixes it by logging to stdout all the warnings (and above)
for OpenStack apps.

Change-Id: I16f77f4cc64caf21b21c8519e6da34eaf5d31498
2019-02-28 09:53:01 +00:00
Zuul
66ba0be81c Merge "Explicitly set datefmt for logging" 2019-02-27 01:31:09 +00:00
Pavlo Shchelokovskyy
55645c7e73 Explicitly set datefmt for logging
the defaults in Python [0] and oslo.log [1] are such that when using
separate config file for logging configuration (log-config-append)
the log fomat of dates containes miliseconds twice (as in sec,ms.ms)
which is exactly what is currently seen in logs of OpenStack services
deployed by openstack-helm.

When not provided with datefmt log formatter option, Python effectively
uses '%Y-%m-%d %H:%M:%S,%f' [0] as a default time formatting string to
render `%(asctime)s`, but the defaults in oslo.log add another `.%f`
to it [1].

Since `log-date-format` oslo.log option has no effect when using
log-config-append, we need to explicitly set date format to avoid double
miliseconds rendering in date of log entries.

[0] 6ee41793d2/Lib/logging/__init__.py (L427-L428)
[1] http://git.openstack.org/cgit/openstack/oslo.log/tree/oslo_log/_options.py?id=7c5f8362b26313217b6c248e77be3dc8e2ef74a5#n148

Change-Id: I47aa7ce96770d94b905b56d6fe4abad428f01047
2019-02-21 08:28:35 +00:00
Dmitrii Kabanov
34a092a7f4 Add startingDeadlineSeconds field to cronJobs
This patch set adds "startingDeadlineSeconds" field to cronJobs.
When the field is not set, the controller counts how many missed
jobs occured from the last scheduled time till now. And if it happends
more than 100 time the job will not be scheduled. To avoid this
the "startingDeadlineSeconds" field should be set to sufficient period
of time. In this case the controller counts how many missed jobs occured
during this period of time. The value of the field should be less than
time (in seconds) needed for running >100 jobs (according to schedule).

Change-Id: I3bf7c7077b55ca5a3421052bd0b59b70c9bbcf24
2019-02-20 04:11:05 +00:00
Steve Wilkerson
f4c01d2461 Add release-uuid annotation to pod spec
This adds the release-uuid annotation to the pod spec for all
replication controller templates in the openstack-helm charts

Change-Id: I0159f2741c27277fd173208e7169ff657bb33e57
2019-02-12 12:31:59 -06:00
Pete Birley
65df9acaf8 Nova: Move ceph config to remain on host
Change-Id: I786f9fec553eb8b65faa5b8b022d6c971f7dfba1
Signed-off-by: Pete Birley <pete@port.direct>
2019-02-08 16:02:13 -06:00