diff --git a/manifests/composite/infra/kustomization.yaml b/manifests/composite/infra/kustomization.yaml index b8533ea59..225cf7ec9 100644 --- a/manifests/composite/infra/kustomization.yaml +++ b/manifests/composite/infra/kustomization.yaml @@ -1,10 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - ../../function/baremetal-operator - - ../../function/capm3 - - ../../function/capi - - ../../function/cabpk - - ../../function/cacpk -commonLabels: - airshipit.org/stage: initinfra + - ../../function/cni/calico/v3.15 diff --git a/manifests/function/ephemeral/secret.yaml b/manifests/function/ephemeral/secret.yaml index 40b33ceee..9edc08825 100644 --- a/manifests/function/ephemeral/secret.yaml +++ b/manifests/function/ephemeral/secret.yaml @@ -40,7 +40,6 @@ stringData: - apt install -y kubelet=1.18.6-00 kubeadm=1.18.6-00 kubectl=1.18.6-00 - apt-mark hold docker-ce docker-ce-cli containerd.io kubelet kubeadm kubectl - kubeadm init --config /tmp/kubeadm.yaml - - kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f https://docs.projectcalico.org/v3.15/manifests/calico.yaml - mkdir -p /opt/metal3-dev-env/ironic/html/images write_files: - content: | diff --git a/manifests/function/k8scontrol/controlplane.yaml b/manifests/function/k8scontrol/controlplane.yaml index a21a904ac..49278ba86 100644 --- a/manifests/function/k8scontrol/controlplane.yaml +++ b/manifests/function/k8scontrol/controlplane.yaml @@ -41,8 +41,6 @@ spec: name: '{{ ds.meta_data.local_hostname }}' kubeletExtraArgs: node-labels: 'metal3.io/uuid={{ ds.meta_data.uuid }}' - postKubeadmCommands: - - kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f https://docs.projectcalico.org/v3.15/manifests/calico.yaml --- apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: Metal3MachineTemplate diff --git a/manifests/site/test-site/ephemeral/initinfra/kustomization.yaml b/manifests/site/test-site/ephemeral/initinfra/kustomization.yaml index 7493021a0..345b516e6 100644 --- a/manifests/site/test-site/ephemeral/initinfra/kustomization.yaml +++ b/manifests/site/test-site/ephemeral/initinfra/kustomization.yaml @@ -1,4 +1,5 @@ resources: + - ../../../../composite/infra - ../../shared/clusterctl - ../../../../function/baremetal-operator patchesStrategicMerge: diff --git a/manifests/site/test-site/target/initinfra/kustomization.yaml b/manifests/site/test-site/target/initinfra/kustomization.yaml index 7493021a0..345b516e6 100644 --- a/manifests/site/test-site/target/initinfra/kustomization.yaml +++ b/manifests/site/test-site/target/initinfra/kustomization.yaml @@ -1,4 +1,5 @@ resources: + - ../../../../composite/infra - ../../shared/clusterctl - ../../../../function/baremetal-operator patchesStrategicMerge: diff --git a/tools/deployment/25_deploy_ephemeral_node.sh b/tools/deployment/25_deploy_ephemeral_node.sh index 9583575ba..5fb66f5bf 100755 --- a/tools/deployment/25_deploy_ephemeral_node.sh +++ b/tools/deployment/25_deploy_ephemeral_node.sh @@ -21,21 +21,25 @@ export KUBECONFIG=${KUBECONFIG:-"$HOME/.airship/kubeconfig"} echo "Deploy ephemeral node using redfish with iso" airshipctl baremetal remotedirect --debug -#Wait till ephemeral node is ready -end=$(($(date +%s) + $TIMEOUT)) -echo "Waiting $TIMEOUT seconds for ephemeral node to be ready." -while true; do - if (kubectl --request-timeout 20s --kubeconfig $KUBECONFIG get nodes ephemeral -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' | grep -q True) ; then - echo -e "\nEphemeral node is ready." - kubectl --request-timeout 20s --kubeconfig $KUBECONFIG get nodes - break - else - now=$(date +%s) - if [ $now -gt $end ]; then - echo -e "\nEphemeral node was not ready before TIMEOUT." - exit 1 - fi - echo -n . - sleep 15 - fi +echo "Wait for apiserver to become available" +N=0 +MAX_RETRY=30 +DELAY=60 +until [ "$N" -ge ${MAX_RETRY} ] +do + if timeout 20 kubectl --kubeconfig $KUBECONFIG get node; then + break + fi + + N=$((N+1)) + echo "$N: Retrying to reach the apiserver" + sleep ${DELAY} done + +if [ "$N" -ge ${MAX_RETRY} ]; then + echo "Could not reach the apiserver" + exit 1 +fi + +echo "List all pods" +kubectl --kubeconfig $KUBECONFIG get pods --all-namespaces diff --git a/tools/deployment/30_deploy_controlplane.sh b/tools/deployment/30_deploy_controlplane.sh index 1c783c733..3ade911e0 100755 --- a/tools/deployment/30_deploy_controlplane.sh +++ b/tools/deployment/30_deploy_controlplane.sh @@ -98,8 +98,8 @@ if [ "$N" -ge ${MAX_RETRY} ]; then exit 1 fi -echo "Wait for nodes to become Ready" -kubectl --kubeconfig /tmp/targetkubeconfig wait --for=condition=Ready node --all --timeout 900s +echo "List all pods" +kubectl --kubeconfig /tmp/targetkubeconfig get pods --all-namespaces echo "Get cluster state" kubectl --kubeconfig ${HOME}/.airship/kubeconfig get cluster diff --git a/tools/deployment/31_deploy_initinfra_target_node.sh b/tools/deployment/31_deploy_initinfra_target_node.sh index 8ca021925..638503a9b 100755 --- a/tools/deployment/31_deploy_initinfra_target_node.sh +++ b/tools/deployment/31_deploy_initinfra_target_node.sh @@ -21,14 +21,11 @@ echo "Switch context to target cluster and set manifest" airshipctl config use-context target-cluster-admin@target-cluster airshipctl config set-context target-cluster-admin@target-cluster --manifest dummy_manifest -echo "Waiting for all control pods to come up" -kubectl --kubeconfig $KUBECONFIG wait -n kube-system --for=condition=Ready pods --selector tier=control-plane --timeout=600s -kubectl --kubeconfig $KUBECONFIG --namespace metal3 get pods --selector tier=control-plane "--output=jsonpath={.items[*].metadata.name}" - # TODO remove taint kubectl --kubeconfig $KUBECONFIG taint node node01 node-role.kubernetes.io/master- echo "Deploy infra to cluster" airshipctl phase apply initinfra --debug --wait-timeout 1000s +echo "List all pods" kubectl --kubeconfig $KUBECONFIG get pods --all-namespaces