Skip to content

Commit 235e2ec

Browse files
committed
add hello-world.yml, readme, smpfy
1 parent cd9d22f commit 235e2ec

File tree

5 files changed

+139
-11
lines changed

5 files changed

+139
-11
lines changed

dead-simple-k8s/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Dead Simple Kubernetes with linkerd
2+
3+
## Deploy linkerd
4+
5+
```bash
6+
kubectl apply -f linkerd.yml
7+
```
8+
9+
## Deploy Hello World
10+
11+
```bash
12+
kubectl apply -f hello-world.yml
13+
```
14+
15+
## Test Requests
16+
17+
```bash
18+
http_proxy=$(kubectl get svc | grep l5d | awk '{ print $3 }'):4140 curl -s http://hello
19+
http_proxy=$(kubectl get svc | grep l5d | awk '{ print $3 }'):4140 curl -s http://world
20+
```
21+
22+
## Deploy linkerd-viz
23+
24+
```bash
25+
kubectl apply -f linkerd-viz.yml
26+
open http://$(kubectl get svc | grep linkerd-viz | awk '{ print $3 }')
27+
```

dead-simple-k8s/hello-world.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
apiVersion: v1
3+
kind: ReplicationController
4+
metadata:
5+
name: hello
6+
spec:
7+
replicas: 3
8+
selector:
9+
app: hello
10+
template:
11+
metadata:
12+
labels:
13+
app: hello
14+
spec:
15+
dnsPolicy: ClusterFirst
16+
containers:
17+
- name: service
18+
image: buoyantio/helloworld:0.0.1
19+
env:
20+
- name: POD_NAME
21+
valueFrom:
22+
fieldRef:
23+
fieldPath: metadata.name
24+
- name: POD_IP
25+
valueFrom:
26+
fieldRef:
27+
fieldPath: status.podIP
28+
- name: NS
29+
valueFrom:
30+
fieldRef:
31+
fieldPath: metadata.namespace
32+
command:
33+
- "/bin/bash"
34+
- "-c"
35+
- "HTTP_PROXY=`./hostIP.sh`:4140 python hello.py"
36+
ports:
37+
- name: service
38+
containerPort: 7777
39+
- name: kubectl
40+
image: buoyantio/kubectl:v1.4.0
41+
args:
42+
- proxy
43+
- "-p"
44+
- "8001"
45+
---
46+
apiVersion: v1
47+
kind: Service
48+
metadata:
49+
name: hello
50+
spec:
51+
selector:
52+
app: hello
53+
type: LoadBalancer
54+
ports:
55+
- name: http
56+
port: 7777
57+
- name: external
58+
port: 80
59+
targetPort: 7777
60+
---
61+
apiVersion: v1
62+
kind: ReplicationController
63+
metadata:
64+
name: world
65+
spec:
66+
replicas: 3
67+
selector:
68+
app: world
69+
template:
70+
metadata:
71+
labels:
72+
app: world
73+
spec:
74+
dnsPolicy: ClusterFirst
75+
containers:
76+
- name: service
77+
image: buoyantio/helloworld:0.0.1
78+
imagePullPolicy: Always
79+
env:
80+
- name: POD_NAME
81+
valueFrom:
82+
fieldRef:
83+
fieldPath: metadata.name
84+
- name: POD_IP
85+
valueFrom:
86+
fieldRef:
87+
fieldPath: status.podIP
88+
- name: NS
89+
valueFrom:
90+
fieldRef:
91+
fieldPath: metadata.namespace
92+
command:
93+
- "/bin/bash"
94+
- "-c"
95+
- "HTTP_PROXY=`./hostIP.sh`:4140 python world.py"
96+
ports:
97+
- name: service
98+
containerPort: 7778
99+
---
100+
apiVersion: v1
101+
kind: Service
102+
metadata:
103+
name: world
104+
spec:
105+
selector:
106+
app: world
107+
clusterIP: None
108+
ports:
109+
- name: http
110+
port: 7778

dead-simple-k8s/hostIP.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

dead-simple-k8s/linkerd-viz.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ spec:
1717
containers:
1818
- name: linkerd-viz
1919
image: buoyantio/linkerd-k8s-viz:0.0.1
20-
imagePullPolicy: Always
2120
env:
2221
- name: PUBLIC_PORT
2322
value: "3000"
@@ -30,7 +29,7 @@ spec:
3029
containerPort: 9090
3130

3231
- name: kubectl
33-
image: buoyantio/kubectl:1.2.3
32+
image: buoyantio/kubectl:v1.4.0
3433
args:
3534
- "proxy"
3635
- "-p"

dead-simple-k8s/linkerd.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ spec:
6565
containers:
6666
- name: l5d
6767
image: buoyantio/linkerd:0.8.1
68-
imagePullPolicy: Always
6968
env:
7069
- name: POD_IP
7170
valueFrom:
@@ -88,7 +87,7 @@ spec:
8887
mountPath: "/io.buoyant/linkerd/config"
8988
readOnly: true
9089
- name: kubectl
91-
image: buoyantio/kubectl:1.2.3
90+
image: buoyantio/kubectl:v1.4.0
9291
args:
9392
- "proxy"
9493
- "-p"
@@ -109,4 +108,3 @@ spec:
109108
port: 4141
110109
- name: admin
111110
port: 9990
112-

0 commit comments

Comments
 (0)