Merge "Functionalize workers/provision"

This commit is contained in:
Zuul 2021-05-19 15:05:55 +00:00 committed by Gerrit Code Review
commit c8d9160fe2
15 changed files with 11 additions and 69 deletions

View File

@ -1,11 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../catalogues
- ../../../../../type/gating/hwccprofiles
- kubeadmconfigtemplate.yaml
- metal3machinetemplate.yaml
- machinedeployment.yaml
transformers:
- ../replacements

View File

@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- workers-env-vars.yaml
- generated-secrets.yaml

View File

@ -87,19 +87,6 @@ config:
---
apiVersion: airshipit.org/v1alpha1
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:
name: clusterctl-init-ephemeral
clusterName: ephemeral-cluster

View File

@ -12,7 +12,6 @@ phases:
- name: initinfra-target
- name: initinfra-networking-target
- name: workers-target
- name: workers-classification
- name: workload-target
---

View File

@ -1,4 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../catalogues
- ../../../../function/workers-capm3/
- nodes
transformers:
- ../../../../function/workers-capm3/replacements

View File

@ -1,5 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- workers-env-vars.yaml
- generated-secrets.yaml
- ../../../../function/workers-capm3/replacements

View File

@ -46,7 +46,6 @@
- ./tools/deployment/33_cluster_move_target_node.sh
- ./tools/deployment/35_deploy_worker_node.sh
- ./tools/deployment/36_deploy_workload.sh
- ./tools/deployment/37_verify_hwcc_profiles.sh
- name: "Run gate scripts"
include_role:

View File

@ -59,8 +59,5 @@ airshipctl phase run workers-target --debug
echo "Waiting $TIMEOUT seconds for bmh to be in ready state."
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."
node_timeout node Ready

View File

@ -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

View File

@ -131,7 +131,6 @@
- ./tools/deployment/33_cluster_move_target_node.sh
- ./tools/deployment/35_deploy_worker_node.sh
- ./tools/deployment/36_deploy_workload.sh
- ./tools/deployment/37_verify_hwcc_profiles.sh
serve_dir: /srv/images
serve_port: 8099
log_roles: