Commit Graph

55 Commits (faa13c51adae311e187380972837d81ca60d3e54)

Author SHA1 Message Date
Ruslan Aliev b67242f532 Add possibility to specify poll interval
Currently, there is no way to specify poll interval for
kubernetes-apply phases, however such possibility exists
in cli-utils API and could be helpful for tuning apply
process.

Change-Id: I605767d589920d0f1e10343afd9672c8d615a46a
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-09-13 22:09:16 -05:00
Zuul c8434994bd Merge "Add possibility to specify 0 timeout via CLI options" 2021-07-30 21:57:47 +00:00
Ruslan Aliev ab55bc5e86 Move clustetctl to KRM
Change-Id: I79ccb7b7c92f27cf6fdaaa540d86db80a0a62b41
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #568
2021-07-17 22:06:43 -05:00
Ruslan Aliev 583fda5dfe Add possibility to specify 0 timeout via CLI options
Currently zero timeout won't be applied if specified via CLI
options of commands plan run and plan run. This patch fixes it.

Change-Id: Icad06ae8c71d78dc81821e2c5b0adb486d547fda
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #566
Closes: #566
2021-06-29 01:26:34 -05:00
bijayasharma 622d45f3bd Add flags to airshipctl get-kubeconfig cmd
* This commits add --file and --merge flags to
  airshipctl get-kubeconfig cmd

Change-Id: I919d4f068d3ef9bcda6b3a7c9aeb0826a4e5c0d4
Signed-off-by: bijayasharma <vetbijaya@gmail.com>
Relates-To: #495
Closes: #495
2021-06-23 13:41:14 +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
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
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
Zuul e38f4fbf4c Merge "Use site-wide kubeconfig only on demand" 2021-05-18 19:06:09 +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
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
Zuul 1b74bd49f4 Merge "Add kubeconfig cleanup in KubernetesApply executors" 2021-05-07 21:07:38 +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
Kostiantyn Kalynovskyi c08f4337f7 Add kubeconfig cleanup in KubernetesApply executors
Change-Id: I32c99feb19099a6926b0dadeb0b32aa59dc0c9ca
2021-04-29 22:15:24 +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
Ruslan Aliev dc60b1116c Implement render method for container exec
Currently it returns NotImplemented error, and that's not
correct behavior. Since this kind of executor has the bundle
inside, it should be properly rendered.

Change-Id: I4c4e417b064236130b4349560fa3eb2615a0f824
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-04-04 21:21:35 -05:00
Ruslan Aliev e9041a2a22 Reduce the number of unnecessary document.NewBundleByPath() calls
Since document.NewBundleByPath() is pretty resource and time
consuming call (because it invokes kustomize under the hood),
we should avoid unnecessary calls of this function. There are
lots of the same constructor calls of new bundle from phase
bundle root path, mostly in helper, which slows airshipctl
and makes no sense. This patch fixes this problem by storing
phase root bundle variable in helper, which creates only once
during airshipctl execution.

Change-Id: I6b59d440f7ab7a68dc613091dafcc9e82df10eb7
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #488
2021-03-27 12:58:36 -05:00
Ruslan Aliev 92ce88fc29 Allow relative and ~ path for container mount
This patch allow to specify relative and home (~/) path for container
mounts.src field. In case if specified path is not absolute, it will be
created by following pattern: 'targetPath+mounts.src'; in case if path
contains ~/ - it will be properly expanded (it will allow us to mount
~/.airship working directory).

Change-Id: I878094371a2bc4e48216b1d076e466e3d29a86f6
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #484
Closes: #484
2021-03-25 16:41:30 -05:00
Ruslan Aliev 395aa537ca Don't fail if docEntryPoint isn't defined for Container exec
Input for this executor could be empty, so we have to handle
ErrDocumentEntrypointNotDefined error more intelligently.

Change-Id: I73e0f770e64cead7dbbbce2af2b7a2ebd323b83b
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #485
Closes: #485
2021-03-23 22:04:40 -05:00
Ruslan Aliev 8bed52b057 Refactor phase related errors
* phase related errors were moved to separate package to prevent
   cycling import error;
 * error duplicates were removed;
 * non-related to package errors were moved to appropriate ones.

Change-Id: If6cfb08c48d356c1517a13157a5fe740dc1635a4
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #485
2021-03-23 22:04:28 -05:00
Zuul a39d547981 Merge "Updated executor definition to introduce a status interface" 2021-03-11 21:40:43 +00:00
Kostiantyn Kalynovskyi 6207e2c24d Add multiple kubeconifg sources to ClusterMap
Change ClusterMap API object to support multiple kubeconfig sources
for a cluster. If one kubeconfig source fails, kubeconfig builder
will not fail and move on to the next one. This behaviour will allow
to support cases when ephemeral cluster is not accesible anymore or
when target cluster is not yet accessible.

For more information please read issue #460 in airshipctl github

Relates-To: #460
Related-To: #460

Change-Id: I7cd32f78cd7c4ad8814eac357424c24216f40d76
2021-03-10 18:22:30 +00:00
bijayasharma 044b636a57 Updated executor definition to introduce a status interface
Change-Id: Ib95cb2f6464b2d15ba7378e9b40a13899d273ba3
Signed-off-by: bijayasharma <vetbijaya@gmail.com>
Relates-To: #409
Closes: #409
2021-03-10 13:14:08 +00:00
Zuul ecb2a042dd Merge "Remove isogen executor and related code" 2021-03-09 19:21:45 +00:00
Kostiantyn Kalynovskyi 9578556480 Fix unknown event type message in logs
This commit allows to normalize baremetal host events, so they
appear in logs corretly.

Change-Id: If6fb862d2baef0897a24bf6b3fdfa196f2b1ee8d
2021-03-05 19:01:14 +00:00
Zuul a00fb9f602 Merge "Mount kubeconfig to GenericContainer executor" 2021-03-04 20:59:14 +00:00
bijayasharma 9d4d0cf863 Phase Validation: clusterctl package changes to support Phase Validation sub command
Relates-To: #330

Change-Id: I1b9ece114934a05245898df2088d80fe2f1c69c5
2021-03-02 13:20:45 +00:00
Vladislav Kuzmin 63e6012133 Mount kubeconfig to GenericContainer executor
Change-Id: Ide647fc0cfd9d281d57eeeaf8b3f9c33f59e7fdf
2021-03-02 14:17:20 +04:00
Vladimir Kozhukalov f4001bcffa Remove isogen executor and related code
Isogen executor is not needed any more since there is
 iso build phase plan that runs two phases using generic
 containers.

Relates-To: #440

Change-Id: I3600e82fa1d8a92cdf103d93cd4536bf4a713cca
2021-03-02 08:14:57 +00:00
Niharika Bhavaraju 90c0116b7f Phase Validation: k8s applier package changes to support Phase Validation sub command
Relates-To: #330

Change-Id: I1503bcef1bc9d91d6897065a7c4418c1aa6181b6
2021-02-24 13:35:50 +00:00
Zuul ea055dc87c Merge "Allow container config to be referenced as objects" 2021-02-12 21:06:53 +00:00
Kostiantyn Kalynovskyi efc4399e17 Allow container config to be referenced as objects
Now GenericContainer input config can be referenced as another
object inside the config bundle (with phase and executor objects).

Change-Id: Iff35e0844b1e9ce4beb72d939e229410208dcb16
2021-02-11 00:39:36 +00:00
Zuul de970a8adf Merge "Fixed typos in inventory pkg" 2021-02-11 00:02:51 +00:00
bijayasharma 62272ed900 Added a warning message that cluster api already initialized
* Currently if the cluster init command is run & the cluster-api
  has already been initialized, the command fails.
* So,this commit adds a warning message that cluster-api already initialized.

Signed-off-by: bijayasharma <vetbijaya@gmail.com>
Change-Id: I93cc6b141c15fa4bc5661646ae0cbdf08580cbf9
Relates-To: #450
Closes: #450
2021-02-10 13:05:17 -05:00
bijayasharma c50286d015 Fixed typos in inventory pkg
Signed-off-by: bijayasharma <vetbijaya@gmail.com>
Change-Id: I8da797a6883df63adf6089743faa757d1099ef82
2021-02-10 13:20:50 +00:00
Zuul d0a9adc752 Merge "Implement render method for clusterctl executor" 2021-02-10 04:28:14 +00:00
Zuul bc919145ac Merge "Fix typos in baremetal executor" 2021-02-10 01:58:51 +00:00
Ruslan Aliev 0f44ad9a7c Implement render method for clusterctl executor
Change-Id: If3d66baa8eec27f51705c813f17854ad7ef23a26
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-02-08 23:53:37 -06:00
Kostiantyn Kalynovskyi d78cbe96a1 Extend Generic Container interface
This also moves KRM related logic from executors package to
container package, and creates ClientV1Alpha1 interface that
would allow us to have versioned clients for generic container
executor.

Change-Id: I4b32fd8dd089b9ccea2ed64a805702e6a8705706
2021-02-08 15:50:20 +00:00
Kostiantyn Kalynovskyi 0d13002f9a Fix typos in baremetal executor
Change-Id: I3b9ace228722a357b277927ef2e80a9427f7f687
2021-02-02 19:30:52 +00:00
Kostiantyn Kalynovskyi f0e80cfdc5 Add BaremetalManager executor
This will allow to peform remote BMH operations as a phase

Change-Id: I8e99285e0407d1922312a08ad4f766363f8855d2
2021-02-02 16:42:09 +00:00
Vladislav Kuzmin 3de8b5b2b2 Implement kustomize sink in generic container executor
Sink function allows to write configurations to an external system.

Change-Id: If9c6904239a542ea4c2bef2920965b6d87feb1e6
Relates-To: #202
Relates-To: #369
2021-01-13 17:56:04 +04:00
Ruslan Aliev 5a6f1096eb Groom phase/executors package
All the duplicated methods were removed. Unit tests reorganized.
Test coverage increased.

Change-Id: I0f7bd3eea63c101195ea50c0369e62945d73f297
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #432
2021-01-12 16:31:43 -06:00
Sidney Shiba 4b31d3b936 Bootstrap Ephemeral - Executor methods
This patchset includes the go code for the Executor for the Bootstrap
container/Ephemeral cluster and respective unit test code.

This executor allows to deploy a K8S cluster on a public/private cloud
provider through a dedicated Bootstrap container.

This patchset does not include the manifests for the executor to avoid
too big patchset. It will be included in a different patchset.

Change-Id: I3f9d2ba1bb65b344522e105fd26310af24e3a1b1
2021-01-08 10:34:01 -06:00
Vladislav Kuzmin 53ef504bd6 Refactor generic container executor
Refactor executor functions in go lang style

Change-Id: I81f5ff32e0ac354790c7afbc0bf4db91f58397b4
Relates-To: #202
Relates-To: #369
2021-01-05 19:56:25 +00:00
Zuul b3cc2e4410 Merge "Improve document transformation in container executor" 2020-12-18 12:28:14 +00:00
Anderson, Craig (ca846m) 2daacf5f2a image-builder integration for ISO builds
This introduces airshipctl integration with image-builder [0], which
replaces the existing isogen tool for ephemeral ISO generation.

The airshipctl isogen executor has been updated for building ephemeral
ISOs using the image-builder container. The ability for user-declared
filenames for cloud-init user data and network data was removed, since
the user's only interest is in supplying the relevant overrides, not in
transparent naming coordination with the image-builder container. A new
object is added to the document package to identify the document kind,
label, and key to retrieve data from since this is pattern we will
reuse elsewhere.

Progress flag removed as requsted. Progress is reported directly by the
image-builder container.

Isogen debug flag removed in favor of using log.DebugEnabled()

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

Depends-On: https://review.opendev.org/c/airship/images/+/730777/
Change-Id: I545004feaf2116f8ffb29faf6f7f7f5fcfe24fff
2020-12-17 14:47:53 -08:00
Vladislav Kuzmin 7f040fed97 Improve document transformation in container executor
Start using yaml utils to prepare documents for
function input.

Change-Id: I4adf4781d10ff8c23eea4bec4e85f8c5b4769a8b
Relates-To: #202
Relates-To: #369
2020-12-17 18:32:23 +04:00
Zuul 4e7053bfb5 Merge "Stop clusterctl execution if error is encountered" 2020-12-16 16:52:12 +00:00