-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Conversation
Can I ask why this change is needed? This basically means users will not be able to run this same example in another Kubernetes namespace. The kubectl client will insert the namespace value from the current-context when omitted in the file, but when present, it errors if the context differs. I don't think we should do this change. |
I was just trying to give a working example of guestbook with latest k8-code and v3 api.I couldn't find one with latest format which worked on v3 api. If it is worth to have this example , I have updated the json files and removed the namespace field from all the files.Else please feel free to mark this PR as Closed with no change. |
@derekwaynecarr: Can I assigne this to you? |
We need a v1beta3 example. I'll take a look. |
@@ -0,0 +1,32 @@ | |||
{ | |||
"apiVersion": "v1beta3", | |||
"kind": "Pod", |
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.
redis-master should be a 1-pod replication controller. See #4267
Please look at #1603 and the other issues/PRs cited. Also, I'd like to take advantage of kubectl's multi-object capabilities. At least all objects relating to a particular microservice (e.g., frontend) should be in the same file. |
And we should add this to https://github.com/GoogleCloudPlatform/kubernetes/blob/master/examples/examples_test.go |
"name": "frontend-controller", | ||
"labels": { | ||
"name": "frontend", | ||
"uses": "redisslave,redis-master", |
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.
"uses" is not a pattern I want to endorse. Please remove it.
FYI, no email is sent when you push changes. You need to comment on the PR in order for someone to notice. Looking now. |
@@ -115,6 +115,14 @@ func TestExampleObjectSchemas(t *testing.T) { | |||
"redis-master-service": &api.Service{}, | |||
"redis-slave-service": &api.Service{}, | |||
}, | |||
"../examples/guestbook/guestbook_ns": { |
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.
You have renamed the example.
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.
@bgrant0607 I have added it in a new folder called guestbook_ns.
If changes look good , I will merge with guestbook folder
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.
@bgrant0607 please let me know if it looks ok?
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.
You introduced the following directories:
examples/guestbook-go/guestbook-go_v3/
examples/guestbook/guestbook_ns/
They should be consistent. Also, the guestbook_ns
example no longer uses namespace, and guestbook
doesn't really need to be in the subdirectory names.
Both examples should be tested here.
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.
I suggest creating v1beta3
subdirectories in each example, with a short README.md just stating that it's a v1beta3 version of the example, and explaining that v1beta3 needs to be enabled.
In a couple weeks we'll promote these to the top level and eliminate the v1beta1 examples.
@bgrant0607 I have made the changes, please let me know if it looks ok |
"port": 3000, | ||
"containerPort": "http-server", | ||
"protocol": "TCP", | ||
"createExternalLoadBalancer": true, |
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.
We're not creating an external load balancer in the existing examples because it's not supported by all cloud providers.
}, | ||
"template": { | ||
"metadata": { | ||
"name": "guestbook", |
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.
I think this name is ignored:
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/controller/replication_controller.go#L70
I'm guessing we're not validating that name isn't specified due to legacy v1beta1/2 support.
Can you confirm, @smarterclayton?
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.
That is correct - argument for validating the versioned structs, not the internal.
On Feb 23, 2015, at 5:33 PM, Brian Grant notifications@github.com wrote:
In examples/guestbook-go/v1beta3/guestbook-controller.json:
- "kind": "ReplicationController",
- "apiVersion": "v1beta3",
- "metadata": {
"name": "guestbook",
"labels": {
"name": "guestbook"
}
- },
- "spec": {
"replicas": 3,
"selector": {
"name": "guestbook"
},
"template": {
"metadata": {
I think this name is ignored:"name": "guestbook",
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/controller/replication_controller.go#L70I'm guessing we're not validating that name isn't specified due to legacy v1beta1/2 support.
Can you confirm, @smarterclayton?
—
Reply to this email directly or view it on GitHub.
"image": "gurpartap/redis", | ||
"ports": [ | ||
{ | ||
"name": "redis-server", |
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.
Please use the port names everywhere, or eliminate them everywhere.
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.
If some of the port names are required, I'm ok with leaving them as is for now.
LGTM. Will merge on green. Thanks. |
Shippable failures were 2 different flakes. Merging. |
Adding guestbook example with latest json format for v1beta3 api
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 |
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"
Support guestbook example json files to work with v3 api