Commit Graph

8 Commits

Author SHA1 Message Date
Sean Eagan 58c0df5201 Extract pre-update actions out of tiller handler
This is a pre-requisite for Helm 3 integration, so that these
actions run regardless of whether we are going through the
tiller handler.

Change-Id: I97d7bcc823d11b527fcdaa7967fcab62af1c8161
2021-09-30 17:22:16 -05:00
Roman Gorshunov 243022d16c Fix: Armada Exceptions docs rendering on RTD
Readthedocs failed to render Armada exceptions with error:

> WARNING: autodoc: failed to import exception ... from module
> 'armada'; the following exception was raised: No module named 'armada'

and others.

Trying to add Armada requirements to the installed requirements list,
so that Readthedocs has all modules, including those needed for the
Armada itself.

Cosmetic readability changes:
1. combined all Makefile .PHONY targets into one
2. merged multiple LABEL instructions in Dockerfile into one

Change-Id: I3f88fa3abf66e5d6a2f9e57f6f1514a03a0c5a30
2019-08-27 22:57:52 +02:00
Sean Eagan 2310ddbc2c Remediate releases stuck in non-DEPLOYED statuses
Armada remediates releases stuck in FAILED status, if not protected,
by purging and re-installing them. This implements the same for other
non-DEPLOYED statuses. For these statuses it guards this with a best
effort determination of whether a previous deployment of the release,
either through armada or the helm CLI, is likely still pending based
on whether it was last deployed within the chart's wait timeout. If
it is deemed likely pending an error is raised, however this
condition will eventually expire on future runs allowing for
eventual remediation.

Reasons why a release may get stuck in statuses other than DEPLOYED
or FAILED include:

1. tiller crashed mid-deployment
2. tiller could not reach kubernetes to update the release state
3. running `helm delete <rel>` (without --purge) (DELETED status)

Change-Id: Ia89cd59f056103dde47980a149c07a2984c4bbb4
2019-01-18 23:06:01 +00:00
Sean Eagan 6b96bbf28d Correctly identify latest release
This fixes the following issues with listing releases from tiller,
which could cause Armada to be confused about the state of the
latest release, and do the wrong thing.

- Was not filtering out old releases, so we could find both a
  FAILED and DEPLOYED release for the same chart. When this is the
  case it likely means the FAILED release is the latest, since
  otherwise armada would have purged the release (and all its
  history) upon seeing the FAILED release in a previous run.
  The issue is that after the purge it would try to upgrade
  rather than re-install, since it also sees the old DEPLOYED
  release. Also if a release gets manually fixed (DEPLOYED)
  outside of armada, armada still sees the old FAILED release,
  and will purge the fixed release.
- Was only fetching DEPLOYED and FAILED releases from tiller, so if
  the latest release has another status Armada won't see it at all.

This changes to:

- Fetch releases with all statuses.
- Filter out old releases.
- Raise an error if latest release has status other than DEPLOYED
  or FAILED, since it's not clear what other action to take in
  this scenario.

Change-Id: I84712c1486c19d2bba302bf3420df916265ba70c
2018-10-19 09:14:15 -05:00
Sean Eagan 9fad5cff0a Add chart API to wait on k8s resource types/labels
This adds a `wait.resources` key to chart documents which allows
waiting on a list of k8s type+labels configurations to wait on.
Initially supported types are pods, jobs, deployments, daemonsets, and
statefulsets. The behavior for controller types is similar to that of
`kubectl rollout status`.

If `wait.resources` is omitted, it waits on pods and jobs (if any exist)
as before.

The existing `wait.labels` key still have the same behavior, but if
`wait.resources` is also included, the labels are added to each resource
wait in that array. Thus they serve to specify base labels that apply
to all resources in the release, so as to not have to duplicate them.
This may also be useful later for example to use them as labels to wait
for when deleting a chart.

Controller types additionaly have a `min_ready` field which
represents the minimum amount of pods of the controller which must
be ready in order for the controller to be considered ready. The value
can either be an integer or a percent string e.g. "80%", similar to e.g.
`maxUnavailable` in k8s. Default is "100%".

This also wraps up moving the rest of the wait code into its own module.

Change-Id: If72881af0c74e8f765bbb57ac5ffc8d709cd3c16
2018-10-05 16:48:32 -05:00
Felipe Monteiro 6ab741b6e3 fix: Armada exceptions documentation incorrectly rendering
This patch set changes Armada's exceptions documentation
(contained underneath operators guide) because it isn't rendering
correctly as a list table on RTD (the autoexception information
is missing) [0].

The easy fix is to change the tabularized view (list table)
into basically a series of autoexception classes which sufficiently
captures the level of detail required, anyway.

Note that running `tox -e docs` locally and opening the resulting
index.html page appears to work -- but not when hosted on RTD.

[0] https://airship-armada.readthedocs.io/en/latest/operations/exceptions/guide-exceptions.html

Change-Id: Id7e6730ff1d57e609e8fc4f636645ea8667bd425
2018-09-23 15:32:07 +00:00
Marshall Margenau 6546139155 Implement `protected` parameter
The `protected` parameter will be used to signify that we should
never purge a release in FAILED status. You can specify the
`continue_processing` param to either skip the failed release and
continue on, or to halt armada execution immediately.

- Add protected param to Chart schema and documentation.
- Implement protection logic.
- Moved purging of FAILED releases out of pre-flight and into sync
  for finer control over protected params. This means failed
  releases are now purged one at a time instead of all up front.
- Added purge and protected charts to final client `msg` return.

- Fix: Added missing dry-run protection in tiller delete resources.

Change-Id: Ia893a486d22cc1022b542ab7c22f58af12025523
2018-06-17 20:04:53 -05:00
Felipe Monteiro 085d9887e0 Rename docs to doc to align with OpenStack standard
This patchset updates docs to doc to align with OpenStack
standard. Follow-up patchset will be needed to publish
documentation to OpenStack [0].

TODO: Update Armada documentation job to align with [1].

[0] https://docs.openstack.org/doc-contrib-guide/project-guides.html
[1] http://lists.openstack.org/pipermail/openstack-dev/2018-March/128594.html

Change-Id: I100541611ddfcd5c42f09da631346cb8ef3de5e7
2018-05-17 21:39:01 +00:00