Gate: Enable API access from VMs in the gate and development envs

This PS enables API access from VMs in the gate and development env

Change-Id: I0639e43dc88cbe8bf4cfe102320e2a8bf9025073
Depends-On: I32c8e752675b037610f77c8baee1c1636d5a032e
Signed-off-by: Pete Birley <pete@port.direct>
This commit is contained in:
Pete Birley 2018-05-13 21:35:48 -05:00
parent 966a7f08ef
commit 4ba2dec634
4 changed files with 28 additions and 2 deletions

View File

@ -29,3 +29,19 @@ sudo iptables -P FORWARD ACCEPT
# Setup masquerading on default route dev to public subnet
DEFAULT_ROUTE_DEV="$(sudo ip -4 route list 0/0 | awk '{ print $5; exit }')"
sudo iptables -t nat -A POSTROUTING -o ${DEFAULT_ROUTE_DEV} -s ${OSH_EXT_SUBNET} -j MASQUERADE
# NOTE(portdirect): Setup DNS for public endpoints
sudo docker run -d \
--name br-ex-dns-server \
--net host \
--cap-add=NET_ADMIN \
--volume /etc/kubernetes/kubelet-resolv.conf:/etc/kubernetes/kubelet-resolv.conf:ro \
--entrypoint dnsmasq \
docker.io/openstackhelm/neutron:newton \
--keep-in-foreground \
--no-hosts \
--resolv-file=/etc/kubernetes/kubelet-resolv.conf \
--address="/svc.cluster.local/${OSH_BR_EX_ADDR%/*}" \
--listen-address="${OSH_BR_EX_ADDR%/*}"
sleep 1
sudo docker top br-ex-dns-server

View File

@ -61,6 +61,7 @@ openstack stack create --wait \
--parameter image="${IMAGE_NAME}" \
--parameter ssh_key=${OSH_VM_KEY_STACK} \
--parameter cidr=${OSH_PRIVATE_SUBNET} \
--parameter dns_nameserver=${OSH_BR_EX_ADDR%/*} \
-t ./tools/gate/files/heat-basic-vm-deployment.yaml \
heat-basic-vm-deployment
@ -97,6 +98,9 @@ ssh -i ${HOME}/.ssh/osh_key cirros@${FLOATING_IP} ping -q -c 1 -W 2 ${OSH_BR_EX_
# Check the VM can reach the metadata server
ssh -i ${HOME}/.ssh/osh_key cirros@${FLOATING_IP} curl --verbose --connect-timeout 5 169.254.169.254
# Check the VM can reach the keystone server
ssh -i ${HOME}/.ssh/osh_key cirros@${FLOATING_IP} curl --verbose --connect-timeout 5 keystone.openstack.svc.cluster.local
# Check to see if cinder has been deployed, if it has then perform a volume attach.
if helm ls --short | grep -q "^cinder$"; then
INSTANCE_ID=$(openstack stack output show \

View File

@ -17,6 +17,11 @@ parameters:
type: string
default: 10.11.11.0/24
dns_nameserver:
type: comma_delimited_list
description: address of a dns nameserver reachable in your environment
default: 8.8.8.8
resources:
flavor:
type: OS::Nova::Flavor
@ -65,8 +70,7 @@ resources:
cidr:
get_param: cidr
dns_nameservers:
- 8.8.8.8
- 8.8.4.4
get_param: dns_nameserver
port_security_group:
type: OS::Neutron::SecurityGroup

View File

@ -34,6 +34,8 @@
roles:
- upgrade-host
- start-zuul-console
- disable-local-nameserver
tags:
- upgrade-host
- start-zuul-console
- disable-local-nameserver