forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubernetes#4460 from sub-mod/guestbook_ns
Adding guestbook example with latest json format for v1beta3 api
- Loading branch information
Showing
15 changed files
with
402 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## GuestBook v1beta3 example | ||
|
||
This example shows how to build a simple, multi-tier web application using Kubernetes and Docker. | ||
|
||
The example consists of: | ||
- A web frontend | ||
- A redis master (for storage and a replicated set of redis slaves) | ||
|
||
The web front end interacts with the redis master via javascript redis API calls. | ||
|
||
The v1beta3 API is not enabled by default. The kube-apiserver process needs to run with the --runtime_config=api/v1beta3 argument. Use the following command to enable it: | ||
$sudo sed -i 's|KUBE_API_ARGS="|KUBE_API_ARGS="--runtime_config=api/v1beta3 |' /etc/kubernetes/apiserver | ||
|
||
|
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,38 @@ | ||
{ | ||
"kind":"ReplicationController", | ||
"apiVersion":"v1beta3", | ||
"metadata":{ | ||
"name":"guestbook", | ||
"labels":{ | ||
"name":"guestbook" | ||
} | ||
}, | ||
"spec":{ | ||
"replicas":3, | ||
"selector":{ | ||
"name":"guestbook" | ||
}, | ||
"template":{ | ||
"metadata":{ | ||
"labels":{ | ||
"name":"guestbook" | ||
} | ||
}, | ||
"spec":{ | ||
"containers":[ | ||
{ | ||
"image":"kubernetes/guestbook", | ||
"name":"guestbook", | ||
"ports":[ | ||
{ | ||
"name":"http-server", | ||
"containerPort":3000, | ||
"protocol":"TCP" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
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,18 @@ | ||
{ | ||
"kind":"Service", | ||
"apiVersion":"v1beta3", | ||
"metadata":{ | ||
"name":"guestbook", | ||
"labels":{ | ||
"name":"guestbook" | ||
} | ||
}, | ||
"spec":{ | ||
"port":3000, | ||
"containerPort":"http-server", | ||
"protocol":"TCP", | ||
"selector":{ | ||
"name":"guestbook" | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
examples/guestbook-go/v1beta3/redis-master-controller.json
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,42 @@ | ||
{ | ||
"kind":"ReplicationController", | ||
"apiVersion":"v1beta3", | ||
"id":"redis-master", | ||
"metadata":{ | ||
"name":"redis-master", | ||
"labels":{ | ||
"name":"redis", | ||
"role":"master" | ||
} | ||
}, | ||
"spec":{ | ||
"replicas":1, | ||
"selector":{ | ||
"name":"redis", | ||
"role":"master" | ||
}, | ||
"template":{ | ||
"metadata":{ | ||
"labels":{ | ||
"name":"redis", | ||
"role":"master" | ||
} | ||
}, | ||
"spec":{ | ||
"containers":[ | ||
{ | ||
"name":"redis-master", | ||
"image":"gurpartap/redis", | ||
"ports":[ | ||
{ | ||
"name":"redis-server", | ||
"containerPort":6379, | ||
"protocol":"TCP" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
{ | ||
"kind":"Service", | ||
"apiVersion":"v1beta3", | ||
"metadata":{ | ||
"name":"redis-master", | ||
"labels":{ | ||
"name":"redis", | ||
"role":"master" | ||
} | ||
}, | ||
"spec":{ | ||
"port":6379, | ||
"containerPort":"redis-server", | ||
"protocol":"TCP", | ||
"selector":{ | ||
"name":"redis", | ||
"role":"master" | ||
} | ||
} | ||
} |
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,47 @@ | ||
{ | ||
"kind":"ReplicationController", | ||
"apiVersion":"v1beta3", | ||
"id":"redis-slave", | ||
"metadata":{ | ||
"name":"redis-slave", | ||
"labels":{ | ||
"name":"redis", | ||
"role":"slave" | ||
} | ||
}, | ||
"spec":{ | ||
"replicas":1, | ||
"selector":{ | ||
"name":"redis", | ||
"role":"slave" | ||
}, | ||
"template":{ | ||
"metadata":{ | ||
"labels":{ | ||
"name":"redis", | ||
"role":"slave" | ||
} | ||
}, | ||
"spec":{ | ||
"containers":[ | ||
{ | ||
"name":"redis-slave", | ||
"image":"gurpartap/redis", | ||
"command":[ | ||
"sh", | ||
"-c", | ||
"redis-server /etc/redis/redis.conf --slaveof $REDIS_MASTER_SERVICE_HOST $REDIS_MASTER_SERVICE_PORT" | ||
], | ||
"ports":[ | ||
{ | ||
"name":"redis-server", | ||
"containerPort":6379, | ||
"protocol":"TCP" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
{ | ||
"kind":"Service", | ||
"apiVersion":"v1beta3", | ||
"metadata":{ | ||
"name":"redis-slave", | ||
"labels":{ | ||
"name":"redis", | ||
"role":"slave" | ||
} | ||
}, | ||
"spec":{ | ||
"port":6379, | ||
"containerPort":"redis-server", | ||
"protocol":"TCP", | ||
"selector":{ | ||
"name":"redis", | ||
"role":"slave" | ||
} | ||
} | ||
} |
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,14 @@ | ||
## GuestBook v1beta3 example | ||
|
||
This example shows how to build a simple, multi-tier web application using Kubernetes and Docker. | ||
|
||
The example consists of: | ||
- A web frontend | ||
- A redis master (for storage and a replicated set of redis slaves) | ||
|
||
The web front end interacts with the redis master via javascript redis API calls. | ||
|
||
The v1beta3 API is not enabled by default. The kube-apiserver process needs to run with the --runtime_config=api/v1beta3 argument. Use the following command to enable it: | ||
$sudo sed -i 's|KUBE_API_ARGS="|KUBE_API_ARGS="--runtime_config=api/v1beta3 |' /etc/kubernetes/apiserver | ||
|
||
|
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,37 @@ | ||
{ | ||
"kind":"ReplicationController", | ||
"apiVersion":"v1beta3", | ||
"metadata":{ | ||
"name":"frontend", | ||
"labels":{ | ||
"name":"frontend" | ||
} | ||
}, | ||
"spec":{ | ||
"replicas":2, | ||
"selector":{ | ||
"name":"frontend" | ||
}, | ||
"template":{ | ||
"metadata":{ | ||
"labels":{ | ||
"name":"frontend" | ||
} | ||
}, | ||
"spec":{ | ||
"containers":[ | ||
{ | ||
"name":"php-redis", | ||
"image":"kubernetes/example-guestbook-php-redis", | ||
"ports":[ | ||
{ | ||
"containerPort":80, | ||
"protocol":"TCP" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
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,18 @@ | ||
{ | ||
"kind":"Service", | ||
"apiVersion":"v1beta3", | ||
"metadata":{ | ||
"name":"frontend", | ||
"labels":{ | ||
"name":"frontend" | ||
} | ||
}, | ||
"spec":{ | ||
"port":80, | ||
"containerPort":80, | ||
"protocol":"TCP", | ||
"selector":{ | ||
"name":"frontend" | ||
} | ||
} | ||
} |
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,18 @@ | ||
{ | ||
"kind":"Service", | ||
"apiVersion":"v1beta3", | ||
"metadata":{ | ||
"name":"redis-master", | ||
"labels":{ | ||
"name":"redis-master" | ||
} | ||
}, | ||
"spec":{ | ||
"port":6379, | ||
"containerPort":6379, | ||
"protocol":"TCP", | ||
"selector":{ | ||
"name":"redis-master" | ||
} | ||
} | ||
} |
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,37 @@ | ||
{ | ||
"kind":"ReplicationController", | ||
"apiVersion":"v1beta3", | ||
"metadata":{ | ||
"name":"redis-master", | ||
"labels":{ | ||
"name":"redis-master" | ||
} | ||
}, | ||
"spec":{ | ||
"replicas":1, | ||
"selector":{ | ||
"name":"redis-master" | ||
}, | ||
"template":{ | ||
"metadata":{ | ||
"labels":{ | ||
"name":"redis-master" | ||
} | ||
}, | ||
"spec":{ | ||
"containers":[ | ||
{ | ||
"name":"master", | ||
"image":"dockerfile/redis", | ||
"ports":[ | ||
{ | ||
"containerPort":6379, | ||
"protocol":"TCP" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.