-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
180 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,9 @@ description: Start with us your first kubernetes workloads! | |
|
||
remote_theme: pmarsceill/[email protected] | ||
aux_links: | ||
"GitHub": "https://github.com/itdesign/kubernetes-workshop" | ||
"itdesign GmbH": "https://itdesign.de" | ||
"Slides": "https://bit.ly/itd-k8s-slides" | ||
"Source on GitHub": "https://github.com/itdesign/kubernetes-workshop" | ||
"Jobs at itdesign GmbH": "https://itdesign.de/jobs" | ||
|
||
plugins: | ||
- jekyll-redirect-from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
title: Rollback Changes | ||
parent: Add the Frontend | ||
--- | ||
|
||
# Rollback Changes | ||
|
||
Sometimes a deploy has unexpected results. In this case we deployed a developer preview. | ||
This is not what we want in production. So lets rollback our changes. | ||
|
||
1. Run `kubectl rollout undo deployment calculator-frontend` to revert the latest changes. | ||
2. Continuously refresh the page after applying the changes. | ||
3. The page will be served with different layouts. This is because sometimes a pod with | ||
`v3` and sometimes a pod with `v1` answers your request. | ||
4. After some time only `v1` of the calculator frontend should be visible. | ||
5. You can verify this by running `kubectl rollout status deployment calculator-frontend`: | ||
``` | ||
deployment "calculator-frontend" successfully rolled out | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
title: Last Steps | ||
parent: Add the Frontend | ||
--- | ||
|
||
# Last Steps | ||
|
||
We are nearing the end, but lets deploy a version that is ready to be served in our cluster. `v2` this should be safe to deploy. | ||
|
||
## Deploy a stable version | ||
|
||
1. Change the image in the `fronted.yml` to `v2`. | ||
2. Apply the changes and watch for pod changes: | ||
``` | ||
kubectl apply -f k8s-files/ && kubectl get pods -w | ||
``` | ||
3. You should now see the new pods starting and the old pods shuting down: | ||
``` | ||
NAME READY STATUS RESTARTS AGE | ||
calculator-frontend-58968fd9b8-22np7 0/1 ContainerCreating 0 1s | ||
calculator-frontend-65876567ff-68p8s 1/1 Running 0 2m | ||
calculator-frontend-65876567ff-rvpvb 1/1 Running 0 34s | ||
calculator-frontend-65876567ff-wj62x 1/1 Running 0 46s | ||
calculator-frontend-58968fd9b8-22np7 0/1 Running 0 4s | ||
calculator-frontend-58968fd9b8-22np7 1/1 Running 0 6s | ||
calculator-frontend-65876567ff-rvpvb 1/1 Terminating 0 39s | ||
calculator-frontend-58968fd9b8-sfmhv 0/1 Pending 0 0s | ||
calculator-frontend-58968fd9b8-sfmhv 0/1 Pending 0 0s | ||
calculator-frontend-58968fd9b8-sfmhv 0/1 ContainerCreating 0 0s | ||
calculator-frontend-65876567ff-rvpvb 0/1 Terminating 0 40s | ||
calculator-frontend-58968fd9b8-sfmhv 0/1 Running 0 5s | ||
calculator-frontend-65876567ff-rvpvb 0/1 Terminating 0 44s | ||
calculator-frontend-65876567ff-rvpvb 0/1 Terminating 0 44s | ||
calculator-frontend-58968fd9b8-sfmhv 1/1 Running 0 9s | ||
calculator-frontend-65876567ff-wj62x 1/1 Terminating 0 1m | ||
calculator-frontend-58968fd9b8-w48gr 0/1 Pending 0 0s | ||
calculator-frontend-58968fd9b8-w48gr 0/1 Pending 0 0s | ||
calculator-frontend-58968fd9b8-w48gr 0/1 ContainerCreating 0 0s | ||
calculator-frontend-65876567ff-wj62x 0/1 Terminating 0 1m | ||
calculator-frontend-58968fd9b8-w48gr 0/1 Running 0 5s | ||
calculator-frontend-65876567ff-wj62x 0/1 Terminating 0 1m | ||
calculator-frontend-65876567ff-wj62x 0/1 Terminating 0 1m | ||
calculator-frontend-58968fd9b8-w48gr 1/1 Running 0 8s | ||
calculator-frontend-65876567ff-68p8s 1/1 Terminating 0 2m | ||
calculator-frontend-65876567ff-68p8s 0/1 Terminating 0 2m | ||
calculator-frontend-65876567ff-68p8s 0/1 Terminating 0 3m | ||
calculator-frontend-65876567ff-68p8s 0/1 Terminating 0 3m | ||
``` | ||
4. The app should now be served in `v2`. | ||
|
||
## We did it! 🎉 | ||
|
||
You are now able to do the following things using Kubernetes: | ||
|
||
- Deploy an application | ||
- Inspect your application when something goes wrong | ||
- Configure multiple replicas for fault tolerance | ||
- Create a service for load balancing | ||
- Expose an application to the public internet | ||
- Update applications without any downtime | ||
|
||
### Want to learn more? | ||
|
||
Have a look at the new version of the frontend. It looks like history does not work correctly. 😉 | ||
|
||
We need to fix this! Try the [bonus chapters](../03-bonus.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ apiVersion: v1 | |
metadata: | ||
name: nginx-proxy | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: 80 | ||
targetPort: 80 | ||
|
20 changes: 20 additions & 0 deletions
20
services/calculator-frontend/src/react/components/BetaOverlay.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
|
||
export const BetaOverlay: React.FunctionComponent<{}> = () => ( | ||
<div | ||
style={{ | ||
position: 'absolute', | ||
left: '50%', | ||
top: '85px', | ||
marginLeft: '50px', | ||
transform: 'rotate(40deg)', | ||
backgroundColor: '#fff', | ||
fontSize: '40px', | ||
fontWeight: 'bold', | ||
color: '#f00', | ||
zIndex: 100 | ||
}} | ||
> | ||
developer preview | ||
</div> | ||
); |
Oops, something went wrong.