Deploying via kubernetes/contrib/ansible
See: https://github.com/nds-org/ndslabs-deploy-tools
More details: https://opensource.ncsa.illinois.edu/jira/browse/NDS-312
We've forked contrib/ansible and modified it slightly, before wrapping it in our own set of playbooks for deploying Labs.
These Ansible scripts are currently specific to NCSA / SDSC, but with little manual effort can be expanded to accommodate other OpenStack installations at other sites.
Deploying via kube-up.sh
See: https://kubernetes.io/docs/getting-started-guides/openstack-heat/
Features:
- Creates an Auto-Scaling Kubernetes using Openstack Heat
Usage
- docker run -it -v /home/core/private:/private bodom0015/k8-openstack-cli:NDS-767
- source /private/NDSLabsDev-openrc.sh
- Enter password
- ssh-keygen -t rsa
- Accept all defaults
- export KUBERNETES_PROVIDER='openstack-heat'; curl -sS https://get.k8s.io | bash && export PATH=$PATH:/kubernetes/client/bin/
- export EXTERNAL_NETWORK=ext-net FIXED_NETWORK_CIDR=192.168.100.0/24
- export MASTER_FLAVOR=m1.medium MINION_FLAVOR=m1.large
- export STACK_NAME=kubernetes
- export KUBERNETES_PROVIDER=openstack-heat && cd /kubernetes && ./cluster/kube-up.sh
This will create a stack named kubernetes under the Horizon dashboard's Orchestration → Stacks view. Here, you can check the progress of the creation task by choosing a Stack and viewing its Resources tab.
The whole process takes about 10 minutes to finish. You should see instances being spun up in the project's Compute → Instances view.
You should see the following output:
[root@34268c72ab27 kubernetes]# export KUBERNETES_PROVIDER=openstack-heat && cd /kubernetes && ./cluster/kube-up.sh ... Starting cluster using provider: openstack-heat ... calling verify-prereqs swift client installed glance client installed nova client installed heat client installed openstack client installed ... calling verify-kube-binaries ... calling kube-up kube-up for provider openstack-heat [INFO] Execute commands to create Kubernetes cluster [INFO] Uploading kubernetes-server-linux-amd64.tar.gz kubernetes-server.tar.gz [INFO] Uploading kubernetes-salt.tar.gz kubernetes-salt.tar.gz [INFO] Image CentOS7 already exists ERROR (CommandError): No keypair with a name or ID of 'kubernetes_keypair' exists. [INFO] Key pair created Stack not found: kubernetes [INFO] Retrieve new image ID [INFO] Image Id 682f4eb3-97e3-4ebd-88fa-bf9b563bbd2d [INFO] Create stack kubernetes +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | id | f26624a4-eca6-4fed-b0da-40f5b5ae64e9 | | stack_name | kubernetes | | description | Kubernetes cluster with one master and one or more worker nodes (as specified by the number_of_minions parameter, which defaults to 3). | | | | | creation_time | 2017-03-15T16:52:09Z | | updated_time | None | | stack_status | CREATE_IN_PROGRESS | | stack_status_reason | | +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ ... calling validate-cluster Cluster status CREATE_IN_PROGRESS Cluster status CREATE_IN_PROGRESS Cluster status CREATE_IN_PROGRESS Cluster status CREATE_IN_PROGRESS Cluster status CREATE_IN_PROGRESS Cluster status CREATE_IN_PROGRESS Cluster status CREATE_IN_PROGRESS Cluster status CREATE_IN_PROGRESS Cluster status CREATE_IN_PROGRESS Cluster status CREATE_IN_PROGRESS Cluster status CREATE_IN_PROGRESS Cluster status CREATE_IN_PROGRESS Cluster status CREATE_IN_PROGRESS