Skip to content

Commit

Permalink
Merge branch 'master' of github.com:CiscoCloud/mantl-devnet-learninglabs
Browse files Browse the repository at this point in the history
  • Loading branch information
metahertz committed Apr 8, 2019
2 parents ea91c10 + 2c168ea commit ae06694
Show file tree
Hide file tree
Showing 39 changed files with 332 additions and 322 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

These self-paced interactive tutorials provide instructions for developers to deploy applications in Marathon, which is running inside of Mesos (as a Mesos framework).

We write these labs for display within the [Cisco DevNet Learning Labs system](https://learninglabs.cisco.com).
We write these labs for display within the [Cisco DevNet Learning Labs system](https://developer.cisco.com/learning).

Contributions are welcome, and we are glad to review changes through pull requests. See [contributing.md](contributing.md) for details.

Expand Down
49 changes: 24 additions & 25 deletions labs/CiscoContainerPlatform-101/1.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Cisco Container Platform 101
# Cisco Container Platform Introduction

## Objectives

This learning lab will introduce you to the Cisco Container Platform product, it's interface, API's and product benefits.
The lab will use Cisco Container Platform API's to simply create, provision and manage Kubernetes clusters on premise, giving the same "Kubernetes as a Service" user experience as public-cloud kubernetes offerings.
This Learning Lab introduces you to the Cisco Container Platform product, it's interface, API's and product benefits.
The lab will use Cisco Container Platform API's to simply create, provision and manage Kubernetes clusters on premise, giving the same "Kubernetes as a Service" user experience as public-cloud Kubernetes offerings.

We then use your new Kubernetes cluster to deploy a containerised application onto Kubernetes, with storage persistence.
We then use your new Kubernetes cluster to deploy a containerized application onto Kubernetes, with storage persistence.

# Audience

Expand All @@ -19,26 +19,26 @@ Cisco Container Platform is a new product, aimed at making the delivery of an on

Specifically;

- IT teams should not need to specialise in Kubernetes internals to provide Kubernetes services to their development teams.
- IT teams should not need to specialize in Kubernetes internals to provide Kubernetes services to their development teams.
- Creation and Maintenance of Kubernetes clusters should be automated and API driven.
- The end result should be native kubernetes access for the end developers, not custom tooling.
- The end result should be native Kubernetes access for the end developers, not custom tooling.
- The solution should provide validated, previously tested clusters and configurations, with regular releases and updates.

![](assets/images/adminuser-cpp-admin-clusters-view.png)

With Cisco Container Platform, your IT teams can tie self-service provisioning of multiple Kubernetes clusters into their existing management tooling; or use the Container Platform UI to create a "**Kubernetes as a Service**" layer for your Organization, while benefiting from the known-cost and data sovereignty aspects of on-premise workloads.

Also, because Cisco Container Platform produces "Vanilla" Kubernetes clusters, your DevOps teams can write truly cross-environment automation utilising the Kubernetes API, making the consumption of multiple public and private environments a much less daunting task.
Also, because Cisco Container Platform produces "Vanilla" Kubernetes clusters, your DevOps teams can write truly cross-environment automation utilizing the Kubernetes API, making the consumption of multiple public and private environments a much less daunting task.

![](assets/images/CCP-SIMPLE-101.png)

# What is HyperFlex?

As with any cloud provider, API's are the key to solid automation, making self service for multiple users possible.

Cisco Hyperflex brings this concept on-premise, with a single server SKU that clusters to provide scale-out compute, storage and networking in a single product.
Cisco HyperFlex brings this concept on-premise, with a single server SKU that clusters to provide scale-out compute, storage and networking in a single product.

Hyperflex servers, powered by Cisco UCS management give a perfect production-tested base on which to build an on-premise Kubernetes as a Service solution, with all the API's needed to allow Cisco Container Platform to manage the creation and updates of your tenant Kubernetes clusters.
HyperFlex servers, powered by Cisco UCS management give a perfect production-tested base on which to build an on-premise Kubernetes as a Service solution, with all the API's needed to allow Cisco Container Platform to manage the creation and updates of your tenant Kubernetes clusters.

HyperFlex servers, powered by Cisco UCS Management give a production-tested base on which to build an on-premises **Kubernetes as a Service** solution, with all the APIs needed to allow Cisco Container Platform to manage the creation and updates of your tenant Kubernetes clusters.

Expand All @@ -50,12 +50,11 @@ HyperFlex storage is also resilient across the servers in the HyperFlex pool, al

Let's dig in!

# Step 0 - Access the Cisco Container Platform sandbox!
## First - Access the Cisco Container Platform sandbox!

Firstly, we'll need a Cisco Container Platform environment, luckily we have plenty of these in the DEVNET sandbox, allowing you to reserve access to a CCP environment for upto 7 days, more than enough time to explore!
Firstly, we'll need a Cisco Container Platform environment, luckily we have plenty of these in the DEVNET sandbox, allowing you to reserve access to a CCP environment for up to 7 days, more than enough time to explore!


### Step 1 - Reserve a Cisco Container Platform sandbox.
### Reserve a Cisco Container Platform sandbox.
For this we will use the "Cisco Container Platform DEVNET Sandbox", this environment will provide access to a pre-installed Cisco Container Platform cluster, serving as our "On premise" setup for this Lab.

Go to [https://devnetsandbox.cisco.com](https://devnetsandbox.cisco.com/RM/Diagram/Index/6f419def-1813-481f-a6c6-a469993d4bb0?diagramType=Topology), login and reserve the "Cisco Container Platform v2.2.2" sandbox for 2 hours.
Expand All @@ -68,8 +67,8 @@ Click `RESERVE`

Click `RESERVE` once more.

### Step 2 - Access Cisco Container Platform.
The Sandbox environment will take ~8 mins to spin up, it creates a fresh installation of Cisco Container Platform for each user and will E-Mail you VPN credentials when ready. Using the VPN lets us remotely access a private on-premise lab environment.
### Access Cisco Container Platform.
The Sandbox environment will take ~8 mins to spin up, it creates a fresh installation of Cisco Container Platform for each user and will email you VPN credentials when ready. Using the VPN lets us remotely access a private on-premise lab environment.

The E-Mail also contains instructions for installing the AnyConnect VPN client if you do not already have it; however the classroom workstations already have this installed.

Expand Down Expand Up @@ -104,29 +103,29 @@ In a new lab environment, you will have a single cluster pre-created `Sandbox-De

![](assets/images/ccp-cluster-details.png)

Click on `DOWNLOAD TOKEN` to download the authentication file for the existing Kubernetes cluster, then click on `KUBERNETES DASHBOARD` to view the Kubernetes Dashboard, you'll need to authenticate by pointing to the auth file you've just downloaded:
Click on `DOWNLOAD KUBECONFIG` to download the authentication file for the existing Kubernetes cluster, then click on `KUBERNETES DASHBOARD` to view the Kubernetes Dashboard, you'll need to authenticate by pointing to the auth file you've just downloaded:

![](/posts/files/CiscoContainerPlatform-101/assets/images/ccp-cluster-k8s-auth.png)
![](assets/images/ccp-cluster-k8s-auth.png)

As you can see, we're directly into a vanilla Kubernetes cluster, we'll see how to create more clusters for more teams and tenants later in this learning lab!
As you can see, we're directly into a vanilla Kubernetes cluster, we'll see how to create more clusters for more teams and tenants later in this Learning Lab!

![](/posts/files/CiscoContainerPlatform-101/assets/images/initial-k8s-dash.png)
![](assets/images/initial-k8s-dash.png)

## C. Cisco Container Platform permissions.
## C. Cisco Container Platform permissions

There are two types of access currently implemented in Cisco Container Platform, `admin` users can create and view all clusters, and `DevOps` users that can only see the clusters they have been assigned; your sandbox has provided you an 'admin' user, so you are able to create clusters and see the existing `Sandbox-Demo-Cluster-1`
There are two types of access currently implemented in Cisco Container Platform, `admin` users can create and view all clusters, and `user` users that can only see the clusters they have been assigned; your sandbox has provided you an 'admin' user, so you are able to create clusters and see the existing `Sandbox-Demo-Cluster-1`.

A "DevOps" style user called `User1234` could be configured to only see a specific cluster or subset of clusters, as in the screenshots below showing an admin and a devops user viewing the same Cisco Container Platform UI;
A "DevOps" style user called `User1234` could be configured to only see a specific cluster or subset of clusters, as in the screenshots below showing an `admin` and a `user` user type viewing the same Cisco Container Platform UI;

DevOps user 1234 logged in:
Devops user 1234 logged in:
![](assets/images/1234user-cpp-clusters-view.png)

Admin user logged in will see all clusters:
![](assets/images/adminuser-cpp-admin-clusters-view.png)

## D. See the underlying infrastructure - OPTIONAL

Cisco Container Platform and Hyperflex currently uses VMWare VCenter for it's virtual machine management, you can log into the VCenter for this environment to see the Cisco Container Platform virtual machines and observe provisioning actions as we follow this lab.
Cisco Container Platform and HyperFlex currently uses VMWare VCenter for its virtual machine management, you can log into the VCenter for this environment to see the Cisco Container Platform virtual machines and observe provisioning actions as we follow this lab.

Open [THIS LINK (https://10.10.20.12/ui/)](https://10.10.20.12/ui/) in a new tab to see the vSphere UI, and log on with the following details:

Expand All @@ -142,4 +141,4 @@ At the bottom of the page, you will also be able to see recent events which Cisc
![](assets/images/1234user-vsphere-events.png)

# Next Steps!
Next, lets have a quick look over some of the other features and configuration options of Cisco Container Platform. Click the right arrow to continue!
Next, let's have a quick look over some of the other features and configuration options of Cisco Container Platform. Click the right arrow to continue.
50 changes: 24 additions & 26 deletions labs/CiscoContainerPlatform-101/2.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
Cisco Container Platform 101

# 2. Provider Settings and VIP Pools
# Step 2: Provider Settings and VIP Pools

Clicking around the Cisco Cloud Platform UI, you'll notice a menu to the left.
Here, an admin can configure users and groups (including Active Directory login authentication, allowing access to clusters based on the users AD group.) and also define VIP pools under `Networks` > `Default Network`.
Here, an admin can configure users and groups, including Active Directory login authentication, allowing access to clusters based on the users AD group. You can also define VIP pools under `Networks` > `Default Network`.

VIP pools allow an administrator to define a "real world" range of IP addresses that clusters can use to integrate with the existing IT or Enterprise environment, each cluster can be created with a specific VIP pool, and Cisco Container Platform will manage allocations of addresses from that pool to each Kubernetes cluster when a developer requests an "external" IP, such as creating `LoadBalancer` service or `Ingress` style kubernetes objects.
VIP pools allow an administrator to define a "real world" range of IP addresses that clusters can use to integrate with the existing IT or Enterprise environment, each cluster can be created with a specific VIP pool, and Cisco Container Platform will manage allocations of addresses from that pool to each Kubernetes cluster when a developer requests an "external" IP, such as creating `LoadBalancer` service or `Ingress` style Kubernetes objects.

Notice in the Cluster details page, a VIP has already been assigned to the Master node of your cluster, allowing access to the Kubernetes dashboard in your sandbox. The POD IP addresses used within the cluster are all internal and do not interact with any external networks; these have been configured on 192.168.0.0/16 for your cluster.

![](assets/images/cpp-vippools.png)

# 3. Cisco Container Platform APIs
Each Cisco Container platform installation comes with integrated API documentation, powered by Swagger.
You can access this [HERE (https://10.10.20.110/2/swaggerapi/)](https://10.10.20.110/2/swaggerapi/), where you will see all the currently supported platform API's.
Each Cisco Container platform installation comes with integrated Open API documentation, powered by Swagger.
You can access this [HERE (https://10.10.20.110/2/swaggerapi/)](https://10.10.20.110/2/swaggerapi/), where you will see all the currently supported platform APIs.

Click on `List Operations` to see titles, then `Expand Operations` to expand the subsections ready to use the API's in the next section; in this Lab, we're going to use the `/2/system` and `/2/clusters` sections, so expand those;

![](assets/images/expand_swagger_1.png)

## Authenticate to the API
The swagger UI will remember our authentication token once we use the `/2/system/login` API call, so that all other API's on the swagger page will work.
The Swagger UI will remember our authentication token once we use the `/2/system/login` API call, so that all other API's on the page will work.

Use your Cisco Container Platform credentials `User: admin`, `Password: Cisco123`, expand the `/2/system/login` box and enter the username and password, then hit `Try it Out!`.
Use your Cisco Container Platform credentials `User: admin`, `Password: Cisco123`, expand the `/2/system/login` box and enter the username and password, then click `Try it Out!`.

You should see a response code of 200, if not, check your credentials and try again!
You should see a response code of 200, if not, check your credentials and try again.

![](assets/images/swagger_cluster_login.png)

## Query your clusters
We can use the API to query Cisco Container Platform for available clusters, only Clusters you have permission to see will be returned!
We can use the API to query Cisco Container Platform for available clusters. Remember that only Clusters you have permission to see will be returned.

Expand the blue "GET" API labelled `/2/clusters` and hit `Try it out!`. Because we are querying for all clusters this API call needs no parameters.

Expand All @@ -39,28 +37,28 @@ The information we get back is used by the Cisco Cloud Platform UI to show infor

We also are given the Cluster's UUID, this can be used for performing API actions against a specific cluster.

# 4. Creating a new Kubernetes Cluster with CCP.
Actually, lets create two.
## Create a new Kubernetes Cluster with CCP
Okay, let's create two Kubernetes Clusters.

Firstly, from the UI, on the clusters tab, click "New Cluster"
Firstly, from the UI, on the clusters tab, click "New Cluster".

![](assets/images/newclusterbutton.png)

You will be prompted to answer questions about your new cluster, from number of worker nodes, to where in the Hyperflex VM infrastructure it should be placed.
You will be prompted to answer questions about your new cluster, from number of worker nodes, to where in the HyperFlex VM infrastructure it should be placed.

For our sandbox, there are only one set of options for most, selection boxes. Fill in as follows...

![](assets/images/new-cluster-ui-1.png)

Click `NEXT`, Fill out page 2 as follows:

![](/posts/files/CiscoContainerPlatform-101/assets/images/new-cluster-ui-2.png)
![](assets/images/new-cluster-ui-2.png)

Click `NEXT`

New cluster page 3, Ensure on the 'Node Configuration' screen you have set `Worker Nodes` to `1`. The sandbox environment has limited resources to enable quality of service for other sandbox users and we want the cluster creation to succeed!

![](/posts/files/CiscoContainerPlatform-101/assets/images/one-worker-vm.png)
![](assets/images/one-worker-vm.png)

Set the `VM Username` to `ccpuser`

Expand All @@ -77,7 +75,7 @@ Click `NEXT` through page 4, we wont enable a private docker registry, Istio or

Next, Click `FINISH` on the summary page!

![](/posts/files/CiscoContainerPlatform-101/assets/images/new-cluster-ui-4.png)
![](assets/images/new-cluster-ui-4.png)

We will be returned to the `Clusters` page, with the new cluster we've just created in the list, of status `PROVISIONING`.

Expand All @@ -87,34 +85,34 @@ Clicking on our new cluster gives us the current provisioning status, in this ca

![](assets/images/new-cluster-ui-6.png)

If you still have the VSphere UI open (OPTIONAL), you will be able to see the platform orchestrating the new VM's needed for this Kubernetes cluster.
If you still have the VSphere UI open (OPTIONAL), you will be able to see the platform orchestrating the new VMs needed for this Kubernetes cluster.

Until the cluster is provisioned and healthy, shortcuts to access the cluster dashboard and access credentials are disabled:

![](assets/images/new-cluster-ui-7.png)

Once both master and worker read `PROVISIONED`, we can download the token via the buttons in the screenshot above and also open the Kubernetes Dashboard.

# 5. Access Your Kubernetes Cluster, by UI.
## Access Your Kubernetes Cluster, by UI
Just like our previous cluster we accessed, If you click on your cluster within the Cisco Cloud Platform UI, you will see a number of buttons at the right hand side. Click on `DOWNLOAD KUBECONFIG`, this will provide you a "Kubernetes Environment" file, which provides authentication to access your Kubernetes Cluster.

![](assets/images/1234user-cluster-build-success.png)

Now you can auth to the Kubernetes dashboard using the `DASHBOARD` button and see your freshly built cluster.
Now you can auth to the Kubernetes dashboard using the `DASHBOARD` button and see your freshly-built cluster.

![](assets/images/kubernetes-dashboard-auth.png)

Wether accessing kubernetes via the dashboard UI, API or `kubectl` CLI, authentication is needed.
Wether accessing Kubernetes via the dashboard UI, API or `kubectl` CLI, authentication is needed.

Choose `Kubeconfig` (default) and select the authentication file you just downloaded.

![](assets/images/select-k8s-token.png)

Then you will be given access to your clusters Dashboard!
Then you will be given access to your clusters Dashboard.

![](assets/images/kubernetes-dashboard.png)

Lets rip this cluster down before we continue!
Click "Delete" from within the cluster details screen to ensure we have enough resources in the sandbox for the API cluster!
Let's rip this cluster down before we continue! Click "Delete" from within the cluster details screen to ensure we have enough resources in the sandbox for the API cluster.

# Next Steps!
Next, Create another cluster from the API and deploy some applications! Click the right arrow to continue!
Next, create another cluster from the API and deploy some applications! Click the right arrow to continue.
Loading

0 comments on commit ae06694

Please sign in to comment.