-
Notifications
You must be signed in to change notification settings - Fork 38.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding guestbook example with latest json format for v1beta3 api #4460
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3f2553f
Adding guestbook example with namespace
sub-mod 2cc5dd5
Removing namespace from json files
sub-mod a749efa
new changes
sub-mod 5aedf10
json files updated
sub-mod 3d7ca16
json files updated
sub-mod 46c5862
testcase updated
sub-mod 027c1ac
add v3 json files for guesybook-go
sub-mod eb82df8
renaming folders
sub-mod 23a177c
updating testcases
sub-mod fd3d60f
updating testcases
sub-mod 95c2255
renaming folder to v1beta3 and updating testcases
sub-mod ea0a873
removing LoadBalancer
sub-mod 62cb5b8
removing name from template
sub-mod 7d00c45
format all json files
sub-mod File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work for me. Where should I run it? On master? On my local machine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add this in /etc/kubernetes/apiserver where apiserver is running
KUBE_API_ARGS="--runtime_config=api/v1beta3"