Functionalize workers/provision
- moves metal3 worker definition to its own function - removes workers-classification phase - removes 37_verify_hwcc_profiles.sh script Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me> Co-authored-by: Matthew Fuller <mf4192@att.com> Closes: #537 Change-Id: I844e88a1bf7a80954aca5afc8fa49a534c9ff2b0
This commit is contained in:
parent
9ca9106f34
commit
01753f64f8
@ -1,11 +1,6 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ../../catalogues
|
|
||||||
- ../../../../../type/gating/hwccprofiles
|
|
||||||
- kubeadmconfigtemplate.yaml
|
- kubeadmconfigtemplate.yaml
|
||||||
- metal3machinetemplate.yaml
|
- metal3machinetemplate.yaml
|
||||||
- machinedeployment.yaml
|
- machinedeployment.yaml
|
||||||
|
|
||||||
transformers:
|
|
||||||
- ../replacements
|
|
@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- workers-env-vars.yaml
|
||||||
|
- generated-secrets.yaml
|
@ -87,19 +87,6 @@ config:
|
|||||||
---
|
---
|
||||||
apiVersion: airshipit.org/v1alpha1
|
apiVersion: airshipit.org/v1alpha1
|
||||||
kind: Phase
|
kind: Phase
|
||||||
metadata:
|
|
||||||
name: workers-classification
|
|
||||||
clusterName: target-cluster
|
|
||||||
config:
|
|
||||||
cluster: target-cluster
|
|
||||||
executorRef:
|
|
||||||
apiVersion: airshipit.org/v1alpha1
|
|
||||||
kind: KubernetesApply
|
|
||||||
name: kubernetes-apply
|
|
||||||
documentEntryPoint: target/workers/provision
|
|
||||||
---
|
|
||||||
apiVersion: airshipit.org/v1alpha1
|
|
||||||
kind: Phase
|
|
||||||
metadata:
|
metadata:
|
||||||
name: clusterctl-init-ephemeral
|
name: clusterctl-init-ephemeral
|
||||||
clusterName: ephemeral-cluster
|
clusterName: ephemeral-cluster
|
||||||
|
@ -12,7 +12,6 @@ phases:
|
|||||||
- name: initinfra-target
|
- name: initinfra-target
|
||||||
- name: initinfra-networking-target
|
- name: initinfra-networking-target
|
||||||
- name: workers-target
|
- name: workers-target
|
||||||
- name: workers-classification
|
|
||||||
- name: workload-target
|
- name: workload-target
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
|
- ../catalogues
|
||||||
|
- ../../../../function/workers-capm3/
|
||||||
- nodes
|
- nodes
|
||||||
|
|
||||||
|
transformers:
|
||||||
|
- ../../../../function/workers-capm3/replacements
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- workers-env-vars.yaml
|
- ../../../../function/workers-capm3/replacements
|
||||||
- generated-secrets.yaml
|
|
||||||
|
@ -46,7 +46,6 @@
|
|||||||
- ./tools/deployment/33_cluster_move_target_node.sh
|
- ./tools/deployment/33_cluster_move_target_node.sh
|
||||||
- ./tools/deployment/35_deploy_worker_node.sh
|
- ./tools/deployment/35_deploy_worker_node.sh
|
||||||
- ./tools/deployment/36_deploy_workload.sh
|
- ./tools/deployment/36_deploy_workload.sh
|
||||||
- ./tools/deployment/37_verify_hwcc_profiles.sh
|
|
||||||
|
|
||||||
- name: "Run gate scripts"
|
- name: "Run gate scripts"
|
||||||
include_role:
|
include_role:
|
||||||
|
@ -59,8 +59,5 @@ airshipctl phase run workers-target --debug
|
|||||||
echo "Waiting $TIMEOUT seconds for bmh to be in ready state."
|
echo "Waiting $TIMEOUT seconds for bmh to be in ready state."
|
||||||
node_timeout bmh ready
|
node_timeout bmh ready
|
||||||
|
|
||||||
echo "Classify and provision worker node"
|
|
||||||
airshipctl phase run workers-classification --debug
|
|
||||||
|
|
||||||
echo "Waiting $TIMEOUT seconds for node to be provisioned."
|
echo "Waiting $TIMEOUT seconds for node to be provisioned."
|
||||||
node_timeout node Ready
|
node_timeout node Ready
|
||||||
|
@ -1,43 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
export KUBECONFIG=${KUBECONFIG:-"$HOME/.airship/kubeconfig"}
|
|
||||||
export KUBECONFIG_TARGET_CONTEXT=${KUBECONFIG_TARGET_CONTEXT:-"target-cluster"}
|
|
||||||
declare -A PROFILES
|
|
||||||
|
|
||||||
PROFILES[hardwareclassification-profile1]=1
|
|
||||||
PROFILES[hardwareclassification-profile2]=0
|
|
||||||
|
|
||||||
declare -a ERRORS
|
|
||||||
|
|
||||||
# HWCC need BMH in Ready state.
|
|
||||||
for i in "${!PROFILES[@]}"
|
|
||||||
do
|
|
||||||
nodes=$(kubectl --kubeconfig $KUBECONFIG --context $KUBECONFIG_TARGET_CONTEXT get bmh --no-headers=true -l hardwareclassification.metal3.io/$i 2>/dev/null | wc -l)
|
|
||||||
|
|
||||||
if [ $nodes != ${PROFILES[$i]} ]
|
|
||||||
then
|
|
||||||
ERRORS+=($i)
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ${#ERRORS[@]} != 0 ]
|
|
||||||
then
|
|
||||||
echo FAILURE error with ${ERRORS[@]}
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "SUCCESS"
|
|
||||||
fi
|
|
@ -131,7 +131,6 @@
|
|||||||
- ./tools/deployment/33_cluster_move_target_node.sh
|
- ./tools/deployment/33_cluster_move_target_node.sh
|
||||||
- ./tools/deployment/35_deploy_worker_node.sh
|
- ./tools/deployment/35_deploy_worker_node.sh
|
||||||
- ./tools/deployment/36_deploy_workload.sh
|
- ./tools/deployment/36_deploy_workload.sh
|
||||||
- ./tools/deployment/37_verify_hwcc_profiles.sh
|
|
||||||
serve_dir: /srv/images
|
serve_dir: /srv/images
|
||||||
serve_port: 8099
|
serve_port: 8099
|
||||||
log_roles:
|
log_roles:
|
||||||
|
Loading…
Reference in New Issue
Block a user