Merge "Deduplicate airshipctl manifest networking"

This commit is contained in:
Zuul 2020-10-21 23:11:36 +00:00 committed by Gerrit Code Review
commit 6d6d837060
45 changed files with 345 additions and 72 deletions

View File

@ -1,5 +1,5 @@
Function: airshipctl-catalogues Function: airshipctl-base-catalogues
=============================== ====================================
This function defines some default VariableCatalogue resources, This function defines some default VariableCatalogue resources,
which can be consumed and used (via ReplacementTransformer) to change the which can be consumed and used (via ReplacementTransformer) to change the

View File

@ -3,6 +3,7 @@ kind: Kustomization
resources: resources:
- versions-airshipctl.yaml - versions-airshipctl.yaml
- networking.yaml
generators: generators:
- env-vars-template.yaml - env-vars-template.yaml

View File

@ -0,0 +1,62 @@
# The default networking catalogue for functions hosted in the airshipctl project.
# These values can be overridden at the site, type, etc levels as appropriate.
apiVersion: airshipit.org/v1alpha1
kind: VariableCatalogue
metadata:
name: networking
labels:
airshipit.org/deploy-k8s: "false"
# The catalogue should be overridden as appropriate for different kubernetes
# clusters, e.g. ephemeral vs target vs tenant
kubernetes:
serviceCidr: "10.96.0.0/12"
podCidr: "192.168.0.0/18"
controlPlaneEndpoint:
host: "10.23.25.102" # ephemeral will be different
port: 6443
# NOTE: This stringing is required to do substring replacement.
# Ideally, improve this in the future.
apiserverCertSANs: "[10.23.25.201, 10.23.24.201]"
ironic:
provisioningInterface: "pxe"
provisioningIp: "10.23.25.102"
dhcpRange: "10.23.25.200,10.23.25.250"
# This section is only relevant when using Metal3 BareMetalHosts, and
# is consumed by the `hostgenerator-m3` function.
# It defines host-level networking that is common across all BMHs in a site,
# and will typically be fully overridden at the Type and Site level.
commonHostNetworking:
links:
- id: oam
name: oam
type: phy
mtu: "1500"
# ethernet_mac_address: <from host-catalogue> (optional)
- id: pxe
name: pxe
type: phy
mtu: "1500"
# ethernet_mac_address: <from host-catalogue> (optional)
networks:
- id: oam-ipv4
type: ipv4
link: oam
# ip_address: <from host-catalogue>
netmask: 255.255.255.0
routes:
- network: 0.0.0.0
netmask: 0.0.0.0
gateway: 10.23.25.1
- id: pxe-ipv4
type: ipv4
link: pxe
# ip_address: <from host-catalogue>
netmask: 255.255.255.0
services:
- address: 8.8.8.8
type: dns
- address: 8.8.4.4
type: dns

View File

@ -6,6 +6,12 @@ including both the operator itself and Ironic.
Optional: a ``versions-airshipctl`` VariableCatalogue may be used to Optional: a ``versions-airshipctl`` VariableCatalogue may be used to
override the default container images. override the default container images.
A base example for this catalogue can be found in the ``airshipctl-catalogues`` A base example for this catalogue can be found in the ``airshipctl-base-catalogues``
function. If using the catalogue, apply the ``replacements/`` entrypoint
at the site level, as a Kustomize transformer.
Optional: a ``networking`` VariableCatalogue may be used to
override some of the ironic networking variables.
A base example for this catalogue can be found in the ``airshipctl-base-catalogues``
function. If using the catalogue, apply the ``replacements/`` entrypoint function. If using the catalogue, apply the ``replacements/`` entrypoint
at the site level, as a Kustomize transformer. at the site level, as a Kustomize transformer.

View File

@ -5,14 +5,18 @@ metadata:
labels: labels:
name: ironic-vars name: ironic-vars
data: data:
# Overrideable via the `replacements` entrypoint and environment variables
HTTP_PROXY: "" HTTP_PROXY: ""
HTTPS_PROXY: "" HTTPS_PROXY: ""
http_proxy: "" http_proxy: ""
https_proxy: "" https_proxy: ""
NO_PROXY: "" NO_PROXY: ""
no_proxy: "" no_proxy: ""
# Overrideable via the `replacements` entrypoint and networking catalogue
PROVISIONING_IP: "192.168.10.100" PROVISIONING_IP: "192.168.10.100"
# Overrideable via the `replacements` entrypoint and networking catalogue
DHCP_RANGE: "192.168.10.200,192.168.10.250" DHCP_RANGE: "192.168.10.200,192.168.10.250"
# Overrideable via the `replacements` entrypoint and networking catalogue
PROVISIONING_INTERFACE: "pxe" PROVISIONING_INTERFACE: "pxe"
HTTP: "80" HTTP: "80"
DEPLOY_KERNEL_PATH: "/images/tinyipa-stable-ussuri.vmlinuz" DEPLOY_KERNEL_PATH: "/images/tinyipa-stable-ussuri.vmlinuz"

View File

@ -3,3 +3,4 @@ kind: Kustomization
resources: resources:
- versions.yaml - versions.yaml
- ironic-env-vars.yaml - ironic-env-vars.yaml
- networking.yaml

View File

@ -0,0 +1,37 @@
# These rules inject networking info into the baremetal-operator function.
apiVersion: airshipit.org/v1alpha1
kind: ReplacementTransformer
metadata:
name: baremetal-operator-networking-replacements
replacements:
# Replace the pod & service networks
- source:
objref:
kind: VariableCatalogue
name: networking
fieldref: ironic.provisioningInterface
target:
objref:
kind: ConfigMap
name: ironic-vars
fieldrefs: ["data.PROVISIONING_INTERFACE"]
- source:
objref:
kind: VariableCatalogue
name: networking
fieldref: ironic.provisioningIp
target:
objref:
kind: ConfigMap
name: ironic-vars
fieldrefs: ["data.PROVISIONING_IP"]
- source:
objref:
kind: VariableCatalogue
name: networking
fieldref: ironic.dhcpRange
target:
objref:
kind: ConfigMap
name: ironic-vars
fieldrefs: ["data.DHCP_RANGE"]

View File

@ -13,4 +13,4 @@ supplies defaults, and these can (optionally) be overridden either by
simple Kustomize patching, or by applying the ``replacements`` simple Kustomize patching, or by applying the ``replacements``
kustomization as a Kustomize transformer. In the latter case, kustomization as a Kustomize transformer. In the latter case,
an airshipctl versions catalogue must be supplied; please see the an airshipctl versions catalogue must be supplied; please see the
``airshipctl-catalogues`` function for a base/example. ``airshipctl-base-catalogues`` function for a base/example.

View File

@ -0,0 +1,16 @@
Function: ephemeral
===================
This function defines the configuration for a bare metal ephemeral
bootstrapping image, which can be built via ``airshipctl image build``
and delivered over the WAN to a remote
host via redfish using ``airshipctl baremetal remotedirect``.
REQUIRED: a ``networking`` VariableCatalogue must be used to
override some Kubernetes networking configuration.
A base example for this catalogue can be found in the ``airshipctl-base-catalogues``
function. If using the catalogue, apply the ``replacements/`` entrypoint
at the site level, as a Kustomize transformer.
Alternately, the entire text payload of the ephemeral secret may be overridden
via normal Kustomize patching.

View File

@ -2,3 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- ephemeral-env-vars.yaml - ephemeral-env-vars.yaml
- networking.yaml

View File

@ -0,0 +1,47 @@
# These rules inject networking info artifacts into the ephemeral function.
apiVersion: airshipit.org/v1alpha1
kind: ReplacementTransformer
metadata:
name: ephemeral-networking-replacements
replacements:
# Substring-replace the ephemeral control plane's info
- source:
objref:
kind: VariableCatalogue
name: networking
fieldref: kubernetes.controlPlaneEndpoint.host
target:
objref:
name: ephemeral-bmc-secret
kind: Secret
fieldrefs: ["stringData.userData%REPLACEMENT_CP_IP%"]
- source:
objref:
kind: VariableCatalogue
name: networking
fieldref: kubernetes.controlPlaneEndpoint.port
target:
objref:
name: ephemeral-bmc-secret
kind: Secret
fieldrefs: ["stringData.userData%REPLACEMENT_CP_PORT%"]
- source:
objref:
kind: VariableCatalogue
name: networking
fieldref: kubernetes.apiserverCertSANs
target:
objref:
name: ephemeral-bmc-secret
kind: Secret
fieldrefs: ["stringData.userData%REPLACEMENT_CERT_SANS%"]
- source:
objref:
kind: VariableCatalogue
name: networking
fieldref: kubernetes.podCidr
target:
objref:
name: ephemeral-bmc-secret
kind: Secret
fieldrefs: ["stringData.userData%REPLACEMENT_POD_CIDR%"]

View File

@ -4,9 +4,12 @@ metadata:
labels: labels:
airshipit.org/ephemeral-user-data: "true" airshipit.org/ephemeral-user-data: "true"
airshipit.org/deploy-k8s: "false" airshipit.org/deploy-k8s: "false"
name: ephemeral-bmc-secret name: ephemeral-bmc-secret # replacement rules key off this name
type: Opaque type: Opaque
stringData: stringData:
# These substrings must be overriden via the `replacements` entrypoint and networking catalogue:
# REPLACEMENT_CP_IP, REPLACEMENT_CP_PORT, REPLACEMENT_CERT_SANS, REPLACEMENT_POD_CIDR
# TODO: add download sources to the versions catalogue
userData: | userData: |
#cloud-config #cloud-config
ssh_pwauth: True ssh_pwauth: True
@ -63,7 +66,7 @@ stringData:
clusters: clusters:
- cluster: - cluster:
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWUR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WUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFJek9BL00xWmRGUElzd2VoWjFuemJ0VFNURG4KRHMyVnhSV0VnclFFYzNSYmV3a1NkbTlBS3MwVGR0ZHdEbnBEL2tRYkNyS2xEeFF3RWg3NFZNSFZYYkFadDdsVwpCSm90T21xdXgxYThKYklDRTljR0FHRzFvS0g5R29jWERZY0JzOTA3ckxIdStpVzFnL0xVdG5hN1dSampqZnBLCnFGelFmOGdJUHZIM09BZ3B1RVVncUx5QU8ya0VnelZwTjZwQVJxSnZVRks2TUQ0YzFmMnlxWGxwNXhrN2dFSnIKUzQ4WmF6d0RmWUVmV3Jrdld1YWdvZ1M2SktvbjVEZ0Z1ZHhINXM2Snl6R3lPVnZ0eG1TY2FvOHNxaCs3UXkybgoyLzFVcU5ZK0hlN0x4d04rYkhwYkIxNUtIMTU5ZHNuS3BRbjRORG1jSTZrVnJ3MDVJMUg5ZGRBbGF0bz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
server: https://10.23.25.101:6443 server: https://REPLACEMENT_CP_IP:REPLACEMENT_CP_PORT
name: kubernetes name: kubernetes
contexts: contexts:
- context: - context:
@ -96,9 +99,7 @@ stringData:
- content: | - content: |
--- ---
apiServer: apiServer:
certSANs: certSANs: REPLACEMENT_CERT_SANS
- 10.23.25.101
- 10.23.24.101
apiVersion: kubeadm.k8s.io/v1beta2 apiVersion: kubeadm.k8s.io/v1beta2
controllerManager: {} controllerManager: {}
dns: dns:
@ -106,7 +107,7 @@ stringData:
etcd: {} etcd: {}
kind: ClusterConfiguration kind: ClusterConfiguration
networking: networking:
podSubnet: 192.168.0.0/24 podSubnet: REPLACEMENT_POD_CIDR
scheduler: {} scheduler: {}
--- ---
apiVersion: kubeadm.k8s.io/v1beta2 apiVersion: kubeadm.k8s.io/v1beta2

View File

@ -3,6 +3,9 @@ kind: VariableCatalogue
metadata: metadata:
# NOTE: change this when copying this example # NOTE: change this when copying this example
name: hardwareprofile-example name: hardwareprofile-example
labels:
airshipit.org/deploy-k8s: "false"
hardwareProfile: hardwareProfile:
firmware: firmware:
sriovEnabled: false sriovEnabled: false

View File

@ -15,7 +15,7 @@ BMHs in a data-driven fashion.
To use this function, do the following: To use this function, do the following:
* Supply a `common-networking-catalogue`, which outlines things that are * Supply a `networking` catalogue, which outlines things that are
typically common across hosts in a site, such as networking interfaces, typically common across hosts in a site, such as networking interfaces,
DNS servers, and other networking info. DNS servers, and other networking info.
Example: `manifests/type/gating/shared/catalogues/common-networking.yaml` Example: `manifests/type/gating/shared/catalogues/common-networking.yaml`

View File

@ -9,7 +9,7 @@ values:
# hostsToGenerate: # hostsToGenerate:
# (filled in with phase-specific host-generation-catalogue) # (filled in with phase-specific host-generation-catalogue)
# commonNetworking: # commonNetworking:
# (filled in with the type-specific common-networking-catalogue) # (filled in with the type-specific common-networking)
# Additional hardwareProfiles can be defined within their own functions, # Additional hardwareProfiles can be defined within their own functions,
# and then substituted into the stanza below. # and then substituted into the stanza below.

View File

@ -29,8 +29,9 @@ replacements:
fieldrefs: ["{.values.hostsToGenerate}"] fieldrefs: ["{.values.hostsToGenerate}"]
- source: - source:
objref: objref:
name: common-networking-catalogue kind: VariableCatalogue
fieldref: "{.commonNetworking}" name: networking
fieldref: "{.commonHostNetworking}"
target: target:
objref: objref:
kind: Templater kind: Templater

View File

@ -7,6 +7,12 @@ resources.
Optional: a ``versions-airshipctl`` VariableCatalogue may be used to Optional: a ``versions-airshipctl`` VariableCatalogue may be used to
override the default Kubernetes version and controlplane disk image. override the default Kubernetes version and controlplane disk image.
A base example for this catalogue can be found in the ``airshipctl-catalogues`` A base example for this catalogue can be found in the ``airshipctl-base-catalogues``
function. If using the catalogue, apply the ``replacements/`` entrypoint function. If using the catalogue, apply the ``replacements/`` entrypoint
at the site level, as a Kubernetes transformer. at the site level, as a Kubernetes transformer.
Optional: a ``networking`` VariableCatalogue may be used to
override some Kubernetes networking configuration.
A base example for this catalogue can be found in the ``airshipctl-base-catalogues``
function. If using the catalogue, apply the ``replacements/`` entrypoint
at the site level, as a Kustomize transformer.

View File

@ -15,8 +15,10 @@ metadata:
spec: spec:
clusterNetwork: clusterNetwork:
services: services:
# Overrideable via the `replacements` entrypoint and networking catalogue
cidrBlocks: ["10.96.0.0/12"] cidrBlocks: ["10.96.0.0/12"]
pods: pods:
# Overrideable via the `replacements` entrypoint and networking catalogue
cidrBlocks: ["192.168.0.0/18"] cidrBlocks: ["192.168.0.0/18"]
serviceDomain: "cluster.local" serviceDomain: "cluster.local"
infrastructureRef: infrastructureRef:
@ -33,6 +35,7 @@ kind: Metal3Cluster
metadata: metadata:
name: target-cluster name: target-cluster
spec: spec:
# Overrideable via the `replacements` entrypoint and networking catalogue
controlPlaneEndpoint: controlPlaneEndpoint:
host: 10.23.25.102 host: 10.23.25.102
port: 6443 port: 6443

View File

@ -20,6 +20,7 @@ spec:
Environment="HTTP_PROXY=REPLACEMENT_HTTP_PROXY" Environment="HTTP_PROXY=REPLACEMENT_HTTP_PROXY"
Environment="HTTPS_PROXY=REPLACEMENT_HTTPS_PROXY" Environment="HTTPS_PROXY=REPLACEMENT_HTTPS_PROXY"
Environment="NO_PROXY=REPLACEMENT_NO_PROXY" Environment="NO_PROXY=REPLACEMENT_NO_PROXY"
# TODO: add download sources to the versions catalogue
preKubeadmCommands: preKubeadmCommands:
- echo 'root:r00tme' | chpasswd - echo 'root:r00tme' | chpasswd
- echo 'ubuntu:r00tme' | chpasswd - echo 'ubuntu:r00tme' | chpasswd

View File

@ -3,3 +3,4 @@ kind: Kustomization
resources: resources:
- versions.yaml - versions.yaml
- k8scontrol-env-vars.yaml - k8scontrol-env-vars.yaml
- networking.yaml

View File

@ -0,0 +1,41 @@
# These rules inject networking info into the k8scontrol function.
# Note! They are applied to Cluster object(s) regardless of name, so
# that they can be defined/used generically. If more than one Cluster
# needs to be submitted to a management cluster, these tranformation
# rules should be applied to each Cluster in isolation, and then
# the results "mixed together" via kustomize.
apiVersion: airshipit.org/v1alpha1
kind: ReplacementTransformer
metadata:
name: k8scontrol-networking-replacements
replacements:
# Replace the pod & service networks
- source:
objref:
kind: VariableCatalogue
name: networking
fieldref: kubernetes.serviceCidr
target:
objref:
kind: Cluster
fieldrefs: ["spec.clusterNetwork.services.cidrBlocks.0"]
- source:
objref:
kind: VariableCatalogue
name: networking
fieldref: kubernetes.podCidr
target:
objref:
kind: Cluster
fieldrefs: ["spec.clusterNetwork.pods.cidrBlocks.0"]
# Replace the k8s controlplane host endpoint
- source:
objref:
kind: VariableCatalogue
name: networking
fieldref: kubernetes.controlPlaneEndpoint
target:
objref:
kind: Metal3Cluster
fieldrefs: ["spec.controlPlaneEndpoint"]

View File

@ -4,7 +4,7 @@ resources:
# TODO: these two should move up to type level in the future # TODO: these two should move up to type level in the future
- ../../../../../function/hostgenerator-m3 - ../../../../../function/hostgenerator-m3
- ../../../../../function/hardwareprofile-example - ../../../../../function/hardwareprofile-example
- ../../../shared/catalogues/ - ../../catalogues
- host-generation.yaml - host-generation.yaml
transformers: transformers:

View File

@ -1,8 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- ../../../../type/gating - ../../../../function/ephemeral
- ../../../../function/airshipctl-catalogues - ../catalogues
generators: generators:
- hostgenerator - hostgenerator

View File

@ -0,0 +1,4 @@
# Catalogue Definitions for Ephemeral Cluster
This inherits Site-level catalogues from the neighboring target cluster's
`catalogues` kustomization, and tweaks a few values for the ephemeral cluster.

View File

@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../target/catalogues
patches:
- networking.yaml

View File

@ -0,0 +1,20 @@
# This makes a couple small networking tweaks that are specific to the
# ephemeral cluster, on top of the target cluster networking definition.
# These values can be overridden at the site, type, etc levels as appropriate.
apiVersion: airshipit.org/v1alpha1
kind: VariableCatalogue
metadata:
name: networking
# The catalogue should be overridden as appropriate for different kubernetes
# clusters, e.g. ephemeral vs target vs tenant
kubernetes:
podCidr: "192.168.0.0/24"
controlPlaneEndpoint:
host: "10.23.25.101"
apiserverCertSANs: "[10.23.25.101, 10.23.24.101]"
ironic:
provisioningIp: "10.23.24.101"
dhcpRange: "10.23.24.200,10.23.24.250"

View File

@ -4,7 +4,7 @@ resources:
# TODO: these two should move up to type level in the future # TODO: these two should move up to type level in the future
- ../../../../../function/hostgenerator-m3 - ../../../../../function/hostgenerator-m3
- ../../../../../function/hardwareprofile-example - ../../../../../function/hardwareprofile-example
- ../../../shared/catalogues/ - ../../catalogues
- host-generation.yaml - host-generation.yaml
transformers: transformers:

View File

@ -3,12 +3,9 @@ kind: Kustomization
resources: resources:
# TODO (dukov) It's recocommended to upload BareMetalHost objects separately # TODO (dukov) It's recocommended to upload BareMetalHost objects separately
# otherwise nodes will hang in 'registering' state for quite a long time # otherwise nodes will hang in 'registering' state for quite a long time
- nodes
- ../../../../function/airshipctl-catalogues
- ../../../../function/k8scontrol - ../../../../function/k8scontrol
- ../../target/catalogues # NOTE: use target networking for this phase
patchesStrategicMerge: - nodes
- versions-catalogue-patch.yaml
transformers: transformers:
- ../../../../function/k8scontrol/replacements - ../../../../function/k8scontrol/replacements

View File

@ -1,11 +1,8 @@
resources: resources:
- ../../../../composite/infra
- ../../../../function/clusterctl
- ../../../../function/airshipctl-catalogues
- ../../../../function/baremetal-operator - ../../../../function/baremetal-operator
- ../../../../function/clusterctl
patchesStrategicMerge: - ../../../../composite/infra
- patch_bmo_config.yaml - ../catalogues
commonLabels: commonLabels:
airshipit.org/stage: initinfra airshipit.org/stage: initinfra

View File

@ -1,9 +0,0 @@
---
kind: ConfigMap
apiVersion: v1
metadata:
labels:
name: ironic-vars
data:
PROVISIONING_IP: "10.23.24.101"
DHCP_RANGE: "10.23.24.200,10.23.24.250"

View File

@ -0,0 +1,5 @@
# Catalogue Definitions for Target Cluster
This inherits Type-level catalogues, and adds in Site-specific values.
The neighboring ephemeral cluster's `catalogues` entrypoint applies further
customizations on top of this for ephemeral use.

View File

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

View File

@ -1,5 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- ../../../../type/gating/shared/catalogues - ../../../../type/gating/shared/catalogues
- hosts.yaml - hosts.yaml
patches:
- versions-airshipctl.yaml
- networking.yaml

View File

@ -0,0 +1,19 @@
# This makes a couple small networking tweaks that are specific to the
# ephemeral cluster, on top of the target cluster networking definition.
# These values can be overridden at the site, type, etc levels as appropriate.
apiVersion: airshipit.org/v1alpha1
kind: VariableCatalogue
metadata:
name: networking
# The catalogue should be overridden as appropriate for different kubernetes
# clusters, e.g. ephemeral vs target vs tenant
kubernetes:
controlPlaneEndpoint:
host: "10.23.25.102"
apiserverCertSANs: "[10.23.25.102, 10.23.24.102]"
ironic:
provisioningIp: "10.23.24.102"
dhcpRange: "10.23.24.200,10.23.24.250"

View File

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

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

@ -3,7 +3,7 @@ kind: Kustomization
resources: resources:
- ../../../../../function/hostgenerator-m3 - ../../../../../function/hostgenerator-m3
- ../../../../../function/hardwareprofile-example - ../../../../../function/hardwareprofile-example
- ../../../shared/catalogues/ - ../../catalogues
- host-generation.yaml - host-generation.yaml
transformers: transformers:

View File

@ -4,11 +4,11 @@ resources:
# TODO (dukov) It's recocommended to upload BareMetalHost objects separately # TODO (dukov) It's recocommended to upload BareMetalHost objects separately
# otherwise nodes will hang in 'registering' state for quite a long time # otherwise nodes will hang in 'registering' state for quite a long time
- nodes - nodes
- ../../../../function/airshipctl-catalogues
- ../../../../function/k8scontrol - ../../../../function/k8scontrol
- ../catalogues
patchesStrategicMerge:
- control-machine-template-patch.yaml
commonLabels: commonLabels:
airshipit.org/stage: initinfra airshipit.org/stage: initinfra
transformers:
- ../../../../function/k8scontrol/replacements

View File

@ -1,12 +1,9 @@
resources: resources:
- ../../../../composite/infra
- ../../../../function/clusterctl
- ../../../../function/airshipctl-catalogues
- ../../../../function/baremetal-operator - ../../../../function/baremetal-operator
- ../../../../function/clusterctl
- ../../../../function/helm-operator - ../../../../function/helm-operator
- ../../../../composite/infra
patchesStrategicMerge: - ../catalogues
- patch_bmo_config.yaml
commonLabels: commonLabels:
airshipit.org/stage: initinfra airshipit.org/stage: initinfra

View File

@ -2,7 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- ../../../../../function/hostgenerator-m3 - ../../../../../function/hostgenerator-m3
- ../../../shared/catalogues/ - ../../catalogues
- host-generation.yaml - host-generation.yaml
transformers: transformers:

View File

@ -1,2 +0,0 @@
resources:
- ../../function/ephemeral

View File

@ -1,4 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- common-networking.yaml - ../../../../function/airshipctl-base-catalogues
patches:
- networking.yaml

View File

@ -1,10 +1,17 @@
# Type-level networking catalogue. This info feeds the Templater # The default networking catalogue for site- and operator-specific networking.
# kustomize plugin config in the hostgenerator-m3 function. # These values can be overridden at the site, type, etc levels as appropriate.
apiVersion: airshipit.org/v1alpha1 apiVersion: airshipit.org/v1alpha1
kind: VariableCatalogue kind: VariableCatalogue
metadata: metadata:
name: common-networking-catalogue name: networking
commonNetworking: labels:
airshipit.org/deploy-k8s: "false"
# This section is only relevant when using Metal3 BareMetalHosts, and
# is consumed by the `hostgenerator-m3` function.
# It defines host-level networking that is common across all BMHs in a site,
# and will typically be fully overridden at the Type and Site level.
commonHostNetworking:
links: links:
- id: oam - id: oam
name: oam name: oam
@ -36,4 +43,3 @@ commonNetworking:
type: dns type: dns
- address: 8.8.4.4 - address: 8.8.4.4
type: dns type: dns