File tree Expand file tree Collapse file tree 2 files changed +92
-2
lines changed
Expand file tree Collapse file tree 2 files changed +92
-2
lines changed Original file line number Diff line number Diff line change 11# k8s-workshop
22Workshop repository to play with Docker and Kubernetes
3+
4+ ### Links
5+
6+ - https://www.katacoda.com/courses/docker/deploying-first-container
7+ - https://github.com/
8+ - https://hub.docker.com/
9+ - https://www.katacoda.com/courses/kubernetes/launch-single-node-cluster
10+
11+ ### Docker
12+
13+ ``` sh
14+ docker run -dit --name web -p 8080:80 -v /home/user/website/:/usr/local/apache2/htdocs/ httpd:2.4-alpine
15+ ```
16+
17+ ### GitHub
18+
19+ Resources
20+ - Dockerfile
21+ - index.html
22+
23+
24+ ``` sh
25+ docker build -t web:1.0 .
26+ ```
27+
28+ ``` sh
29+ docker run -dit --name web -p 8080:80 twogghub/k8s-workshop:1.0
30+ ```
31+
32+ ``` sh
33+ localhost:8080
34+ ```
35+
36+ ### Kubernetes
37+
38+ ``` sh
39+ docker pull twogghub/k8s-workshop
40+ ```
41+ ``` sh
42+ kubectl run web --image=twogghub/k8s-workshop:1.0
43+ ```
44+
45+ ``` sh
46+ kubectl expose deployment web --port=80 --external-ip=$( minikube ip) --type=LoadBalancer
47+ ```
48+
49+ ``` sh
50+ vim deployment.yaml
51+ ```
52+
53+ ``` sh
54+ {
55+ " apiVersion" : " extensions/v1beta1" ,
56+ " kind" : " Deployment" ,
57+ " metadata" : {
58+ " name" : " webyml"
59+ },
60+ " spec" : {
61+ " replicas" : 2,
62+ " template" : {
63+ " metadata" : {
64+ " labels" : {
65+ " app" : " webyml"
66+ }
67+ },
68+ " spec" : {
69+ " containers" : [
70+ {
71+ " name" : " webyml" ,
72+ " image" : " twogghub/k8s-workshop:1.0" ,
73+ " ports" : [
74+ {
75+ " containerPort" : 80
76+ }
77+ ]
78+ }
79+ ]
80+ }
81+ }
82+ }
83+ }
84+ ```
85+
86+ ``` sh
87+ kubectl create -f deployment.yaml
88+ ```
89+
90+ ``` sh
91+ kubectl expose deployment webyml --port=80 --external-ip=$( minikube ip) --type=LoadBalancer
92+ ```
Original file line number Diff line number Diff line change 11<!DOCTYPE html>
22< html lang ="en ">
33< head >
4- < title > DockerWeb </ title >
4+ < title > Web </ title >
55</ head >
66< body >
7- < h1 > Simpler than this imposible! !</ h1 >
7+ < h1 > Hello !</ h1 >
88</ body >
99</ html >
You can’t perform that action at this time.
0 commit comments