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

Fix rethinkdb example #8843

Closed
wants to merge 1 commit into from
Closed

Conversation

lavalamp
Copy link
Member

For #7444.

The rethinkdb example needs some help. We need to switch it over to using DNS for discovery, or at least not relying on the RO port. This change, which I haven't tested, uses a service account.

Unfortunately, we don't own the container here, and I'm not sure if we want to fork it or push changes to https://github.com/antmanler/rethinkdb-k8s. I'm making this PR to record my progress on this.

We'll need to take this example out or fix it, because the RO port is going away soon.

@antmanler

# try to pick up first different ip from endpoints
MYHOST=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
URL="${KUBERNETES_RO_SERVICE_HOST}/api/v1beta3/namespaces/${NAMESPACE}/endpoints/rethinkdb-driver"
IP=$(curl -s ${URL} | jq -s -r --arg h "${MYHOST}" '.[0].subsets | .[].addresses | [ .[].IP ] | map(select(. != $h)) | .[0]') || exit 1
URL="https://${KUBERNETES_SERVICE_HOST}${KUBERNETES_SERVICE_PORT}/api/v1beta3/namespaces/${NAMESPACE}/endpoints/rethinkdb-driver"
Copy link
Member

Choose a reason for hiding this comment

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

Should be note the colon
URL="https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}/api/v1beta3/namespaces/${NAMESPACE}/endpoints/rethinkdb-driver"
right? Not
URL="https://${KUBERNETES_SERVICE_HOST}${KUBERNETES_SERVICE_PORT}/api/v1beta3/namespaces/${NAMESPACE}/endpoints/rethinkdb-driver"

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it should. Will fix.

@k8s-bot
Copy link

k8s-bot commented Jul 6, 2015

GCE e2e build/test failed for commit ff227821a9510dedfd458c2e294ecd4998a0b5a1.

@lavalamp lavalamp changed the title WIP: untested changes to rethinkdb example Fix rethinkdb example Jul 7, 2015
@lavalamp
Copy link
Member Author

lavalamp commented Jul 7, 2015

I found this old PR that I forgot about. Fixed, tested, seems to work. I left the test image in my own repository at gcr.io/crested_analogy_671/rethink:1 to save folks the trouble of building it.

@lavalamp
Copy link
Member Author

lavalamp commented Jul 7, 2015

This fixes an example and doesn't touch any real code, so it should be OK for merging. @gmarek PTAL

@k8s-bot
Copy link

k8s-bot commented Jul 7, 2015

GCE e2e build/test passed for commit 3acdc76.

@gmarek
Copy link
Contributor

gmarek commented Jul 7, 2015

Shippable failure seems related:
examples_test.go:335: ../examples/rethinkdb/ns.yaml: ns does not have a test case defined
FAIL

@mwielgus
Copy link
Contributor

mwielgus commented Jul 7, 2015

@lavalamp I'm also working on fixing this example. I would rather get rid of the separate namespace. It is confusing (switching contexts, why I don't see my other/rethinkdb pods etc).

@lavalamp
Copy link
Member Author

lavalamp commented Jul 7, 2015

Ah ok, I wasn't aware of that. Yours does more stuff, so I'll close this in favor of #10832.

@lavalamp lavalamp closed this Jul 7, 2015
@lavalamp lavalamp deleted the no-ro-rethinkdb branch August 26, 2015 20:03
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.

6 participants