[v2 docs] Move `upgrade.no_hooks` to `upgrade.options.no_hooks`

This is just a basic Helm CLI option, so this moves it to be alongside
the rest of the upgrade options.

Change-Id: I4cbb4f3bfe60240d793a30f7a7d58705024f633c
This commit is contained in:
Sean Eagan 2019-04-23 13:00:23 -05:00 committed by Drew Walters
parent b881e176f5
commit d47fc0d033
4 changed files with 128 additions and 34 deletions

View File

@ -21,6 +21,7 @@ from armada.exceptions import armada_exceptions
from armada.handlers.chartbuilder import ChartBuilder
from armada.handlers.release_diff import ReleaseDiff
from armada.handlers.chart_delete import ChartDelete
from armada.handlers.schema import get_schema_info
from armada.handlers.test import Test
from armada.handlers.wait import ChartWait
from armada.exceptions import tiller_exceptions
@ -92,8 +93,10 @@ class ChartDeploy(object):
old_values_string = old_release.config.raw
upgrade = chart.get('upgrade', {})
disable_hooks = upgrade.get('no_hooks', False)
options = upgrade.get('options', {})
schema_info = get_schema_info(ch['schema'])
no_hooks_location = upgrade if schema_info.version < 2 else options
disable_hooks = no_hooks_location.get('no_hooks', False)
force = options.get('force', False)
recreate_pods = options.get('recreate_pods', False)

View File

@ -36,6 +36,16 @@ data:
required:
- type
additionalProperties: false
wait_resource_type_config:
properties:
labels:
$ref: '#/definitions/labels'
min_ready:
anyOf:
- type: integer
- type: string
skip_if_none_found:
type: boolean
type: object
properties:
release:
@ -76,20 +86,22 @@ data:
timeout:
type: integer
resources:
type: array
items:
properties:
type:
type: string
labels:
$ref: '#/definitions/labels'
min_ready:
anyOf:
- additionalProperties:
anyOf:
- type: integer
- type: string
required:
- type
additionalProperties: false
- $ref: '#/definitions/wait_resource_type_config'
- type: array
items:
$ref: '#/definitions/wait_resource_type_config'
- type: array
items:
allOf:
- $ref: '#/definitions/wait_resource_type_config'
- properties:
type:
type: string
required:
- type
labels:
$ref: "#/definitions/labels"
# Config for helm's native `--wait` param.
@ -126,8 +138,6 @@ data:
upgrade:
type: object
properties:
no_hooks:
type: boolean
pre:
type: object
additionalProperties: false
@ -141,6 +151,8 @@ data:
type: boolean
recreate_pods:
type: boolean
no_hooks:
type: boolean
additionalProperties: false
additionalProperties: false
required:

View File

@ -48,11 +48,73 @@ Chart
| with ``type: job`` no longer | ``type: job`` and you also want to delete cronjobs, add |
| deletes cronjobs | another item with ``type: cronjob`` and same labels. |
+--------------------------------+------------------------------------------------------------+
| ``upgrade.no_hooks`` moved to | Remove as desired, otherwise move to the new location. |
| ``upgrade.options.no_hooks``, | |
| and now optional | |
+--------------------------------+------------------------------------------------------------+
| ``dependencies``, | Remove as desired. |
| ``upgrade.no_hooks``, | |
| ``source.subpath`` | |
| now optional | |
+--------------------------------+------------------------------------------------------------+
| ``wait`` improvements | See `Wait Improvements`_. |
+--------------------------------+------------------------------------------------------------+
Wait Improvements
^^^^^^^^^^^^^^^^^
The :ref:`v2 wait API <wait_v2>` includes the following changes.
Breaking changes
****************
1. ``wait.resources`` now defaults to all supported resource ``type`` s,
currently ``job``, ``daemonset``, ``statefulset``, ``deployment``, and ``pod``, with
`skip_if_none_found`_ (a new option) set to ``true``. The previous default was
the equivalent of pods with ``skip_if_none_found=false``, and jobs with
``skip_if_none_found=true``.
2. ``type: pod`` waits now exclude pods owned by other resources, such
as controllers, as one should instead wait directly on the controller itself,
which per 1. is now the default.
3. Waits are no longer retried multiple times to attempt to wait for
modifications to pods to quiet down. This crutch was only mildly useful
before, and now even less so due to 1. and 2. above. If the ``min_ready`` for a
controller is achieved, there should be no reason not to move on.
4. ``wait.native.enabled`` is now disabled by default. With the above changes,
this is no longer useful as a backup mechanism. Having both enabled leads to
ambiguity in which wait would fail in each case. More importantly, this must
be disabled in order to use the ``min_ready`` functionality, otherwise tiller
will wait for 100% anyway. So this prevents accidentally leaving it enabled
in that case. Also when the tiller native wait times out, this caused the
release to be marked FAILED by tiller, which caused it to be purged and
re-installed (unless protected), even though the wait criteria may have
eventually succeeded, which is already validated by armada on a retry.
New features
************
Per-resource-type overrides
+++++++++++++++++++++++++++
``wait.resources`` can now be a dict, mapping individual resource types to
wait configurations (or lists thereof), such that one can keep the default
configuration for the other resource types, and also disable a given resource
type, by mapping it to ``false``.
The ability to provide the entire explicit list for ``wait.resources`` remains in
place as well.
skip_if_none_found
++++++++++++++++++
A ``skip_if_none_found`` field is also exposed for items/values in
``wait.resources`` which causes them to be skipped if no matching resources are
found, which is useful for things which may only be dynamically included in the
release depending on configuration. When explicitly overriding ``wait.resources``
items, this defaults to ``false``, as it is assumed the user likely intends for
them to exist in that case.
ChartGroup
----------

View File

@ -113,7 +113,7 @@ Chart
+-----------------+----------+---------------------------------------------------------------------------------------+
| test | object | See Test_. |
+-----------------+----------+---------------------------------------------------------------------------------------+
| upgrade | object | upgrade the chart managed by the armada yaml |
| upgrade | object | See Upgrade_. |
+-----------------+----------+---------------------------------------------------------------------------------------+
| delete | object | See Delete_. |
+-----------------+----------+---------------------------------------------------------------------------------------+
@ -190,14 +190,14 @@ Run helm tests on the chart after install/upgrade.
setting the ``enabled`` key to ``False``.
Test Options
^^^^^^^^^^^^
~~~~~~~~~~~~
Test options to pass through directly to helm.
+-------------+----------+---------------------------------------------------------------+
| keyword | type | action |
+=============+==========+===============================================================+
| cleanup | bool | cleanup test pods after test completion, defaults to false |
| cleanup | bool | Same as Helm CLI. |
+-------------+----------+---------------------------------------------------------------+
.. note::
@ -212,26 +212,43 @@ Test options to pass through directly to helm.
running tests. Similar suggestions have been made for how ``helm test --cleanup`` itself
ought to work (https://github.com/helm/helm/issues/3279).
Upgrade
^^^^^^^
+-------------+----------+---------------------------------------------------------------+
| keyword | type | action |
+=============+==========+===============================================================+
| options | object | See `Upgrade - Options`_. |
+-------------+----------+---------------------------------------------------------------+
| pre | object | See `Upgrade - Pre`_. |
+-------------+----------+---------------------------------------------------------------+
Upgrade - Options
~~~~~~~~~~~~~~~~~
Upgrade options to pass through directly to helm.
+---------------+----------+---------------------------------------------------------------+
| keyword | type | action |
+===============+==========+===============================================================+
| no_hooks | boolean | Same as Helm CLI. |
+---------------+----------+---------------------------------------------------------------+
| force | boolean | Same as Helm CLI. |
+---------------+----------+---------------------------------------------------------------+
| recreate_pods | boolean | Same as Helm CLI. |
+---------------+----------+---------------------------------------------------------------+
Upgrade - Pre
^^^^^^^^^^^^^
~~~~~~~~~~~~~
+-------------+----------+---------------------------------------------------------------+
| keyword | type | action |
+=============+==========+===============================================================+
| pre | object | actions performed prior to updating a release |
| delete | array | List of `Upgrade - Pre - Delete`_. |
+-------------+----------+---------------------------------------------------------------+
Upgrade - Actions
^^^^^^^^^^^^^^^^^
+-------------+----------+---------------------------------------------------------------+
| keyword | type | action |
+=============+==========+===============================================================+
| delete | array | List of `Upgrade - Actions - Delete`_. |
+-------------+----------+---------------------------------------------------------------+
Upgrade - Actions - Delete
^^^^^^^^^^^^^^^^^^^^^^^^^^
Upgrade - Pre - Delete
**********************
+-------------+----------+---------------------------------------------------------------+
| keyword | type | action |
@ -243,7 +260,7 @@ Upgrade - Actions - Delete
+-------------+----------+---------------------------------------------------------------+
Chart Example
^^^^^^^^^^^^^
~~~~~~~~~~~~~
::