Add version catalogues

This takes advantage of version catalogue replacement, which was added to
airshipctl in the changes below.  It also refactors the kustomize structure
a bit to support that well.

This adds a treasuremap clusterctl function, which kustomizes the same function
from airshipctl to correct for paths.  This replaces the previous
site-level clusterctl entrypoints.

This gives each type and site a catalogues entrypoint, which are wired together
(site inheriting from type, and network-cloud from airship-core) for
inheritance.  Each phase that needs catalogue-based replacement now
pulls in its' site's catalogues definition, and then applies any
phase specific overrides only when necessary.

https://review.opendev.org/#/c/746608
https://review.opendev.org/#/c/746764/

Change-Id: I18364083f72628f9519af3d2fab0d6a4879d2d14
Relates-To: https://github.com/airshipit/airshipctl/issues/316
This commit is contained in:
Matt McEuen
2020-09-15 14:39:38 -05:00
parent 339f6dbc97
commit 6e0d9e83b0
30 changed files with 105 additions and 187 deletions

View File

@@ -1,11 +0,0 @@
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
kind: Metal3MachineTemplate
metadata:
name: cluster-controlplane
spec:
template:
spec:
image:
url: http://10.23.24.1:8099/target-image.qcow2
checksum: http://10.23.24.1:8099/target-image.qcow2.md5sum

View File

@@ -2,8 +2,11 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../../type/network-cloud/ephemeral/controlplane
- ../../shared/catalogues
# TODO (dukov) It's recocommended to upload BareMetalHost objects separately
# otherwise nodes will hang in 'registering' state for quite a long time
- nodes
patchesStrategicMerge:
- control-machine-template-patch.yaml
- versions-catalogue-patch.yaml
transformers:
- ../../../../type/network-cloud/ephemeral/controlplane/replacements

View File

@@ -0,0 +1,11 @@
# Patch the versions catalogue to use the site-specific local image URL
# TODO: patch this in from a site-networking catalogue in the future
apiVersion: airshipit.org/v1alpha1
kind: VariableCatalogue
metadata:
name: versions-airshipctl
files:
k8scontrol:
cluster_controlplane_image:
url: http://10.23.24.1:8099/target-image.qcow2
checksum: http://10.23.24.1:8099/target-image.qcow2.md5sum

View File

@@ -1,4 +1,7 @@
resources:
- ../../../../type/network-cloud/ephemeral/initinfra
- ../../shared/catalogues
patchesStrategicMerge:
- patch_bmo_config.yaml
transformers:
- ../../../../type/airship-core/ephemeral/initinfra/replacements

View File

@@ -3,6 +3,8 @@
apiVersion: airshipit.org/v1alpha1
kind: VariableCatalogue
metadata:
labels:
airshipit.org/deploy-k8s: "false"
name: host-catalogue
hosts:
m3: