Skip to content

Commit 3f43cb5

Browse files
author
Ryan Daugherty
committed
Changed scripts to match wording in documents for part1-4
1 parent 268094b commit 3f43cb5

File tree

5 files changed

+86
-86
lines changed

5 files changed

+86
-86
lines changed

Diff for: part1.yml

+17-17
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,50 @@ parts:
44
intro: In this part we will setup a local cluster with minikube, deploy a public image from dockerhub, customize that image, and then finally deploy it inside our local cluster.
55
steps:
66

7-
- cap: Start up the cluster with minikube
8-
com: minikube start --memory 6000 --cpus 2 --kubernetes-version v1.6.0
7+
- cap: Start up the Kubernetes cluster with Minikube, giving it some extra resources.
8+
com: minikube start --memory 8000 --cpus 2 --kubernetes-version v1.6.0
99

10-
- cap: Enable addons
10+
- cap: Enable the Minikube add-ons Heapster and Ingress.
1111
com: minikube addons enable heapster; minikube addons enable ingress
1212

13-
- cap: Wait 20 seconds and view minikube dashboard
13+
- cap: Wait 20 seconds, and then view the Minikube Dashboard, a web UI for managing deployments.
1414
com: sleep 20; minikube service kubernetes-dashboard --namespace kube-system
1515

16-
- cap: Deploy the public nginx image from DockerHub
16+
- cap: Deploy the public nginx image from DockerHub into a pod. Nginx is an open source web server that will automatically download from Docker Hub if it’s not available locally.
1717
com: kubectl run nginx --image nginx --port 80
1818

19-
- cap: Create a service for deployment
19+
- cap: Create a service for deployment. This will expose the nginx pod so you can access it with a web browser.
2020
com: kubectl expose deployment nginx --type NodePort --port 80
2121

22-
- cap: Launch browser to test service
22+
- cap: Launch a web browser to test the service. The nginx welcome page displays, which means the service is up and running.
2323
com: minikube service nginx
2424

25-
- cap: Install registry
25+
- cap: Set up the cluster registry by applying a .yml manifest file.
2626
com: kubectl apply -f manifests/registry.yml
2727

28-
- cap: Wait for registry to deploy
28+
- cap: Wait for the registry to finish deploying. Note that this may take several minutes.
2929
com: kubectl rollout status deployments/registry
3030

31-
- cap: View registry UI
31+
- cap: View the registry user interface in a web browser.
3232
com: minikube service registry-ui
3333

34-
- cap: Edit the contents of applications/hello-kenzan/index.html. This will open the file with the nano editor. When finished press ctrl + x to exit and confirm save.
34+
- cap: Let’s make a change to an HTML file in the cloned project. Running the command below will open /applications/hello-kenzan/index.html in the nano text editor. Change some text inside one of the <p> tags. For example, change “Hello from Kenzan!” to “Hello from Me!”. When you’re done, press Ctrl+X to close the file, type Y to confirm the filename, and press Enter to write the changes to the file.
3535
com: nano applications/hello-kenzan/index.html
3636

37-
- cap: We will now build the image with a special name that is pointing at our cluster registry.
37+
- cap: Now let’s build an image, giving it a special name that points to our local cluster registry.
3838
com: docker build -t 127.0.0.1:30400/hello-kenzan:latest -f applications/hello-kenzan/Dockerfile applications/hello-kenzan
3939

40-
- cap: Before we can push our image we need to set up a temporary proxy. This is a container that listens on 127.0.0.1:30400 and forwads to our cluster. By default the docker client can only push to non https via localhost.
40+
- cap: We’ve built the image, but before we can push it to the registry, we need to set up a temporary proxy. By default the Docker client can only push to HTTP (not HTTPS) via localhost. To work around this, we’ll set up a container that listens on 127.0.0.1:30400 and forwards to our cluster.
4141
com: docker stop socat-registry; docker rm socat-registry; docker run -d -e "REGIP=`minikube ip`" --name socat-registry -p 30400:5000 chadmoon/socat:latest bash -c "socat TCP4-LISTEN:5000,fork,reuseaddr TCP4:`minikube ip`:30400"
4242

43-
- cap: We can now push our image.
43+
- cap: With our proxy container up and running, we can now push our image to the local repository.
4444
com: docker push 127.0.0.1:30400/hello-kenzan:latest
4545

46-
- cap: Stop the registry proxy.
46+
- cap: The proxy’s work is done, so you can go ahead and stop it.
4747
com: docker stop socat-registry;
4848

49-
- cap: Now that our image is on the cluster we can deploy the manifests
49+
- cap: With the image in our cluster registry, the last thing to do is apply the manifest to create and deploy the hello-kenzan pod based on the image.
5050
com: kubectl apply -f applications/hello-kenzan/k8s/deployment.yaml
5151

52-
- cap: View the app
52+
- cap: Launch a web browser and view the service.
5353
com: minikube service hello-kenzan

Diff for: part2.yml

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
parts:
22

33
- name: Part 2
4-
intro: In this part we will Setup Jenkins, and setup an automated job to build, push and deploy our custom appliction.
4+
intro: In this part we will Setup Jenkins, and setup an automated pipeline to build, push and deploy our custom appliction.
55
steps:
66

7-
- cap: Install Jenkins
7+
- cap: Install Jenkins, which we’ll use to create our automated CI/CD pipeline. It will take the pod a minute or two to roll out.
88
com: kubectl apply -f manifests/jenkins.yml; kubectl rollout status deployment/jenkins
99

10-
- cap: Open the Jenkins service running in our cluster. You will retrieve the admin password in the next step.
10+
- cap: Open the Jenkins UI in a web browser.
1111
com: minikube service jenkins
1212

13-
- cap: Get Jenkins admin password with the following command.
13+
- cap: Display the Jenkins admin password with the following command, and right-click to copy it. IMPORTANT: BE CAREFUL NOT TO PRESS CTRL-C TO COPY THE PASSWORD AS THIS WILL STOP THE SCRIPT.
1414
com: kubectl exec -it `kubectl get pods --selector=app=jenkins --output=jsonpath={.items..metadata.name}` cat /root/.jenkins/secrets/initialAdminPassword
1515

16-
- cap: Enter the password above into the Jenkins page and choose to install the suggested plugins.
17-
com: echo 'Enter the password above into the Jenkins page and choose to install the suggested plugins.'
16+
- cap: Switch back to the Jenkins UI. Paste the Jenkins admin password in the box and click Continue. Click Install suggested plugins and wait for the process to complete.
17+
com: echo ''
1818

19-
- cap: Create an admin user when prompted in Jenkins (or click the skip link in the lower right).
20-
com: echo 'Create an admin user when prompted in Jenkins (or click the skip link in the lower right).'
19+
- cap: Create an admin user and credentials, and click Save and Finish. (Make sure to remember these credentials as you will need them for repeated logins.) Click Start using Jenkins.
20+
com: echo ''
2121

22-
- cap: Click "New Item" and create an item with a name like "Hello-Kenzan Pipeline", choosing the type "Pipeline". Click OK.
23-
com: echo 'Click "New Item" and create an item with a name like "Hello-Kenzan Pipeline", choosing the type "Pipeline". Click OK.'
22+
- cap: We now want to create a new pipeline for use with our Hello-Kenzan app. On the left, click New Item. Enter the item name as "Hello-Kenzan Pipeline", select Pipeline, and click OK.
23+
com: echo ''
2424

25-
- cap: From pipeline configuration, scroll down to Pipeline and change the Definition selection from "Pipeline script" to "Pipeline script from SCM".
26-
com: echo 'From pipeline configuration, scroll down to Pipeline and change the Definition selection from "Pipeline script" to "Pipeline script from SCM".'
25+
- cap: Under the Pipeline section at the bottom, change the Definition to be "Pipeline script from SCM".
26+
com: echo ''
2727

28-
- cap: Set the SCM property to GIT.
29-
com: echo 'Set the SCM property to GIT.'
28+
- cap: Change the SCM to Git.
29+
com: echo ''
3030

31-
- cap: Fork the kenzanlabs repository in github and set the "Repository URL" to your fork, such as https://github.com/kenzanlabs/kubernetes-ci-cd.git. Save and run the job.
32-
com: echo 'Fork the kenzanlabs repository in github and set the "Repository URL" to your fork, such as https://github.com/kenzanlabs/kubernetes-ci-cd.git. Save and run the job.'
31+
- cap: Change the Repository URL to be the URL of your forked Git repository, such as https://github.com/[GIT USERNAME]/kubernetes-ci-cd. Click Save. On the left, click Build Now to run the new pipeline.
32+
com: echo ''
3333

34-
- cap: View updated application
34+
- cap: Now view the Hello-Kenzan application.
3535
com: minikube service hello-kenzan
3636

37-
- cap: Push a change to your fork. Run job again. View changes
37+
- cap: Push a change to your fork. Run job again. View the changes.
3838
com: minikube service hello-kenzan

Diff for: part3.yml

+21-21
Original file line numberDiff line numberDiff line change
@@ -4,65 +4,65 @@ parts:
44
intro: This part will have us setup the various applications that will present the crossword puzzle. We will run a sample etcd cluster as a cache, a pages application containing the front-end, a crossword server using mongodb, and a monitoring and scaling server application.
55
steps:
66

7-
- cap: Bootstrap etcd operator on the cluster
7+
- cap: Start the etcd operator and service on the cluster. You may notice errors showing up as it is waiting to start up the cluster. This is normal until it starts.
88
com: scripts/etcd.sh
99

10-
- cap: Run job to create etcd directory
10+
- cap: Now that we have an etcd service, we need an etcd client. The following command will set up a directory within etcd for storing key-value pairs, and then run the etcd client.
1111
com: kubectl create -f manifests/etcd-job.yml
1212

13-
- cap: Check job status
13+
- cap: Check the status of the job in step 2 to make sure it deployed.
1414
com: kubectl describe jobs/etcd-job
1515

16-
- cap: The crossword application is a multi-tier application and its services depend on each other. For our first step we will create the 3 services ahead of time so that the deployments are already aware of them later.
16+
- cap: The crossword application is a multi-tier application whose services depend on each other. We will create three services in Kubernetes ahead of time, so that the deployments are aware of them.
1717
com: kubectl apply -f manifests/all-services.yml
1818

19-
- cap: Now we're going to walk through an initial build of the monitoring and scaling service for our crosswords application.
19+
- cap: Now we're going to walk through an initial build of the monitor-scale service.
2020
com: docker build -t 127.0.0.1:30400/monitor-scale:`git rev-parse --short HEAD` -f applications/monitor-scale/Dockerfile applications/monitor-scale
2121

22-
- cap: Setup the proxy in order to push the monitoring docker image to our cluster's registry
22+
- cap: Set up a proxy so we can push the monitor-scale Docker image we just built to our cluster's registry.
2323
com: docker stop socat-registry; docker rm socat-registry; docker run -d -e "REGIP=`minikube ip`" --name socat-registry -p 30400:5000 chadmoon/socat:latest bash -c "socat TCP4-LISTEN:5000,fork,reuseaddr TCP4:`minikube ip`:30400"
2424

25-
- cap: Push the image
25+
- cap: Push the monitor-scale image to the registry.
2626
com: docker push 127.0.0.1:30400/monitor-scale:`git rev-parse --short HEAD`
2727

28-
- cap: Stop the registry proxy
28+
- cap: The proxy’s work is done, so go ahead and stop it.
2929
com: docker stop socat-registry
3030

31-
- cap: Verify that the image is in our local registry using the registry-ui
31+
- cap: Open the registry UI and verify that the monitor-scale image is in our local registry.
3232
com: minikube service registry-ui
3333

34-
- cap: Create the deployment and service for the monitoring and scaling server and wait for it to be deployed
34+
- cap: Create the monitor-scale deployment and service.
3535
com: sed 's#127.0.0.1:30400/monitor-scale:latest#127.0.0.1:30400/monitor-scale:'`git rev-parse --short HEAD`'#' applications/monitor-scale/k8s/deployment.yaml | kubectl apply -f -
3636

37-
- cap: Wait for the deployment to run
37+
- cap: Wait for the monitor-scale deployment to finish.
3838
com: kubectl rollout status deployment/monitor-scale
3939

40-
- cap: See the montior-scale-* pod running using kubectl.
40+
- cap: View pods to see the monitor-scale pod running.
4141
com: kubectl get pods
4242

43-
- cap: See the montior-scale-* service is setup using kubectl.
43+
- cap: View services to see the monitor-scale service.
4444
com: kubectl get services
4545

46-
- cap: See the montior-scale-* ingress is configured using kubectl.
46+
- cap: View ingress rules to see the monitor-scale ingress rule.
4747
com: kubectl get ingress
4848

49-
- cap: See the monitor-scale deployment is setup using kubectl
49+
- cap: View deployments to see the monitor-scale deployment.
5050
com: kubectl get deployments
5151

52-
- cap: Now we will bootstrap the crossword/mongodb services, creating a docker image and storing it in the local registry. This script runs the same steps as before for a different service application.
52+
- cap: We will run a script to bootstrap the puzzle and mongo services, creating Docker images and storing them in the local registry. The puzzle.sh script runs through the same build, proxy, push, and deploy steps we just ran through manually for both services.
5353
com: scripts/puzzle.sh
5454

55-
- cap: Check to see if the puzzle service has been deployed
55+
- cap: Check to see if the puzzle and mongo services have been deployed.
5656
com: kubectl rollout status deployment/puzzle
5757

58-
- cap: Bootstrap the frontend web application. This script follows the same steps as before but
58+
- cap: Bootstrap the kr8sswordz frontend web application. This script follows the same build proxy, push, and deploy steps that the other services followed.
5959
com: scripts/kr8sswordz-pages.sh
6060

61-
- cap: Check to see if the front end has been deployed
61+
- cap: Check to see if the frontend has been deployed.
6262
com: kubectl rollout status deployment/kr8sswordz
6363

64-
- cap: See all the pods running using kubectl.
64+
- cap: Check out all the pods that are running.
6565
com: kubectl get pods
6666

67-
- cap: Start the web application in your default browser
67+
- cap: Start the web application in your default browser. You may have to refresh your browser so that the puzzle appears properly.
6868
com: minikube service kr8sswordz

Diff for: part4.yml

+29-29
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
parts:
22

33
- name: Part 4
4-
intro: In this part we will return to our Jenkins instance and setup jobs for each component of the kr8sswordz application.
4+
intro: In this part we will return to our Jenkins instance and setup a pipeline for the kr8sswordz application.
55
steps:
66

7-
- cap: Open the Jenkins service running in our cluster.
7+
- cap: Enter the following command to open the Jenkins UI in a web browser. Log in to Jenkins using the username and password you previously set up.
88
com: minikube service jenkins
99

10-
- cap: Login as admin, if necessary.
11-
com: echo 'Login as admin, if necessary.'
10+
- cap: We’ll want to create a new pipeline for the puzzle service that we previously deployed. On the left in Jenkins, click New Item.
11+
com: echo ''
12+
13+
- cap: Enter the item name as "Puzzle-Service", click Pipeline, and click OK.
14+
com: echo ''
1215

13-
- cap: Click "New Item" and create an item with a name like "Puzzle Service Pipeline", choosing the type "Pipeline". Click OK.
14-
com: echo 'Click "New Item" and create an item with a name like "Puzzle Service Pipeline", choosing the type "Pipeline". Click OK.'
16+
- cap: Under the Build Triggers section, select Poll SCM. For the Schedule, enter the the string H/5 * * * * which will poll the Git repo every 5 minutes for changes.
17+
com: echo ''
1518

16-
- cap: From pipeline configuration, scroll down to Pipeline and change the Definition selection from "Pipeline script" to "Pipeline script from SCM".
17-
com: echo 'From pipeline configuration, scroll down to Pipeline and change the Definition selection from "Pipeline script" to "Pipeline script from SCM".'
19+
- cap: In the Pipeline section, and change the Definition to "Pipeline script from SCM". Set the SCM property to GIT. Set the Repository URL to your forked repo (created in Part 2), such as https://github.com/[GIT USERNAME]/kubernetes-ci-cd.git. Set the Script Path to applications/puzzle/Jenkinsfile
20+
com: echo ''
1821

19-
- cap: Set the SCM property to GIT.
20-
com: echo 'Set the SCM property to GIT.'
22+
- cap: When you are finished, click Save. On the left, click Build Now to run the new pipeline. You should see it successfully run through the build, push, and deploy steps in a few minutes.
23+
com: echo ''
2124

22-
- cap: Set the "Repository URL" to your fork (created in Part 2), such as https://github.com/kenzanlabs/kubernetes-ci-cd.git.
23-
com: echo 'Set the "Repository URL" to your fork (created in Part 2), such as https://github.com/kenzanlabs/kubernetes-ci-cd.git.'
24-
25-
- cap: Set the "Script Path" to applications/puzzle/Jenkinsfile
26-
com: echo 'Set the "Script Path" to applications/puzzle/Jenkinsfile'
27-
28-
- cap: Save and run the job using the "Build Now" button.
29-
com: echo 'Save and run the job using the "Build Now" button.'
30-
31-
- cap: View updated application
25+
- cap: View the Kr8sswordz application.
3226
com: minikube service kr8sswordz
27+
28+
- cap: Spin up several instances of the puzzle service by moving the slider to the right and clicking Scale. For reference, click on the Submit button, noting that the green hit does not register on the puzzle services.
29+
com: echo ''
3330

34-
- cap: Edit the contents of 'applications/puzzle/common/crossword.js' by uncommenting line 43. This will open the file with the nano editor. When finished press ctrl + x to exit and confirm save.
35-
com: nano applications/puzzle/common/crossword.js
31+
- cap: Edit applications/puzzle/common/models/crossword.js in the nano editor. You'll see a commented section on lines 42-43 that indicates to uncomment a specific line. Uncomment line 43. Press Ctrl+X to close the file, type Y to confirm the filename, and Enter to save the changes to the file.
32+
com: nano applications/puzzle/common/models/crossword.js
3633

37-
- cap: Commit and push the change to your fork and run the Puzzle Service Pipeline in Jenkins.
38-
com: echo 'Commit and push the change to your fork and run the Puzzle Service Pipeline in Jenkins.'
34+
- cap: Commit and push the change to your forked Git repo.
35+
com: echo ''
3936

40-
- cap: Wait for the new puzzle pod enter the 'Running' state.
41-
com: kubectl get pods
42-
43-
- cap: Rerun the application and see that a puzzle pod in the middle of the page turns green when clicking the Submit button.
44-
com: minikube service kr8sswordz
37+
- cap: In Jenkins, open up the Puzzle-Service pipeline and wait until it triggers a build. It should trigger every 5 minutes.
38+
com: echo ''
39+
40+
- cap: After it triggers, observe how the puzzle services disappear in the Kr8sswordz Puzzle app, and how new ones take their place.
41+
com: echo ''
42+
43+
- cap: Try clicking on the Submit button to test that hits now register as green.
44+
com: echo ''

Diff for: start.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ YAML.load(ymlpath, function(docs) {
4343
prompts.onNext({
4444
type: 'confirm',
4545
name: step.com,
46-
message: "\n\n\n" + item.name + " Step: " + stepIndex++ + "\n" + step.cap + "\n\n" + step.com + "\n\nPress enter to the run the above command for the step.",
46+
message: "\n\n\n" + item.name + " Step: " + stepIndex++ + "\n" + step.cap + "\n\n" + step.com + "\n\nPress enter to run the above command for the step.",
4747
default: true
4848
});
4949
})

0 commit comments

Comments
 (0)