Skip to content
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

Update guestbook example to use replication controller instead of a naked pod. #4267

Merged
merged 1 commit into from
Feb 24, 2015

Conversation

rsokolowski
Copy link
Contributor

Bunch of changes in addition and also to make the change work:

  • Added redis-master-controller.json that replaces redis-master.json.
  • Removed HostPort from resources in the json files.
  • Expanded README.md to include 6th step that sets up service for frontend.
  • Reexecuted commands from the example and pasted up to date output.
  • Bunch of changes in test files that were relying on redis-master.json file that generated pod resource. I've updated the relevant calls to use replication controller resource.

@bgrant0607
Copy link
Member

Tests failed with:

F0210 00:53:56.836262   14857 create.go:79] the path "examples/guestbook/redis-master.json" does not exist

@bgrant0607
Copy link
Member

Thanks @rsokolowski! @ddysher could you take a look?

@ddysher
Copy link
Contributor

ddysher commented Feb 10, 2015

Sure, I'll take a look.

@@ -46,7 +54,7 @@ Use the file `examples/guestbook/redis-master.json` which describes a single pod
Create the redis pod in your Kubernetes cluster by running:

```shell
$ cluster/kubectl.sh create -f examples/guestbook/redis-master.json
$ cluster/kubectl.sh create -f examples/guestbook/redis-master-controller.json
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also show that using cluster/kubectl.sh get rc will list the replication controller.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@ddysher
Copy link
Contributor

ddysher commented Feb 10, 2015

@rsokolowski Thanks!

I haven't looked at kubectl unittest yet. But I think you'll also need to fix guestbook.sh in e2e-suite. Can you fix it, rebase/squash?

@rsokolowski rsokolowski force-pushed the guestbook-doc branch 3 times, most recently from 988985b to 19ef840 Compare February 16, 2015 15:01
@rsokolowski
Copy link
Contributor Author

Thanks for comments @ddysher. PTAL.

NAME IMAGE(S) HOST LABELS STATUS
redis-master dockerfile/redis kubernetes-minion-2.c.myproject.internal/130.211.156.189 name=redis-master Running
POD IP CONTAINER(S) IMAGE(S) HOST LABELS STATUS
redis-master-controller-gb50a 10.244.3.7 redis-master dockerfile/redis kubernetes-minion-4.c.hazel-mote-834.internal/104.154.54.203 app=redis,name=redis-master Running
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is slightly out-dated. Minion name is not numbered anymore, it has a random suffix. E.g. kubernetes-minion-7yx6 instead of kubernetes-minion-1, etc. This is for idempotent creation I believe.

Just do a simple replace string will suffix:
s/kubernetes-minion-1/kubernetes-minion-7yx6
s/kubernetes-minion-2/kubernetes-minion-eatx
....

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually because the minions are now created as part of Managed Instance Groups members of which just have unique IDs versus counts.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, really, I thought it's follow up work for this #3789 Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@ddysher
Copy link
Contributor

ddysher commented Feb 19, 2015

Looks good, some minor comments. Need a rebase.

@rsokolowski
Copy link
Contributor Author

Thanks for comments @ddysher . Applied them and rebased/squashed. I also fixed hack/test-cmd.sh which was broken.

@rsokolowski
Copy link
Contributor Author

Ping, I again synced to head.

@ddysher
Copy link
Contributor

ddysher commented Feb 23, 2015

Have you ran e2e test? Just for precaution even though this is an example update. I believe a some places in e2e touches the directory.

You seem to touch very hot files.

@rsokolowski
Copy link
Contributor Author

The relevant e2e tests are passing. There is not that much dependency on examples/guestbook: mainly test-cmd.sh and guestbook.sh

@ddysher
Copy link
Contributor

ddysher commented Feb 24, 2015

Have you commented on this?
#4267 (comment)

@rsokolowski
Copy link
Contributor Author

Oops, I've missed the comment - replied.

@zmerlynn
Copy link
Member

This LGTM, but deferring to @ddysher for final.

(I was mainly butting my head in here because it was referenced by #4588.)

@ddysher
Copy link
Contributor

ddysher commented Feb 24, 2015

LGTM, will merge after final rebase. N.B. can you put a comment on the conflict part so I don't have to go through the whole commit, thx.

kubectl get pods "${kube_flags[@]}" -lname=redis-master | grep -q 'redis-master'
[ ! $(kubectl delete pods --all pods -l name=redis-master "${kube_flags[@]}" ) ] # not --all and label selector together
kubectl get pods "${kube_flags[@]}" -lname=valid-pod | grep -q 'valid-pod'
[ ! $(kubectl delete pods --all pods -l name=valid-pod "${kube_flags[@]}" ) ] # not --all and label selector together
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest conflict was here due to 29aae75

@rsokolowski
Copy link
Contributor Author

Thanks for review @ddysher . Rebased, resolved conflict and added comment as requested.

ddysher added a commit that referenced this pull request Feb 24, 2015
Update guestbook example to use replication controller instead of a naked pod.
@ddysher ddysher merged commit f2698e5 into kubernetes:master Feb 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants