859 Commits

Author SHA1 Message Date
Kostiantyn Kalynovskyi
a121a88a97 Add airship container cleanup
Closes: #546

Change-Id: I623694327bd6cc7dea616c109a7dcb7d97420be9
2021-06-22 14:49:53 +00:00
Zuul
8d882fcc85 Merge "Enable tolerance to apply timeout errors" 2021-06-19 03:15:30 +00:00
Ruslan Aliev
5fc39a8b54 Enable tolerance to apply timeout errors
This commit allows to tolerate up to three timeout errors that
came from poll requests before interruption of apply process.

Change-Id: I6cb95eba908e62ee44be3338c263b20c7dffc34b
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #579
Closes: #579
2021-06-18 14:17:17 -05:00
Ruslan Aliev
035e371a5e Allow to setup timeout for get kubeconfig request
This PS replaces cluster-api implementation with our own since
it allows to configure timeout.

Change-Id: I5cbba24dd7c6a279fcd2325e904ac7d18348eabf
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #548
Closes: #548
2021-06-13 17:29:10 -05:00
Ruslan Aliev
bc9f97ff2e Embed validation cfg into phase and plan definition
* validation config is now part of airshipctl api
 * additional CRD locations can be only kustomize entrypoints
 * changed mechanism to call document-validation executor to allow
   to pass validation config from phase or plan
 * kubeval version pinned to the latest 0.16.1
 * default k8s version to validate against uplifted to 1.18.6
 * default URL with k8s schemas changed to more updated and reliable

Change-Id: Ifb24be224d5f0860d323a671b94e28a86debc65b
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #563
2021-06-11 15:37:38 +00:00
Zuul
575023cfcf Merge "Update metadata.yaml to kubernetes style" 2021-06-09 18:06:36 +00:00
Zuul
f7f5cc3513 Merge "Update ephemeral-bmc-secret to use base64 data" 2021-06-09 18:04:13 +00:00
Zuul
55aea51f70 Merge "Move CAPI resources to target-infra namespace" 2021-06-09 17:23:36 +00:00
Graham Steffaniak
97377236ec Update ephemeral-bmc-secret to use base64 data
Transform stringData into base64-enc data manually so the
annotation won't remain from the stringData.

Closes: #424
Change-Id: I4bcfd57601d9199307c749e8e6deb5ee5445d821
2021-06-07 15:17:17 -05:00
siraj.yasin
f45ece8294 Update metadata.yaml to kubernetes style
* Define GVK for metadata.yaml
* Added supoorting type and registered the kind 'AirshipMetadata' to
  runtime scheme
* Used document object to read metadata instead of reading it as config

Relates-To: #530

Change-Id: I748cd0921ba7bb04ca6fb2999294776e6803ed3e
2021-06-04 03:34:31 +00:00
Matthew Fuller
75429db630 Move CAPI resources to target-infra namespace
Moves CAPI resources in ephemeral cluster from the 'default'
namespace to a new 'target-infra' namespace.

Closes: #551
Change-Id: I419a71baa8e05e7b57b38234d15b955b36951b40
2021-06-03 23:40:00 +00:00
Vladislav Kuzmin
16da661959 Switch gating deployment to phase plan
Add all needed phases for deployment to deploy-gating
phase plan.

Relates-To: #517
Change-Id: I9d5af24b0877d90ab1ba24b31cca6ec7127e0f1d
2021-06-03 19:41:05 +04:00
Ruslan Aliev
0c4d8b80bf Allow to configure timeout for k8s client
It would be helpful to have a possibility to configure Timeout
field, as well as others allowed.

Change-Id: I1e0e895b7ca6a17e86a6ad36f405e2538775cbbb
Closes: #553
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-05-28 00:28:30 -05:00
Ruslan Aliev
16e5e9f06a Use proper object to create cmdutil factory
MatchVersionFalgs object should be used instead as cli-utils
library suggests, particularly it will allow us to avoid the
issue when airshipctl apply process stuck after Unknown state.

Change-Id: Id6d6ca69a67cb4a500b150a00df538ffffa11eb3
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #552
2021-05-27 12:24:39 -05:00
Zuul
cc5221972a Merge "Update Validation Logic for Clusterctl Move" 2021-05-26 04:03:58 +00:00
Zuul
1f5dbf8645 Merge "Implement render method for container exec" 2021-05-24 21:32:08 +00:00
Zuul
dc8c241c31 Merge "Show the context name and current context using get-context command" 2021-05-24 21:31:52 +00:00
Matthew Fuller
b69a641940 Add ntp to network catalogue
Adds an ntp object to the NetworkCatalogue schema
and populates default ntp servers into the networking
base catalogue. Also adds replacement rules in:

* function/k8scontrol/replacements
* function/workers-capm3/replacements

Change-Id: I5dedda563c8825c283e7ba846bedb0b282459d41
2021-05-19 15:13:34 +00:00
Ratnopam Chakrabarti
1cd6c2842a Update Validation Logic for Clusterctl Move
Removed the namespace condition check from the validation of 'Move'.
This is to allow validation of docker and cloud provider test site
manifests that do not use namespace.

Relates-To: #503
Change-Id: I39544ba9c9c13ff5a6519b7afd8844629e60087e
2021-05-19 11:09:25 -04:00
chumkid
02d2fc7e4a Show the context name and current context using get-context command
The command "airshipctl config get-context" will display the name of the contexts as well as the current context name.

Relates-To: #475
Change-Id: I8234d74f6b98869e27e4974a54b68230d8be8565
2021-05-19 13:42:22 +05:30
Zuul
e38f4fbf4c Merge "Use site-wide kubeconfig only on demand" 2021-05-18 19:06:09 +00:00
Zuul
a9dcdaaf47 Merge "Use bundle mock for k8s applier tests" 2021-05-18 17:49:49 +00:00
Zuul
e12b1e2fa6 Merge "Invoke validation container directly via ClientV1 package" 2021-05-18 02:10:56 +00:00
Kostiantyn Kalynovskyi
bbd9b018dd Use site-wide kubeconfig only on demand
This patchset introduces new field to Phase.Config API object

SiteWideKubeconfig - if set to true, the phase will have access
to all kubeconfigs for each cluster defined in ClusterMap.

By default only kubeconfig of the cluster specified in
Phase.Metadata.ClusterName will be available to the phase executor.

This approach will speed up the deployment process because arishipctl
will not have to look for multiple kubeconfigs when running each phase

Closes: #547

Change-Id: Ic92027ba88d3ce8cb769c254968530037540b8fd
2021-05-17 23:30:21 +00:00
Ruslan Aliev
7fd779ae0b Invoke validation container directly via ClientV1 package
This patch will allow us to bypass unnecassary logic in generic
container executor (e.g. mounting kubeconfig).

Change-Id: I526940e8f01c66f7609355a4ef750b38f1d9a323
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-05-13 13:12:18 -05:00
Vladimir Kozhukalov
ebb03b504b Use bundle mock for k8s applier tests
Change-Id: Id00e5c493bf9cca2c03ea30f51c1ed978df74c15
Relates-To: #464
Relates-To: #465
2021-05-13 11:13:13 +03:00
Pallav Gupta
7cfffde323
Added missing properties to catalogues
* added bond_xmit_hash_policy property to network catalogues
* added sourceRef chart property to versions catalogues
* corrected code typos

Change-Id: Idda5e7628df3631688b84e4d62749ab173c9933f
2021-05-12 22:55:46 -05:00
Zuul
ed271774f6 Merge "Add Plan Status() to ifc.plan interface" 2021-05-11 09:37:16 +00:00
Zuul
ab98b63bf3 Merge "Refactor config get-manifest command" 2021-05-11 09:10:36 +00:00
Zuul
5dcc769243 Merge "Generate Catalogues schema using kubebuilder" 2021-05-10 23:32:22 +00:00
Zuul
1b74bd49f4 Merge "Add kubeconfig cleanup in KubernetesApply executors" 2021-05-07 21:07:38 +00:00
Zuul
ffe47fcaff Merge "Close events channel on executor level" 2021-05-07 19:57:02 +00:00
siraj.yasin
935b26af52 Generate Catalogues schema using kubebuilder
* Generate VersionsCatalogue and NetworkCatalogue schemas using kubebuilder
* Schema for CRDs can be generated with this command
    => make manifests

Change-Id: I61695d523ee0c08739f15a47b2cf8653d925b108
Closes: #532
2021-05-07 17:23:58 +00:00
Zuul
1f52d46374 Merge "Change default manifest target path" 2021-05-06 21:47:50 +00:00
Kostiantyn Kalynovskyi
dbe05585d3 Close events channel on executor level
This will fix a bug, when go routine wasn't finished when program has
exited. Results of the bug was that not all defered statemnets were
executed, which lead to temp kubeconfig not being cleaned up

Relates-To: #541
Closes: #541

Change-Id: If314886d9bed04b2c0f8a5006bc058395f4fdf7a
2021-05-03 15:26:17 +00:00
Vladimir Kozhukalov
639e53f9a0 Change default manifest target path
Now the target path for the default manifest is
  $HOME/.airship/default. This is reasonable default
  location.

  The target path is a mandatory field in the
  definition of a manifest. If a user wants
  to use her current working directory as a location
  the manifests, then it must be properly configured
  in the $HOME/.airship/config.

Relates-To: #416
Relates-To: #417
Change-Id: I96601803939df5c7369d1580842dfabeb19aa017
2021-05-03 12:08:52 +00:00
Vladimir Kozhukalov
fc572453a5 Remove unnecessary code
- Use opendev.org/airship/airshipctl/pkg/document.Selector
   instead of sigs.k8s.io/kustomize/api/types.Selector
   which makes selectors conversion code unnecessary

 - Use document.GetSecretDataKey instead of
   document.DecodeSecretData which removes code duplicates

Change-Id: Ie2c6b8d8222b7acb1b657f8d786a8c3a06b0c6fd
2021-05-03 14:34:57 +03:00
Zuul
09f380126f Merge "[#394] plan list -o yaml changes" 2021-04-30 01:15:24 +00:00
Kostiantyn Kalynovskyi
c08f4337f7 Add kubeconfig cleanup in KubernetesApply executors
Change-Id: I32c99feb19099a6926b0dadeb0b32aa59dc0c9ca
2021-04-29 22:15:24 +00:00
Zuul
7b851d9af2 Merge "Add kyaml Label selector to document plugins" 2021-04-29 22:02:56 +00:00
Niharika Bhavaraju
5085f22c56 [#394] plan list -o yaml changes
Added yaml output flag to show plan list in yaml format

Relates-To: #394
Co-authored By: Niharika Bhavaraju<niha.twinkle@gmail.com>
Change-Id: I8bed077573eb79783cfc77e4ebf82c819f41d125
2021-04-29 18:10:57 +05:30
Kostiantyn Kalynovskyi
b75a06fcb6 Add kyaml Label selector to document plugins
This is needed to be able to select documents inside toolbox
and maybe other KRM functions in the future

Relates-To: #517
Change-Id: I0c0c3552d98bcbe1ea02fb7b582d844a3d8f1c16
2021-04-28 20:22:45 +00:00
Alexey Odinokov
10b0385691 Extended replacement plugin with Targets field
The user can use either `target` or `targets` that is list of
several `target` objects.

Change-Id: I38e457842e1250a2d048f93ba2aac9258758d163
2021-04-28 16:36:19 +00:00
Zuul
6543f63ebf Merge "Add validation phases" 2021-04-28 03:26:02 +00:00
Zuul
afed13d166 Merge "Add util functions to set/unset env variables" 2021-04-28 03:02:01 +00:00
Ruslan Aliev
31995eaf9d Add validation phases
This patch introduces ability to validate phases using kubeval.
Appropriate functionality was embedded into phase/plan validate
command.

Change-Id: I1e1ccae2b7e4948bdc97a199c96c07a3eb7292b2
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #503
Closes: #2
Closes: #19
2021-04-22 11:37:12 -05:00
Ruslan Aliev
3c53dcabdf Add util functions to set/unset env variables
Proposed util functions can set variable amount of env vars at once,
covered with unit tests and handles possible errors in more convenient
way.

Change-Id: Ibd31f528fba1b10be49d1e8cc5e5f29c6b3d902a
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-04-22 11:13:49 -05:00
bijayasharma
e9179ff018 Fix typos in various files
Signed-off-by: bijayasharma <vetbijaya@gmail.com>
Change-Id: Ibe0066e74497c3caecc50e1187abd0bde7955b04
2021-04-21 17:32:31 +00:00
Zuul
1fd133329c Merge "Do not pass phase helper to executor initializers" 2021-04-20 17:40:58 +00:00
Vladimir Kozhukalov
1b960c129d Do not pass phase helper to executor initializers
Phase helper provides plenty of useful methods for
 a phase client. But these methods are not used by
 phase executor initializers except for getting some
 configuration values. So, it is better to provide
 initializers with necessary values instead of passing
 them the phase helper.

Change-Id: I8c596455e30444570a86efad73d792af0ca83a33
Relates-To: #464
Relates-To: #465
2021-04-20 10:00:47 +03:00