mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-22 07:01:12 +02:00
This reverts commit 11f8392e53986da6c124037ffab06064ec04aedd. Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
56 lines
1.4 KiB
Bash
Executable File
56 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eou pipefail
|
|
|
|
## If we take longer than 5m in docker, we're probably boned anyways
|
|
TIMEOUT=300
|
|
|
|
run() {
|
|
docker run \
|
|
--rm \
|
|
--interactive \
|
|
--net=integration \
|
|
--entrypoint=bash \
|
|
--mount type=bind,source=${TMP},target=${TMP} \
|
|
--mount type=bind,source=${PWD}/hack/dev/manifests,target=/manifests \
|
|
-v ${OSCTL}:/bin/osctl:ro \
|
|
-e KUBECONFIG=${KUBECONFIG} \
|
|
-e TALOSCONFIG=${TALOSCONFIG} \
|
|
k8s.gcr.io/hyperkube:${KUBERNETES_VERSION} -c "${1}"
|
|
}
|
|
|
|
${OSCTL} cluster create --name integration
|
|
${OSCTL} config target 10.5.0.2
|
|
|
|
## Fetch kubeconfig
|
|
run "timeout=\$((\$(date +%s) + ${TIMEOUT}))
|
|
until osctl kubeconfig > ${KUBECONFIG}
|
|
do
|
|
if [[ \$(date +%s) -gt \$timeout ]]
|
|
then
|
|
exit 1
|
|
fi
|
|
sleep 2
|
|
done"
|
|
|
|
## Wait for all nodes to report in
|
|
run "timeout=\$((\$(date +%s) + ${TIMEOUT}))
|
|
until kubectl get nodes -o json | jq '.items | length' | grep 4 >/dev/null
|
|
do
|
|
if [[ \$(date +%s) -gt \$timeout ]]
|
|
then
|
|
exit 1
|
|
fi
|
|
kubectl get nodes -o wide
|
|
sleep 5
|
|
done"
|
|
|
|
## Deploy needed manifests
|
|
run "kubectl apply -f /manifests/psp.yaml -f /manifests/flannel.yaml -f /manifests/coredns.yaml"
|
|
|
|
## Wait for all nodes ready
|
|
run "kubectl wait --timeout=${TIMEOUT}s --for=condition=ready=true --all nodes"
|
|
|
|
## Verify that we have an HA controlplane
|
|
run "kubectl get nodes -l node-role.kubernetes.io/master='' -o json | jq '.items | length' | grep 3 >/dev/null"
|