Skip to content

harness-training-dept/KubernetesCDWorkshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 

Repository files navigation

Kubernetes Continuous Deliver Workshop Labs

Lab 1 - Login to app.harness.io and familiarize yourself with the environment

  1. Load up your Chrome web browser and login to https://app.harness.io with the username and password from your lab sheet.

  2. Click around and explore the GUI. Please note depending on the user role you have in your own organization's Harness implementation you may not have access to the menus and settings you see here in our training setup.

  3. We will be visiting the Setup menu most often. Click in there and explore the different connectors and setting options.

  4. Ask your instructor if you don't understand the use of any configuration or dashboard.

Lab 2 - Setup a basic Nginx deployment on our training cluster

  1. Click on the Setup menu in the upper right hand corner of the Harness GUI.

  2. Click on the Add Application button and fill out the information for your new application. Be sure to use your student ID in the name of your application so you can find it easily later.

Application Setup

  1. Click submit and Harness will create your new application. Now we can setup the other parts of the deployment.

  2. Click on Services to add our first service to this application, then click on the Add Service button. Give your service a name that includes your student ID (as you did with the application) and set the Deployment Type to Kubernetes.

Add Service

Click submit. That will take you to the Service Overview.

  1. In the Service Overview screen click on Add Artifact Source and select Docker Registry. For Source Server select Harness Docker Hub. This is a sample connection to the public hub.docker.com domain setup automatically for harness.io. In non-training testing environments you would most likely delete this connector. For the Docker image name put library/nginx . That will allow us to pick our nginx version when we deploy.

Artifact Source

Click submit when done. We won't be changing any of the preconfigured yaml at this time. We're just doing a simple first deployment.

  1. Click on your application name in the popcorn trail on the upper left of the Harness UI to return to your Application main screen. Then click on Environments to setup an environment to deploy to.

  2. Click Add Environment button and give your environment a name that starts with your student ID. Set the environment type to non-production.

Environment

When you click submit that will take you to the Environment Overview screen.

  1. Add an Infrastructure Definition. Give it a name that starts with your student ID. Select Kubernetes Cluster for your Cloud Provider Type, and set the deployment type to Kubernetes. Then you can select the Cloud Provider we have setup for this workshop. It will include the name of the city or state the workshop is held in. Finally for Namespace please put your Student ID so your instructor can see your deployment from the command line easily.

Infrastructure Definition

Click submit when done.

  1. Click back on your application name in the popcorn trail and then click on Workflows. Click Add Workflow.

  2. Give your workflow a name that starts with your Student ID. Select rolling deployment for your Deployment Type. Then for Environment, Service, and Infrastructure Definition be sure to pick the ones that start with your Student ID.

Workflow

When you're done. Click submit.

  1. Now we are ready to do the actual deploy! Click on the Deploy button in the upper right corner of the screen. That will bring up the Start New Deployment dialog box.

  2. Since we specified "library/nginx" as our artifact source we now have to pick which version of Nginx we wish to deploy. For our first deploy select an older version 1.9.15 for example. (We will upgrade in the next lab to the current version.)

Start New Deployment

It's a good idea for test and training deployments to select Send Notification to Me Only to avoid spamming your coworkers with test deployments. Click Submit to kick off the deployment.

  1. Harness will switch to the deployment screen. Click on each box as it appears to see what information Harness provides. Click on the Rollout Deployment box to see the results from the command line on the delegate.

Live Deployment View

Your instructor will also be displaying information from the actual cluster itself on the projector. Look up there to see your namespace appear once your deployment gets going.

Lab 3 - Upgrade your Nginx deployment to the latest version

  1. Click on Setup and go back into your Application. Then go to Deployments and click on the Deployment you just ran. In there click on the Deploy button to deploy a newer version of Nginx.

Deploy Latest

Be sure to select the most recent version of Nginx and hit submit.

  1. Once the deploy starts click on the Rollout Deployment step and verify the yaml with the latest version of Nginx.

Check Upgrade

It really can be that easy to upgrade a service!

Lab 4 - Cleanup the cluster

  1. Now we can run a deployment to delete our previous deployment and leave our training cluster neat and tidy! Go back to Setup screen in the Harness UI and select your application. We're going to create a new Workflow to delete our namespace and the pod inside it.

  2. Click on Workflows and Add Workflow. Give this workflow a different name, but be sure to include your student ID.

Cleanup Workflow

Click submit.

  1. By default Harness put a Rollout Deployment step in for us, but we don't actually need that. Hover your mouse over the Rollout Deployment stage and click the X that appears next to that step to delete it.

Remove Step

  1. Once that step is gone click on Add Step. This takes you to the Workflow step creation dialog. Click on Kubernetes and then the Delete action.

Delete Step

Click next.

  1. Tell Harness what you want the Kubernetes delete command to delete. We will hardcode our namespace, but you could also use a variable here to Delete whatever namesapce was associated with the deployment.

Configure Delete

Click Submit.

  1. Now we can run our delete deployment. Click Deploy in the upper right hand corner. Once the Deploy starts click on the Delete task to watch the command line. You can also verify with the instructor's command line on the screen.

Final Delete

  1. Pat yourself on the back! Labs complete! Job well done!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published