Skip to content

Commit

Permalink
add hello-world.yml, readme, smpfy
Browse files Browse the repository at this point in the history
  • Loading branch information
siggy committed Oct 4, 2016
1 parent cd9d22f commit 235e2ec
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 11 deletions.
27 changes: 27 additions & 0 deletions dead-simple-k8s/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Dead Simple Kubernetes with linkerd

## Deploy linkerd

```bash
kubectl apply -f linkerd.yml
```

## Deploy Hello World

```bash
kubectl apply -f hello-world.yml
```

## Test Requests

```bash
http_proxy=$(kubectl get svc | grep l5d | awk '{ print $3 }'):4140 curl -s http://hello
http_proxy=$(kubectl get svc | grep l5d | awk '{ print $3 }'):4140 curl -s http://world
```

## Deploy linkerd-viz

```bash
kubectl apply -f linkerd-viz.yml
open http://$(kubectl get svc | grep linkerd-viz | awk '{ print $3 }')
```
110 changes: 110 additions & 0 deletions dead-simple-k8s/hello-world.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
apiVersion: v1
kind: ReplicationController
metadata:
name: hello
spec:
replicas: 3
selector:
app: hello
template:
metadata:
labels:
app: hello
spec:
dnsPolicy: ClusterFirst
containers:
- name: service
image: buoyantio/helloworld:0.0.1
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: NS
valueFrom:
fieldRef:
fieldPath: metadata.namespace
command:
- "/bin/bash"
- "-c"
- "HTTP_PROXY=`./hostIP.sh`:4140 python hello.py"
ports:
- name: service
containerPort: 7777
- name: kubectl
image: buoyantio/kubectl:v1.4.0
args:
- proxy
- "-p"
- "8001"
---
apiVersion: v1
kind: Service
metadata:
name: hello
spec:
selector:
app: hello
type: LoadBalancer
ports:
- name: http
port: 7777
- name: external
port: 80
targetPort: 7777
---
apiVersion: v1
kind: ReplicationController
metadata:
name: world
spec:
replicas: 3
selector:
app: world
template:
metadata:
labels:
app: world
spec:
dnsPolicy: ClusterFirst
containers:
- name: service
image: buoyantio/helloworld:0.0.1
imagePullPolicy: Always
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: NS
valueFrom:
fieldRef:
fieldPath: metadata.namespace
command:
- "/bin/bash"
- "-c"
- "HTTP_PROXY=`./hostIP.sh`:4140 python world.py"
ports:
- name: service
containerPort: 7778
---
apiVersion: v1
kind: Service
metadata:
name: world
spec:
selector:
app: world
clusterIP: None
ports:
- name: http
port: 7778
6 changes: 0 additions & 6 deletions dead-simple-k8s/hostIP.sh

This file was deleted.

3 changes: 1 addition & 2 deletions dead-simple-k8s/linkerd-viz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ spec:
containers:
- name: linkerd-viz
image: buoyantio/linkerd-k8s-viz:0.0.1
imagePullPolicy: Always
env:
- name: PUBLIC_PORT
value: "3000"
Expand All @@ -30,7 +29,7 @@ spec:
containerPort: 9090

- name: kubectl
image: buoyantio/kubectl:1.2.3
image: buoyantio/kubectl:v1.4.0
args:
- "proxy"
- "-p"
Expand Down
4 changes: 1 addition & 3 deletions dead-simple-k8s/linkerd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ spec:
containers:
- name: l5d
image: buoyantio/linkerd:0.8.1
imagePullPolicy: Always
env:
- name: POD_IP
valueFrom:
Expand All @@ -88,7 +87,7 @@ spec:
mountPath: "/io.buoyant/linkerd/config"
readOnly: true
- name: kubectl
image: buoyantio/kubectl:1.2.3
image: buoyantio/kubectl:v1.4.0
args:
- "proxy"
- "-p"
Expand All @@ -109,4 +108,3 @@ spec:
port: 4141
- name: admin
port: 9990

0 comments on commit 235e2ec

Please sign in to comment.