diff --git a/docs/02-certificate-authority.md b/docs/02-certificate-authority.md index c33e51a..ebdce05 100644 --- a/docs/02-certificate-authority.md +++ b/docs/02-certificate-authority.md @@ -137,6 +137,12 @@ KUBERNETES_PUBLIC_ADDRESS=$(aws elb describe-load-balancers \ jq -r '.LoadBalancerDescriptions[].DNSName') ``` +#OpenStack + +``` +KUBERNETES_PUBLIC_ADDRESS=$(openstack server show controller0 -f shell |grep addresses | awk '{print $2}'| sed 's/"$//') +``` + --- Create the `kubernetes-csr.json` file: @@ -239,3 +245,30 @@ for host in ${KUBERNETES_HOSTS[*]}; do ubuntu@${PUBLIC_IP_ADDRESS}:~/ done ``` + +### OpenStack +Since only controller0 has a public IP, you will need to SCP controller0 and then scp it to the remaining 5 hosts from there. + +Copy to controller0: + +``` + scp ca.pem kubernetes-key.pem kubernetes.pem \ + ubuntu@${KUBERNETES_PUBLIC_ADDRESS}:~/ +``` + +Now SSH to controller0. + +Set the list of Kubernetes hosts where the certs should be copied to: + +``` +KUBERNETES_HOSTS=(10.240.0.10 10.240.0.11 10.240.0.12 10.240.0.20 10.240.0.21 10.240.0.22) +``` + +And then copy the TLS certs: + +``` +for host in ${KUBERNETES_HOSTS[*]}; do + scp ca.pem kubernetes-key.pem kubernetes.pem \ + ubuntu@${KUBERNETES_HOSTS}:~/ +done +``` diff --git a/docs/03-etcd.md b/docs/03-etcd.md index f64271a..f84a0d0 100644 --- a/docs/03-etcd.md +++ b/docs/03-etcd.md @@ -101,7 +101,7 @@ INTERNAL_IP=$(curl -s -H "Metadata-Flavor: Google" \ http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip) ``` -#### AWS +#### AWS / OpenStack ``` INTERNAL_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4) diff --git a/docs/04-kubernetes-controller.md b/docs/04-kubernetes-controller.md index 46e31d6..8d62ba0 100644 --- a/docs/04-kubernetes-controller.md +++ b/docs/04-kubernetes-controller.md @@ -132,7 +132,7 @@ INTERNAL_IP=$(curl -s -H "Metadata-Flavor: Google" \ http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip) ``` -#### AWS +#### AWS / OpenStack ``` INTERNAL_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4) diff --git a/docs/06-kubectl.md b/docs/06-kubectl.md index c75b17b..38881c3 100644 --- a/docs/06-kubectl.md +++ b/docs/06-kubectl.md @@ -36,6 +36,13 @@ KUBERNETES_PUBLIC_ADDRESS=$(aws elb describe-load-balancers \ --load-balancer-name kubernetes | \ jq -r '.LoadBalancerDescriptions[].DNSName') ``` + +#OpenStack + +``` +KUBERNETES_PUBLIC_ADDRESS=$(openstack server show controller0 -f shell |grep addresses | awk '{print $2}'| sed 's/"$//') +``` + --- Recall the token we setup for the admin user: diff --git a/docs/07-network.md b/docs/07-network.md index 5b99809..cbd73f9 100644 --- a/docs/07-network.md +++ b/docs/07-network.md @@ -118,3 +118,18 @@ aws ec2 create-route \ --destination-cidr-block 10.200.2.0/24 \ --instance-id ${WORKER_2_INSTANCE_ID} ``` + +### OpenStack + +``` +openstack router set --route destination=10.200.0.0/24,gateway=10.240.0.20 kubernetes +``` + +``` +openstack router set --route destination=10.200.1.0/24,gateway=10.240.0.21 kubernetes +``` + +``` +openstack router set --route destination=10.200.2.0/24,gateway=10.240.0.22 kubernetes +``` + diff --git a/docs/09-smoke-test.md b/docs/09-smoke-test.md index a812108..2edc02b 100644 --- a/docs/09-smoke-test.md +++ b/docs/09-smoke-test.md @@ -79,6 +79,25 @@ NODE_PUBLIC_IP=$(aws ec2 describe-instances \ jq -j '.Reservations[].Instances[].PublicIpAddress') ``` +#### OpenStack + +``` +openstack security group rule create \ + --ingress \ + --protocol tcp \ + --dst-port ${NODE_PORT} \ + --src-ip 0.0.0.0/0 \ + kubernetes + +``` + +Add an `EXTERNAL_IP` for one of the worker nodes: + +``` +NODE_PUBLIC_IP=169.45.x.x +openstack server add floating ip worker0 ${NODE_PUBLIC_IP} +``` + --- Test the nginx service using cURL: diff --git a/docs/10-cleanup.md b/docs/10-cleanup.md index 452b58a..8323786 100644 --- a/docs/10-cleanup.md +++ b/docs/10-cleanup.md @@ -205,3 +205,32 @@ DHCP_OPTION_SET_ID=$(aws ec2 describe-dhcp-options \ aws ec2 delete-dhcp-options \ --dhcp-options-id ${DHCP_OPTION_SET_ID} ``` + +## OpenStack + +### Virtual Machines + +``` +openstack server delete \ + controller0 controller1 controller2 \ + worker0 worker1 worker2 +``` + +### Networking + +``` + openstack security group delete kubernetes +``` + +``` +openstack subnet delete kubernetes +``` + +``` +openstack network delete kubernetes +``` + +``` +openstack router delete kubernetes +``` +