Deploy calico via function.
* Deploy Calico to ephemeral and target via function * Removed the condition to check node ready status in 25_deploy_ephemeral_node.sh and 30_deploy_controlplane.sh. As calico is applied at a later stage, relaxed the dependency to wait for node ready status. * updated compoiste/infra for calico manifest Change-Id: Id582aec3ca402eac02d9baa2305b562c410c1bea Relates-To: #303 Relates-To: #304
This commit is contained in:
parent
66a5dbd574
commit
b2c059087e
@ -1,10 +1,4 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ../../function/baremetal-operator
|
- ../../function/cni/calico/v3.15
|
||||||
- ../../function/capm3
|
|
||||||
- ../../function/capi
|
|
||||||
- ../../function/cabpk
|
|
||||||
- ../../function/cacpk
|
|
||||||
commonLabels:
|
|
||||||
airshipit.org/stage: initinfra
|
|
||||||
|
@ -40,7 +40,6 @@ stringData:
|
|||||||
- apt install -y kubelet=1.18.6-00 kubeadm=1.18.6-00 kubectl=1.18.6-00
|
- 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
|
- apt-mark hold docker-ce docker-ce-cli containerd.io kubelet kubeadm kubectl
|
||||||
- kubeadm init --config /tmp/kubeadm.yaml
|
- 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
|
- mkdir -p /opt/metal3-dev-env/ironic/html/images
|
||||||
write_files:
|
write_files:
|
||||||
- content: |
|
- content: |
|
||||||
|
@ -41,8 +41,6 @@ spec:
|
|||||||
name: '{{ ds.meta_data.local_hostname }}'
|
name: '{{ ds.meta_data.local_hostname }}'
|
||||||
kubeletExtraArgs:
|
kubeletExtraArgs:
|
||||||
node-labels: 'metal3.io/uuid={{ ds.meta_data.uuid }}'
|
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
|
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
|
||||||
kind: Metal3MachineTemplate
|
kind: Metal3MachineTemplate
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
resources:
|
resources:
|
||||||
|
- ../../../../composite/infra
|
||||||
- ../../shared/clusterctl
|
- ../../shared/clusterctl
|
||||||
- ../../../../function/baremetal-operator
|
- ../../../../function/baremetal-operator
|
||||||
patchesStrategicMerge:
|
patchesStrategicMerge:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
resources:
|
resources:
|
||||||
|
- ../../../../composite/infra
|
||||||
- ../../shared/clusterctl
|
- ../../shared/clusterctl
|
||||||
- ../../../../function/baremetal-operator
|
- ../../../../function/baremetal-operator
|
||||||
patchesStrategicMerge:
|
patchesStrategicMerge:
|
||||||
|
@ -21,21 +21,25 @@ export KUBECONFIG=${KUBECONFIG:-"$HOME/.airship/kubeconfig"}
|
|||||||
echo "Deploy ephemeral node using redfish with iso"
|
echo "Deploy ephemeral node using redfish with iso"
|
||||||
airshipctl baremetal remotedirect --debug
|
airshipctl baremetal remotedirect --debug
|
||||||
|
|
||||||
#Wait till ephemeral node is ready
|
echo "Wait for apiserver to become available"
|
||||||
end=$(($(date +%s) + $TIMEOUT))
|
N=0
|
||||||
echo "Waiting $TIMEOUT seconds for ephemeral node to be ready."
|
MAX_RETRY=30
|
||||||
while true; do
|
DELAY=60
|
||||||
if (kubectl --request-timeout 20s --kubeconfig $KUBECONFIG get nodes ephemeral -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' | grep -q True) ; then
|
until [ "$N" -ge ${MAX_RETRY} ]
|
||||||
echo -e "\nEphemeral node is ready."
|
do
|
||||||
kubectl --request-timeout 20s --kubeconfig $KUBECONFIG get nodes
|
if timeout 20 kubectl --kubeconfig $KUBECONFIG get node; then
|
||||||
break
|
break
|
||||||
else
|
fi
|
||||||
now=$(date +%s)
|
|
||||||
if [ $now -gt $end ]; then
|
N=$((N+1))
|
||||||
echo -e "\nEphemeral node was not ready before TIMEOUT."
|
echo "$N: Retrying to reach the apiserver"
|
||||||
exit 1
|
sleep ${DELAY}
|
||||||
fi
|
|
||||||
echo -n .
|
|
||||||
sleep 15
|
|
||||||
fi
|
|
||||||
done
|
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
|
||||||
|
@ -98,8 +98,8 @@ if [ "$N" -ge ${MAX_RETRY} ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Wait for nodes to become Ready"
|
echo "List all pods"
|
||||||
kubectl --kubeconfig /tmp/targetkubeconfig wait --for=condition=Ready node --all --timeout 900s
|
kubectl --kubeconfig /tmp/targetkubeconfig get pods --all-namespaces
|
||||||
|
|
||||||
echo "Get cluster state"
|
echo "Get cluster state"
|
||||||
kubectl --kubeconfig ${HOME}/.airship/kubeconfig get cluster
|
kubectl --kubeconfig ${HOME}/.airship/kubeconfig get cluster
|
||||||
|
@ -21,14 +21,11 @@ echo "Switch context to target cluster and set manifest"
|
|||||||
airshipctl config use-context target-cluster-admin@target-cluster
|
airshipctl config use-context target-cluster-admin@target-cluster
|
||||||
airshipctl config set-context target-cluster-admin@target-cluster --manifest dummy_manifest
|
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
|
# TODO remove taint
|
||||||
kubectl --kubeconfig $KUBECONFIG taint node node01 node-role.kubernetes.io/master-
|
kubectl --kubeconfig $KUBECONFIG taint node node01 node-role.kubernetes.io/master-
|
||||||
|
|
||||||
echo "Deploy infra to cluster"
|
echo "Deploy infra to cluster"
|
||||||
airshipctl phase apply initinfra --debug --wait-timeout 1000s
|
airshipctl phase apply initinfra --debug --wait-timeout 1000s
|
||||||
|
|
||||||
|
echo "List all pods"
|
||||||
kubectl --kubeconfig $KUBECONFIG get pods --all-namespaces
|
kubectl --kubeconfig $KUBECONFIG get pods --all-namespaces
|
||||||
|
Loading…
x
Reference in New Issue
Block a user