Added phase helper to power off ephemeral baremetal node

Ephemeral node needs to be powered off to avoid dhcp conflict
after cluster move. Also is used to replace the ephemeral vm destroy
phase in the gate type plan.

Tested in stl2.

Change-Id: I099b226da384011954f81b574e89b742806eac95
This commit is contained in:
James Gu 2021-06-11 18:11:00 +00:00 committed by James Gu
parent e24a53713e
commit 2119c3c2f3
5 changed files with 35 additions and 10 deletions

View File

@ -68,8 +68,6 @@ spec:
required:
- isoURL
type: object
required:
- remoteDirect
type: object
timeout:
description: Timeout in seconds

View File

@ -25,3 +25,12 @@ replacements:
kind: BaremetalManager
name: RemoteDirectEphemeral
fieldrefs: ["spec.hostSelector.name%EPHEMERAL_NODE%"]
- source:
objref:
name: versions-remotedirect
fieldref: spec.remotedirect.node
target:
objref:
kind: BaremetalManager
name: PowerOffEphemeral
fieldrefs: ["spec.hostSelector.name%EPHEMERAL_NODE%"]

View File

@ -215,6 +215,17 @@ spec:
isoURL: ISO_URL
---
apiVersion: airshipit.org/v1alpha1
kind: BaremetalManager
metadata:
name: PowerOffEphemeral
labels:
airshipit.org/deploy-k8s: "false"
spec:
operation: power-off
hostSelector:
name: EPHEMERAL_NODE
---
apiVersion: airshipit.org/v1alpha1
kind: GenericContainer
metadata:
name: iso-cloud-init-data
@ -501,7 +512,7 @@ kind: GenericContainer
metadata:
name: kubectl-wait-bmh
spec:
image: quay.io/airshipit/toolbox:latest
image: localhost/toolbox
hostNetwork: true
envVars:
- RESOURCE_GROUP_FILTER=metal3.io
@ -518,7 +529,7 @@ kind: GenericContainer
metadata:
name: kubectl-wait-label-node
spec:
image: quay.io/airshipit/toolbox:latest
image: localhost/toolbox
hostNetwork: true
envVars:
- RESOURCE_GROUP_FILTER=metal3.io
@ -535,7 +546,7 @@ kind: GenericContainer
metadata:
name: kubectl-check-ingress-ctrl
spec:
image: quay.io/airshipit/toolbox:latest
image: localhost/toolbox
hostNetwork: true
configRef:
kind: ConfigMap

View File

@ -280,6 +280,16 @@ config:
---
apiVersion: airshipit.org/v1alpha1
kind: Phase
metadata:
name: power-off-ephemeral
config:
executorRef:
apiVersion: airshipit.org/v1alpha1
kind: BaremetalManager
name: PowerOffEphemeral
---
apiVersion: airshipit.org/v1alpha1
kind: Phase
metadata:
name: kubectl-wait-node-ephemeral
clusterName: ephemeral-cluster

View File

@ -105,6 +105,8 @@ phases:
# To get ConfigMap for this phase, execute `airshipctl phase render --source config -k ConfigMap`
# and find ConfigMap with name kubectl-wait-cluster
- name: kubectl-wait-cluster-target
# Power off Ephemeral baremetal host avoid DHCP conflict
- name: power-off-ephemeral
# Create target k8s cluster resources
- name: controlplane-target
# List all nodes in target cluster
@ -117,11 +119,6 @@ phases:
# To get ConfigMap for this phase, execute `airshipctl phase render --source config -k ConfigMap`
# and find ConfigMap with name kubectl-get-pods
- name: kubectl-get-pods-target
# all vms. This can be removed once sushy tool is fixed
# Scripts for this phase placed in manifests/function/phase-helpers/virsh-destroy-vms/
# To get ConfigMap for this phase, execute `airshipctl phase render --source config -k ConfigMap`
# and find ConfigMap with name virsh-destroy-vms
- name: virsh-destroy-vms
# Deploy worker node
- name: workers-target
# Waiting for node to be provisioned