Creating and accessing a Kubernetes cluster on OpenStack, part 1: Create the cluster

The post Creating and accessing a Kubernetes cluster on OpenStack, part 1: Create the cluster appeared first on Mirantis | The Pure Play OpenStack Company.
In honor of this week&;s Kubecon, we&8217;re bringing you information on how to get started with the Kubernetes container orchestration engine.  On Monday we explained what Kubernetes is. Now let&8217;s show you how to actually use it.
In this three part series, we&8217;ll take you through the steps to run an Nginx container on Kubernetes over OpenStack, including:

Deploying a Kubernetes cluster with Murano
Configuring OpenStack security to make a Kubernetes cluster usable from within OpenStack
Downloading and configuring the Kubernetes client
Creating a Kubernetes application
Running an application on Kubernetes

Let&8217;s get started.
Create the Kubernetes cluster with Murano
The first step is to get a cluster created. There are several ways to do that, but the easiest is to use a Murano Package. If you don&8217;t have Murano handy, you can get access to it in several ways, but the easiest is to deploy Mirantis OpenStack with Murano.
Import the Kubernetes cluster app
The first step is to get the actual Kubernetes cluster app, which is available on the OpenStack Foundation&8217;s Community App Catalog.  Follow these steps:

Log into Horizon and go to Applications->Manage->Packages.
Go to the Community App Catalog and choose Murano Apps -> Kubernetes Cluster to get the Kubernetes Cluster App.  You&8217;re looking for the URL for the package itself. In this case, that&8217;s http://storage.apps.openstack.org/apps/com.mirantis.docker.kubernetes.KubernetesCluster.zip.
Back in Horizon, click Import Package.
For the Package Source, choose URL, and add the URL from step 2, then click Next:
Murano will automatically start downloading the images it needs, then mark them for use with Murano; you won&8217;t have to do anything there but click Import and wait. To see the images downloading, choose Project->Images. If the images didn&8217;t already exist, you&8217;ll see them Saving:
Once they&8217;re finished saving, you&8217;ll see that their status has changed to Active:

Next, we&8217;ll deploying an environment that includes the Kubernetes master and minions.
Create the Kubernetes Murano environment

In Horizon, choose Applications->Browse. You should see the new app under Recent Activity.
To make things simple, click the Quick Deploy button.
Keep all the defaults, then scroll down and click Next.
Choose the Debian image and click Create.
Horizon will automatically take you to the new environment. At this point, it&8217;s been created, but not deployed:
You can add other things if you want, but for now, click Deploy This Environment. Goes through a number of steps, creating VMs, networks, security groups, and so on. You can see that on the main environment page, or by checking the logs:
When deployment is complete, you&8217;ll see the status change to Ready:
All that&8217;s great, but where do you access the cluster?  Click Latest Deployment Log to see the IP address assigned to the cluster:

Now, you&8217;ll notice that there are references to (in this case) 4 different nodes: gateway-1, kube-1, kube-2, and kube-3.  You can see these instances if you go to Project->Compute->Instances.  Notice that the Kubernetes API is running on kube-1.
In part 2, you&8217;ll actually access the cluster.
The post Creating and accessing a Kubernetes cluster on OpenStack, part 1: Create the cluster appeared first on Mirantis | The Pure Play OpenStack Company.
Quelle: Mirantis

Published by