Gate/Dev: enable compute kit to be deployed from outwidth the cluster
This PS updates the deplyment script for the compute-kit to allow use from outside the k8s cluster. Change-Id: Ie758b3c3c6b36c1882030c9a1be1b2ba6cc13ed4 Signed-off-by: Pete Birley <pete@port.direct>
This commit is contained in:
parent
74da069530
commit
c9f425f269
@ -31,7 +31,39 @@ pod:
|
|||||||
scheduler: 1
|
scheduler: 1
|
||||||
novncproxy: 1
|
novncproxy: 1
|
||||||
EOF
|
EOF
|
||||||
if [ "x$(systemd-detect-virt)" == "xnone" ]; then
|
|
||||||
|
function kvm_check () {
|
||||||
|
POD_NAME="tmp-$(cat /dev/urandom | env LC_CTYPE=C tr -dc a-z | head -c 5; echo)"
|
||||||
|
cat <<EOF | kubectl apply -f - 1>&2;
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: ${POD_NAME}
|
||||||
|
spec:
|
||||||
|
hostPID: true
|
||||||
|
restartPolicy: Never
|
||||||
|
containers:
|
||||||
|
- name: util
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
image: docker.io/busybox:latest
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
nsenter -t1 -m -u -n -i -- sh -c "kvm-ok >/dev/null && echo yes || echo no"
|
||||||
|
EOF
|
||||||
|
end=$(($(date +%s) + 900))
|
||||||
|
until kubectl get pod/${POD_NAME} -o go-template='{{.status.phase}}' | grep -q Succeeded; do
|
||||||
|
now=$(date +%s)
|
||||||
|
[ $now -gt $end ] && echo containers failed to start. && \
|
||||||
|
kubectl get pod/${POD_NAME} -o wide && exit 1
|
||||||
|
done
|
||||||
|
kubectl logs pod/${POD_NAME}
|
||||||
|
kubectl delete pod/${POD_NAME} 1>&2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "x$(kvm_check)" == "xyes" ]; then
|
||||||
echo 'OSH is not being deployed in virtualized environment'
|
echo 'OSH is not being deployed in virtualized environment'
|
||||||
helm upgrade --install nova ./nova \
|
helm upgrade --install nova ./nova \
|
||||||
--namespace=openstack \
|
--namespace=openstack \
|
||||||
@ -49,10 +81,39 @@ else
|
|||||||
${OSH_EXTRA_HELM_ARGS_NOVA}
|
${OSH_EXTRA_HELM_ARGS_NOVA}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#NOTE: Deploy neutron
|
#NOTE: Deploy neutron, for simplicity we will assume the default route device
|
||||||
#NOTE(portdirect): for simplicity we will assume the default route device
|
|
||||||
# should be used for tunnels
|
# should be used for tunnels
|
||||||
NETWORK_TUNNEL_DEV="$(sudo ip -4 route list 0/0 | awk '{ print $5; exit }')"
|
function network_tunnel_dev () {
|
||||||
|
POD_NAME="tmp-$(cat /dev/urandom | env LC_CTYPE=C tr -dc a-z | head -c 5; echo)"
|
||||||
|
cat <<EOF | kubectl apply -f - 1>&2;
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: ${POD_NAME}
|
||||||
|
spec:
|
||||||
|
hostNetwork: true
|
||||||
|
restartPolicy: Never
|
||||||
|
containers:
|
||||||
|
- name: util
|
||||||
|
image: docker.io/busybox:latest
|
||||||
|
command:
|
||||||
|
- 'ip'
|
||||||
|
- '-4'
|
||||||
|
- 'route'
|
||||||
|
- 'list'
|
||||||
|
- '0/0'
|
||||||
|
EOF
|
||||||
|
end=$(($(date +%s) + 900))
|
||||||
|
until kubectl get pod/${POD_NAME} -o go-template='{{.status.phase}}' | grep -q Succeeded; do
|
||||||
|
now=$(date +%s)
|
||||||
|
[ $now -gt $end ] && echo containers failed to start. && \
|
||||||
|
kubectl get pod/${POD_NAME} -o wide && exit 1
|
||||||
|
done
|
||||||
|
kubectl logs pod/${POD_NAME} | awk '{ print $5; exit }'
|
||||||
|
kubectl delete pod/${POD_NAME} 1>&2;
|
||||||
|
}
|
||||||
|
|
||||||
|
NETWORK_TUNNEL_DEV="$(network_tunnel_dev)"
|
||||||
tee /tmp/neutron.yaml << EOF
|
tee /tmp/neutron.yaml << EOF
|
||||||
network:
|
network:
|
||||||
interface:
|
interface:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user