Commit Graph

41 Commits

Author SHA1 Message Date
Ruslan Aliev d9e2248172 Add configurable support of armada-operator for armada-api
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Change-Id: I76fb41062d152bf360a85d781c19ab5b204769b8
2024-02-12 11:09:18 -06:00
Sean Eagan a5730f8db8 Remove Tiller
For now we leave the tiller status enpdpoint, until
Shipyard has had a release to stop depending on it [0].

[0]: https://review.opendev.org/c/airship/shipyard/+/802718

Signed-off-by: Sean Eagan <seaneagan1@gmail.com>
Change-Id: If8a02d7118f6840fdbbe088b4086aee9a18ababb
2021-10-05 02:41:32 +00:00
Sean Eagan 68747d0815 Use helm 3 CLI as backend
Helm 3 breaking changes (likely non-exhaustive):

- crd-install hook removed and replaced with crds directory in
  chart where all CRDs defined in it will be installed before
  any rendering of the chart
- test-failure hook annotation value removed, and test-success
  deprecated. Use test instead
- `--force` no longer handles recreating resources which
  cannot be updated due to e.g. immutability [0]
- `--recreate-pods` removed, use declarative approach instead [1]

[0]: https://github.com/helm/helm/issues/7082
[1]: https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments

Signed-off-by: Sean Eagan <seaneagan1@gmail.com>
Change-Id: I20ff40ba55197de3d37e5fd647e7d2524a53248f
2021-10-04 21:40:26 -05:00
Drew Walters 7bf1423752 Add documentation to docs.airshipit.org
This change adds publishing to docs.airshipit.org and updates the theme
to match the other Airship projects on the site. This change also
updates orphaned links and removes the Read the Docs jobs.

The documentation can be found at docs.airshipit.org/armada when this
change merges.

Change-Id: I9641753f6084f911e3286c623d0c2de7b3f6040a
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-08-03 10:33:13 +00:00
Drew Walters df97ff59a6 cli: Remove dry-run flag
Armada's dry-run option is incomplete, no longer maintained, and offers
little value for the complexity required to maintain it.

This commit is the second in a series of changes to remove the dry-run
feature. Specifically, this change removes the flag as an option for the
CLI.

Story: 2005121

Change-Id: If0b512dcf5520e8a53521fbb5e4e83e06984c889
Signed-off-by: Drew Walters <andrew.walters@att.com>
2019-09-05 16:29:04 +00:00
Sean Eagan 0721ed43aa Implement Prometheus metric integration
This implements Prometheus metric integration, including metric
definition, collection, and exportation.

End user documentation for supported metric data and exportation
interface is included.

Change-Id: Ia0837f28073d6cd8e0220ac84cdd261b32704ae4
2019-08-15 16:12:17 +00:00
HUGHES, ALEXANDER (ah8742) b787c418e3 Standardize Armada code with YAPF
From recently merged document updates in [0] there is a desire to
standardize the Airship project python codebase.  This is the effort
to do so for the Armada project.

[0] https://review.opendev.org/#/c/671291/

Change-Id: I4fe916d6e330618ea3a1fccfa4bdfdfabb9ffcb2
2019-07-31 10:16:15 -05:00
Michael Beaver 48920224cc Support in Armada for locking Tiller
This creates a new mechanism in Armada to enable functions to only be
run once across multiple instances of Armada working with the same
Kubernetes cluster. This is accomplished by utilizing custom resources
via the Kubernetes API.

This also introduces new config defaults that can be used to configure
the lock timeout, expiration, and update interval.

Some notes on how the lock works:
    * Functions to be locked can add the new decorator
        * The optional name parameter can be used to create multiple
          types of locks which can coexist
    * If the lock is unable to be acquired before the timeout a new
      exception is raised
    * The lock is updated regularly while the decorated function is
      still running
    * If a lock already exists it will only be overwritten if the
      duration since its last update is longer than the expiration time

For now this locking method is being used for components that require
write access to Tiller so that simultaneous write operations are
avoided.

Change-Id: Iee07da9a233ee2e2a54c6bc4881185388b377c05
2019-03-22 13:56:50 -05:00
Michael Beaver dd062424bb Normalize assignment of Tiller defaults
The Tiller handler class already handles the default assignment of
Tiller host, port, and namespace. This change removes other locations
that are creating additional default values to avoid confusion.

Change-Id: If03150075281dd8b6362e817af075d5cd321aa77
2019-03-11 12:42:00 -05:00
Zuul 24867f34db Merge "Refactor tiller commands to handle methods" 2019-03-04 22:39:16 +00:00
Michael Beaver b458c3f675 Refactor tiller commands to handle methods
This is a refactor to any methods in the api and cli to move tiller
operations to a separate handler function to make them uniform
with the rest of the code

Change-Id: Iddd45f9f979307f54ad5bd54c3ee005547dd0909
2019-02-21 12:22:32 -06:00
Shoaib Nasir 7fb3b8d9ca Add support in Armada CLI to pass user bearer tokens to tiller
Added a new option --bearer-token TEXT in the Armada CLI to allow
the users or applications to pass kubernetes-api bearertokens via
tiller to the kubernetes cluster. This is to allow armada to interact
with a kubernetes cluster that has been configured with an external
Auth-Backend like Openstack-keystone or OpenId Connect.

Bearer Tokens are Auth tokens issued by the identity backends
such as keystone which represent a users authorized access.
For better understanding of bearer tokens, an example case
of how they works can be found here
https://kubernetes.io/docs/reference/access-authn-authz/authentication/#putting-a-bearer-token-in-a-request
https://docs.docker.com/registry/spec/auth/token/

Change-Id: I03623c7d3b58eda421a0660da8ec3ac2e86915f0
Signed-off-by: Shoaib Nasir <shoaib.nasir@windriver.com>
2019-02-01 15:33:18 -05:00
Sean Eagan 7af22df7dc Implement tiller gRPC channel clean up
We have seen issues with dangling threads in Armada. This is likely due to
a bug [0] in the version of gRPC that we were pinned to.

This patchset:

- moves us to the latest versions of the gRPC python libraries which add
  a new `channel.close()` method to cleanup channels.
- implements the python context manager api in the tiller handler
- uses the context manager api to explicitly scope tiller channel creation
  and cleanup to each Armada API and CLI call.

This also fixes a couples issues with error handling introduced in [1].

[0]: https://github.com/grpc/grpc/issues/14338
[1]: https://review.openstack.org/#/c/610384

Change-Id: I2577a20fc76c397aa33157dc12a0e1d36f49733e
2018-11-12 13:32:52 -06: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
Aaron Sheffield 5165457d5c Updating readthedocs to airship-armada
- Changed armada-helm to airship-armada in readthedocs URLs.

Change-Id: I32d8c5feadf7512fdccb7738880c20490eb928dd
2018-08-14 09:47:28 -05:00
Marshall Margenau f235512d57 Adding yapf config, plus formatted code.
- Adding yapf diff to pep8 target
- Adding yapf tox target to do actual format

** The rest of this PS contains formatted code only, no other changes

Change-Id: Idfef60f53565add2d0cf65bb8e5b91072cf0aded
2018-06-22 14:56:04 -05: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
Marshall Margenau 52bf21989f Fix release name bug
The release name was being treated as multiple different values to
mean the same thing, when paired with the 'release_prefix'.  This
commit addresses the bug, changing all instances to use the
'release' value instead of 'chart_name' or others.

Note: This is an impacting change, in the sense that it will
cause more reliable behavior in Armada's Apply processing which
could have actual impact while upgrading components installed with
a previous version of Armada.  Previuosly undeleted FAILED releases
may now be deleted, and armada test and delete actions may now
run as expected where they didn't run before.

Change-Id: I9893e506274e974cdc8826b1812becf9b89a0ab6
2018-06-15 11:21:38 -05:00
DaeSeong Kim caeb4b623a Fix to pass a manifest file to the armada server
This PS changes the 'apply' cli to generate documents object from
a manifest file and pass it to the armada server.

Change-Id: I19241e2aa0b2c82dfbc043ba8ad8e0482922ff5c
2018-06-12 00:53:03 -07:00
Marshall Margenau dc508d5012 fix(timeouts): Address timeout handling issues
- fixing wait handling in multiple areas
      -- wait for deleted pods before continuing Apply update
      -- cleaning up and delineating wait for charts vs chartgroups
      -- timeout exceptions to stop execution
    - api/cli 'timeout' param now applies to all Charts
    - api/cli 'wait' param now applies to all Charts
    - update some docs
    - several TODOs to be addressed in future PS

Closes #199

Change-Id: I5a697508ce6027e9182f3f1f61757319a3ed3593
2018-05-01 08:45:56 -05:00
Marshall Margenau 60b8a37f47 bug(deleted jobs) Armada deleting jobs during upgrade
- Additional logging to try to expose bug around deleted jobs
  during an upgrade.
- Cleaner chart diff logging.

Change-Id: I5edfa1857aec417203e73565a39082328e3b677b
2018-04-13 00:30:21 -04:00
Marshall Margenau (mm8789) efd42dfab2 bug(chartbuilder): uncaught exceptions on bad manifests
Armada was able to throw exceptions all the way up to invocation. To address:
- remove 'supermutes dotify', which was throwing exceptions
- refactor chartbuilder after removing dotify
- rework some helm wait/timeout logic, exposed during bug squash
- rename some variables to make their function more clear

Note: This has potentially breaking changes to existing charts, in the sense
    that documents previously validated (improperly) may now give errors.

Change-Id: I9a6c99aa8ba3d666405e0ccf49a847fd01807b69
2018-03-29 15:15:00 -04:00
Marshall Margenau 964aed2973 feat(validation) Validation messaging
- Validation messaging to match UCP convention
- Adding some missing fields to Chart validation schema
- Minor update: Adding debug logging to each CLI call
- Fixing some typos and exception messages

Change-Id: I7dc1165432c8b3d138cabe6fd5f3a6e1878810ae
2018-03-15 21:19:43 -04:00
Felipe Monteiro afc39b6b62 Docs: Fix Armada apply --set flag documentation
This PS updates the Armada apply --set flag documentation to
be in line with the actual implementation. Each override
must be of the form:

  manifest:simple-armada:release_name="wordpress"

Or:

  manifest:simple-armada:chart_goups="foo","bar"

This PS also adds a few more unit tests for Override handler.

Change-Id: Ie280752ceee75a9a13d1ffafb40589c294407b46
2018-02-17 03:29:42 -05:00
Mark Burnett e0b04e829b Fix: Issue where Armada hangs waiting for pods
This also hopefully provides better logging when waiting for pods.

Closes #194

Change-Id: I3704ff004c35c8ecf90555d16e42f15d24284492
2018-02-15 16:02:21 -06:00
Marshall Margenau e1b64d200b style(armada): quality of life and cleanup
- adding .editorconfig file
- minor cleanup in various files related to .editorconfig
- typos, whitespace, etc.
- other general housekeeping items on the codebase

Change-Id: I104f8dcb06aafb180da12f7ee4c0ded41fc07b9d
2018-02-12 10:27:11 -05:00
Roadrunner2058 ded826d3d1 feat(tiller): adding namespace flag
Adding tiller-namespace (tn) flag to allow for setting specific tiller namespace

Updated:
- Armada API
- Test API
- Tiller API
- Armada handler
- Tiller handler
- cli/apply
- cli/test
- cli/tiller

Change-Id: I3a18d6ec2ce2f771c9349d6b337537f193f6c73d
2018-01-30 17:25:03 +00:00
Felipe Monteiro 093b5d2296 bug(manifest): Allow specific manifest to be specified
This PS allows users to specify the manifest file to use
by the Armada handler by introducing a new flag called
`target_manifest`. This flag was added to the API and
CLI.

A foundation of unit tests for the manifest handler
is included in this PS. Most of the coverage is aimed
at checking the various success and failure cases
surrounding the new target_manifest feature.

Also updates documentation to convey information about
the new flag and clean up some documentation formatting
inconsistencies and typos.

Change-Id: I1d5a3ecc1e99b6479438d0ee5490610178be34fe
2018-01-25 16:29:18 -05:00
Steve Wilkerson 22771fe45c Fix: Address typos and error in Armada output
This fixes typos in the Armada output. It also fixes an error in
which the output for building dependencies was referencing a
releases's dependencies for the release name instead of the actual
release

Change-Id: Ieb30c112b838c0fb22d4af4e18ddb8c182b98fdb
2018-01-19 17:22:24 -06:00
Roadrunner2058 d383e772fd feat(yaml): Support document references
This allows the user to apply and/or validate a manifest using
either a filepath (as before) or URL.

Addition by sh8121att:

- Create a general document resolver class to handle local paths
  and URIs
- Allow multiple filenames and combine them into a single document
  set
- Change API to allow for passing document reference URIs to be
  resolved server-side rather
- Update validation API to conform to UCP specification
- Dockerfile updates to speed up build
- Fix unit tests

Closes #96

Change-Id: I5a57779f10d1b63ffc161a14afec851a34ae9efe
2018-01-08 13:39:26 -06:00
gardlt 7b26e59422 feat(cli): using-click-framework
- using click framework
- added api client
- allow interactions between code and service endpoints
- documention on the command line
- updated gitignore

Change-Id: Ibe359025f5b35606d876c29fa88e04048f276cc8
2017-11-02 20:59:57 +00:00
drewwalters96 be8e86351f feat(manifest): ability to override manifest value
- Add --set flag to override manifest values from CLI
- Add --values flag to override manifest values from values file
- Add support to override manifests values with API values option

Closes #146

Change-Id: Iefa14e4d3005aab3ee803ffb65dfe1a867507c0e
2017-11-02 00:03:41 +00:00
Pete Birley 746cbd0bd8 Fix(linting): Make Armada pep8 compliant
This patch set makes Armada pep8 compliant. Note the hapi/** is
autogenerated and therefore should be excluded from linting.

Change-Id: I123eefb543f9bd9cf0bc6bd98ed95646d8d72cc3
2017-09-29 11:46:58 -04:00
Mark Burnett 721b6de6bf [feat] Add tiller-host and -port options to apply
This allows the use of a standalone tiller service.
2017-07-26 08:52:30 -05:00
Tim Heyer 5e580ee3cb Fix chart cleanup bug
-chart cleanup was never refactored for new yaml format
-fix chart cleanup syntax
-add simple.yaml for quick tests
-fix chart cleanup cli flag
2017-07-19 13:57:00 -05:00
Tim Heyer 701ac2fa8f Allow Armada to clone OpenStack infra repos
-No longer attempts to ping repo
-Move all source locating (git or local) to preflight
-Only unique repos are cloned now
-Catches any source/url errors in preflight and raises exception
2017-07-14 09:19:42 -05:00
drewwalters96 928c5f81da [Feat] Add support for Oslo logging configuration
- Adds Oslo logging libraries
- Enables logging configuration with a config file
- Enables debug logging with --trace flag
- Supports Docker logs
- Adds logging for tiller
2017-06-27 16:04:30 -05:00
Tim Heyer a22d2d0bb0 Implement native tiller timeout support
-Update tiller.py and armada.py to support native tiller timeout
-Update documentation with the new yaml timeout keyword
-Update tiller version to 2.4.2
-Create tests for timeout ability, as well as structure for further test development
-Fix gRPC message size bug
2017-06-27 15:46:30 -05:00
Tim Heyer 9ed13f388e Implement wait for timeout feature and unit test
-Wait for all charts to deploy before exiting
-Add wait flag and custom timeout flag
2017-06-22 16:02:25 -05:00
gardlt bea6bd7212 [bug] pre-post-not-check-correctly
* updated pre and post checks
2017-06-20 13:04:11 -05:00
gardlt 68d95bdcc5 [feature] restructure-clean-up-project
* updating file-structure
* update docker file
* update develop docs
* update api and cmd
2017-06-12 09:06:17 -05:00