Commit Graph

65 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>
2 years ago
Ruslan Aliev 38849e63d1 Use kube-webhook-certgen image from quay.io
Allows to avoid docker pull limit issue.

Change-Id: Ic3cb4be1945f95962a185bdfd8d50c6e7746d2e4
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2 years ago
Zuul 2219c810b8 Merge "Switching airshipctl and krm-functions to kustomize 4.2.0" 2 years ago
Zuul 0ff049115d Merge "Move clustetctl to KRM" 2 years ago
Alexey Odinokov 37c2854cce Switching airshipctl and krm-functions to kustomize 4.2.0
Reworked build process of dependent krm functions
to use the latest airshipctl

Change-Id: If4c7f992123b86442980f381ae69fb003f4851e3
2 years ago
Sirajudeen 7974e041c5 Regenerate deepcopy with recent changes
* updated README to use `make generate` option to generate deepcopy file.

Change-Id: I43f3ebd970fb48671fe936bf184eaed2a15a2389
2 years ago
Ruslan Aliev ab55bc5e86 Move clustetctl to KRM
Change-Id: I79ccb7b7c92f27cf6fdaaa540d86db80a0a62b41
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #568
2 years ago
shon phand e9f35dabe8 adding installation registry to version catalogue
* modified image_repositories section schema in version catalogue.
  new type : type map[string]ImageRepositorySpec
  old type : string.
* replaced registry attribute in Installation resource from
  version-catalogue image_repositories section.
* updated old attributes from  image_repositories section as per new
  schema.

Closes: #590
Change-Id: I2159e23b8a63b5f48d2f4e79b56c2bc021646c77
2 years ago
Matthew Fuller 52c5aedc63 Generate additional CRDs from API types
'make manifests' attempts to generate all airshipctl API types,
but several types throw errors and the resulting CRDs can't be
properly generated. This change:

- updates the controller-gen version to pull in a bug fix for the
  error 'map values must be a named type, not *ast.StarExpr'
- modifies the Templater type's Values member to be of type JSON
  since controller-gen does not support map[string]interface{},
  and unmarshals it separately in the templater itself
- adds 'image_repositories' to the VersionsCatalogueSpec struct
  to ensure it doesn't get deleted from the schema when manifests
  get regenerated
- checks in generated copies of all CRDs from airshipctl's API
  types, not just catalogues, to be used for validation

Closes: #574
Change-Id: I89a12cfd307a08da9aaec9773eac01169ea43ace
2 years ago
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
2 years ago
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
2 years ago
Zuul 575023cfcf Merge "Update metadata.yaml to kubernetes style" 2 years ago
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
2 years ago
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
2 years ago
Zuul e38f4fbf4c Merge "Use site-wide kubeconfig only on demand" 2 years ago
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
2 years ago
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
2 years ago
Zuul 5dcc769243 Merge "Generate Catalogues schema using kubebuilder" 2 years ago
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
2 years ago
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
2 years ago
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
2 years ago
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
2 years ago
Zuul adacadda4d Merge "[#358] Introduce Phase List command to output phase list(pkg module)." 2 years ago
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
2 years ago
Niharika Bhavaraju 9bf40366a5 [#358] Introduce Phase List command to output phase list(pkg module).
* Phase list command lists phases of current documentset/plan in
  table or yaml format.
 airshipctl phase list
 airshipctl phase list --plan planName
 airshipctl phase list --plan planName -o yaml
 airshipctl phase list --plan planName -o table(default format)

Relates-To: #358

Co-Authored-By: Niharika Bhavaraju <niha.twinkle@gmail.com>

Change-Id: I37add2fc9dca2433de525bac8c2cc9e56fe39621
2 years ago
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
2 years ago
Zuul a00fb9f602 Merge "Mount kubeconfig to GenericContainer executor" 2 years ago
Vladislav Kuzmin 63e6012133 Mount kubeconfig to GenericContainer executor
Change-Id: Ide647fc0cfd9d281d57eeeaf8b3f9c33f59e7fdf
2 years ago
Vladimir Kozhukalov 9cd9304a22 Fix typos in struct tags
Change-Id: Ied4c5cc120ce9a86253e6af407f46c687c3a7fd8
2 years ago
Vladimir Kozhukalov 6523c800ad Build ephemeral iso using generic container
We build iso image in two steps
 1) We prepare cloud-init data using a krm function
    krm-functions/cloud-init which uses arishipctl capabilities
    to gather necessary data from the executor document bundle.
    Cloud-init data files are written into a directory mounted
    to the krm function container.
 2) We build iso image using image-builder. While doing this
    we mount the directory with cloud-init data files and set
    necessary environment variables defined in the executor
    document.

Relates-To: #440
Change-Id: Id0b34822e95f494d2e2f8fb407700b7f873e7c69
2 years ago
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
2 years ago
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
2 years ago
Kostiantyn Kalynovskyi 3f9e56ecef Add BMH manager executor api object
Also this commit extends helper interface with inventory

Change-Id: I8df785f1c095a2e9502f23e1c83c5fcfe6f811fd
2 years ago
Dmitry Ukov 178b0eff3e Implement plan run command
Change-Id: Ie627ce670cd2b19d6999dc7c7a7a6dc12b25cace
Closes: #395
2 years ago
Dmitry Ukov 069e4069ce Implement plan list subcommand
Change-Id: Ibcd7dbf6dc8cd9d0b018c148017244526651d8ba
Closes: #385
2 years ago
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
2 years ago
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
2 years ago
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
2 years ago
Dmitry Ukov aa46185975 Uplift kustomize api and kyaml versions
Change-Id: Id8334a74efb7f1004a36f2bfc0c6eca81380ef4d
Relates-to: #369
3 years ago
Vladislav Kuzmin 258b81122e Add generic container executor
This executor based on kyaml.RunFns[1].
It allows to execute arbitrary container as RunFns function
and handle any input data as ExecutorBundle.
Be aware that runtimeutils.FunctionSpec used for version 0.4.1[2]
and it can be changed in the future. It means that yaml scheme
of executor can be changed during kyaml uplift.
This executor transforms executor yaml to RunFns function acceptable format.

[1] https://github.com/kubernetes-sigs/kustomize/blob/master/kyaml/runfn/runfn.go
[2] https://github.com/kubernetes-sigs/kustomize/blob/kyaml/v0.4.1/kyaml/fn/runtime/runtimeutil/functiontypes.go#L22

Change-Id: I9eb648783f1ed462d2b8359d9dc86320c4db2a83
Closes: #202
Closes: #369
3 years ago
Dmitry Ukov 3acd9ab8f5 Add DeepCopy generation target to Makefile
Change-Id: I974f8472f2ad8231a6612849f1bc73895c96ef81
Closes: #384
3 years ago
Sirajudeen b266e18fd4 Image override for cert-manager components
* Images added to clusterctl object like Providers
  So that repository and tag for one or all of the cert-manager
  components can be overriden using patch/replacement

clusterctl Documentation for Image Override:
  https://cluster-api.sigs.k8s.io/clusterctl/configuration.html#image-overrides

Change-Id: Id9de8d1967e49aeb3293f6802e51d66d598333ae
Closes: #350
3 years ago
bijayasharma dfd82242d7 [#376] Add clusterapi name and namespaces to clustermap
This commit will add clusterapi name and namespaces with a given cluster
to a clustermap.

Refer code from this PS: https://review.opendev.org/#/c/759805/

Change-Id: I1937efa0bbf0b5b175d18777fdf4ba837d1d7344
Relates-To: #376
Closes: #376
3 years ago
Zuul 046a1fc291 Merge "BootConfiguration struct for Bootstrap Container" 3 years ago
Kostiantyn Kalynovskyi 8567ddf749 Add support for custom kubeconfig contexts
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
3 years ago
Sidney Shiba e528a89a73 BootConfiguration struct for Bootstrap Container
Adding BootConfiguration structure in preparation for the implementation
of Bootstrap Container / Ephemeral Cluster through "phase/executor".

Change-Id: I0239e9c975784703dd6abacbb17b5e15744f3924
3 years ago
Zuul 0f287089d9 Merge "Add check for executor ref in phase helper" 3 years ago
Dmitry Ukov d783d71f05 Introduce Replacement Transformer plugin container
Relates-To: #341
Change-Id: I65a5b8cf3bcf94321fc02f240b1d8075bca45c0c
3 years ago
Kostiantyn Kalynovskyi eddfc6338a Add check for executor ref in phase helper
Relates-To: #365
Closes: #365

Change-Id: I95251a0ef49436d86f6f882bf23a91ceb1b1a952
3 years ago
Zuul ac0b5d7896 Merge "Add functions for default api objects" 3 years ago