Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion labs/docker_cloud_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Want more practice creating your own Docker images??? In the previous stretch g

**HINTS**
- Create a Dockerfile that starts with the base of nginx (that is **FROM nginx**)
- Use the COPY command to copy your custom HTML file into the image (The destination inside the image can be determined from the nginx "How to use ths image" section on [hub.docker.com](https://hub.docker.com/_/nginx) or by looking at your volume mount location from the previous Stretch Goal
- Use the COPY command to copy your custom HTML file into the image (The destination inside the image can be determined from the nginx "How to use this image" section on [hub.docker.com](https://hub.docker.com/_/nginx) or by looking at your volume mount location from the previous Stretch Goal
- If you don't specify a CMD, it should use the one from the base image... this is what you want in this case.
- Ultimately, when finished buiding your image, you should be able to do a simple docker run with only the "-p 8080:80" option to publish your port and your custom image name.

Expand Down
10 changes: 5 additions & 5 deletions labs/kube_deploy_cloud_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pod/cn-demo-759dc65498-j2mm6 1/1 Running 0 22s

## Play with the new Deployment

It's time to explore some behavior and terminology of Kubernetes. First up is the [Pod](https://kubernetes.io/docs/concepts/workloads/pods/pod/). We wont' go too deep on all the specifics, but a Pod is where the configuration for your running container resides. It turns out you can run multiple containers in a single Pod, but that is outside the scope of this exercise. To learn more about how and why you would want to do this, search around for Sidecar and Ambassador patterns.
It's time to explore some behavior and terminology of Kubernetes. First up is the [Pod](https://kubernetes.io/docs/concepts/workloads/pods/pod/). We won't go too deep on all the specifics, but a Pod is where the configuration for your running container resides. It turns out you can run multiple containers in a single Pod, but that is outside the scope of this exercise. To learn more about how and why you would want to do this, search around for Sidecar and Ambassador patterns.

Let's see what happens when we delete a Pod (which is one way to brute force simulate a failed container). Run the following command, filling in the `cn-demo-***` with the unique name Kubernetes assigned your Pod, and then keep running the **kubectl get pods** command to see what happens to your pod. Things will happen fast!

Expand Down Expand Up @@ -73,12 +73,12 @@ kubectl run cn-demo --image=cloud-native-demo:1

### Stretch Goal

Get up and stretch!!! Just kidding... ok maybe that's not a bad idea... but to play more with kubernetes, let's see if we can learn how to connect to one of the running containers and get a shell so we can poke around and see the files that are in our running container. What we will do is use the **kube exec** command to get a bash shell into one of our pods.
Get up and stretch!!! Just kidding... ok maybe that's not a bad idea... but to play more with kubernetes, let's see if we can learn how to connect to one of the running containers and get a shell so we can poke around and see the files that are in our running container. What we will do is use the **kubectl exec** command to get a bash shell into one of our pods.

So, make sure you have at least one pod running, and then use the kube exec command to get a shell into the container.
The format of the kube exec command is like this:
So, make sure you have at least one pod running, and then use the kubectl exec command to get a shell into the container.
The format of the kubectl exec command is like this:
```bash
kube exec -it <pod name> /bin/bash
kubectl exec -it <pod name> /bin/bash
```

NOTE: Look at the [offical documentation here](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#exec) to see what the **'-it'** is doing.
Expand Down