The KRM based k8s applier solves multiple design problems
which were introduced in previous airshipctl generation,
making apply code and process more clear, reliable and
readable. In particular:
* k8s applier now is a KRM function and it allows the
end user to choose or implement desired backend for
k8s apply operations;
* the related amount of code was reduced by three times,
multiple unused and unnecessary structs/interfaces/design
patterns were removed or rewrited in more clean and efficient
way;
* removed cli-utils dependency from airshipctl;
* fixed several bugs and code issues, such as incorrect printing
of tables, duplicated unit tests, improper generation and applying
inventory config map, etc;
* cli-utils version used in KRM function was bumped to 0.26.0;
* phases with duplicated k8s resources were removed or fixed;
* unit test coverage increased to 83.1%;
* KRM function logs were integrated with klog library which allows
to observe logs directly from cli-utils and other dependent libs.
Change-Id: Ief509f1d6abefd53caf7fcffc4e36b0319815373
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #646
This patch allows to wait for certain state when applying
particular resources.
Change-Id: I064cb49c8971f1edee870bc6c3c3dd1e428c73f0
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #624
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>
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
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
Moves CAPI resources in ephemeral cluster from the 'default'
namespace to a new 'target-infra' namespace.
Closes: #551
Change-Id: I419a71baa8e05e7b57b38234d15b955b36951b40
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>
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
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
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
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
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
Now if clusterName is specified for kubebuilder, Build() method
will return kubeconfig containing only context for that cluster.
If no clusterName is specified kubeconfig will have contexts of
all clusters that builder can build. This behaviour is similar
to `kubeconfig get` command.
Relates-To: #460
Change-Id: Ib3bebf61bc60430d347ded41b2e31249b11126eb
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
* This commit will removed capitalizaion in Error message
and follow the Golang code rule.
* Golang errors should not begin with capitalization:
https://github.com/golang/go/wiki/CodeReviewComments#error-strings
Signed-off-by: bijayasharma <vetbijaya@gmail.com>
Change-Id: I053cfa9e21ad56b0f30e476ec36320cb7cea4da4
This patch links cluster get-kubeconfig command call with
appropriate clusterctl functionality, and also replaces old
callbacks and removes outdated implementation.
Change-Id: Ibd0d981985f94497db250c8df3f5675fdec1d2ca
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #374
Having an executor within applier package creates
potential import cycling. This patch moves it to a separate
package which can be used to conveniently store all the executors
at one place.
Change-Id: I68d909489b691e4fb7129446ef9a3fb085f8683c
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #432
In order to widely use filesystem interface in airshipctl
there is need to move it to separate package to avoid
importing unnecessary dependencies from document
package and, as a consequence, possible cyclic dependencies.
* filesystem moved from document/fs to pkg/fs
Change-Id: I3b6298462f03db43594a9fa26bf23ab7687c5589
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #415
This commit extends cluster map interface to be able to specify
a custom kubeconfig context per cluster in ClusterMap
Related-To: #380
Related-To: #375
Closes: #380
Change-Id: I9a8a26e3a3666e069c243e871f89ae9222228f17
* uplift of cli-utils had changes with signature of Applier.
So had to update the impacted go code and cleanup the
unwanted parameters.
Change-Id: I6f3018d1fd4cac2e1a328e50c44ad0f51bb0e16f
Closes: #367
This commit adds cluster map api object, cluster map
interface and it's implementation built on top of cluster map api
object.
Important note:
ClusterMap interface needs a method to identify namespace of the
cluster, it can't be a part of api object, because real source for
cluster namespace is cluster object from cluster-api upstream lib.
This will need further design discussion on how we will find
cluster-api kind: Cluster object in our manifests. For now, there
is dummy "default" namespace being used
Change-Id: I8175f54abbe77331f0c87c0bde50857ee5c0eb1d
This module is no longer needed since all config preloading actions
were moved to config module and global flags are stored within root
level cmd.
Change-Id: I411f6717e5b3d2998706c35a82f1e7f1b2aef3a8
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
All the phase commands was refactored for usage with new config
factory. Config object now is being initialized in pkg module on demand,
which provides more flexibility and cleaner code.
Change-Id: I742c39788098c3185ce89936ea81cd461bf97af3
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
All the cluster commands was refactored for usage with new config
factory. Config object now is being initialized in pkg module on demand,
which provides more flexibility and cleaner code.
Change-Id: I1088ecbce0c34a146a646270404ff206b152d310
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>