Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Add kubernetes-cassandra seed provider #245

Merged
merged 1 commit into from
Feb 20, 2018

Conversation

kragniz
Copy link
Contributor

@kragniz kragniz commented Feb 8, 2018

What this PR does / why we need it:
This adds and configures the seed provider from kubernetes/examples.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #223

Special notes for your reviewer:

Release note:

Add kubernetes seed provider

@kragniz
Copy link
Contributor Author

kragniz commented Feb 8, 2018

Based on this comment, support for configuring the seed provider via enviroment variables isn't going to happen in library/cassandra. Currently I configure this by doing a find+replace on the config file in the pilot, but this feels pretty hacky. Where should similar config tweaks go?

Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

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

Thanks @kragniz

  • I can't tell why the e2e tests have failed.
  • We don't seem to have dumped the container log files.
  • But I suspect it might be that cassandra is crashing on startup.

I left one or two comments below. Please address or answer those before merging.

@@ -2,6 +2,11 @@ FROM alpine:3.6

ADD http://search.maven.org/remotecontent?filepath=org/jolokia/jolokia-jvm/1.4.0/jolokia-jvm-1.4.0-agent.jar /jolokia.jar
RUN chmod a+r /jolokia.jar && touch /jolokia.jar

# note: temporarily hosted on gist until we find a better place to put it
ADD https://gist.github.com/kragniz/2e03465746a26e2391773ee4f760fcc1/raw/0e31706c35824f2019f4d3892d1a499c8ad6db61/kubernetes-cassandra.jar /kubernetes-cassandra.jar
Copy link
Member

Choose a reason for hiding this comment

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

Were there any changes to the Java source code in the end?
If so, we should put the code in a repo. Either:

If we haven't made any changes to the source code,can we download the jar file from https://github.com/kubernetes/examples/raw/master/cassandra/image/files/kubernetes-cassandra.jar instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No modifications were needed, I've changed it to pull from upstream

@@ -39,6 +41,22 @@ func NewPilot(opts *PilotOptions) (*Pilot, error) {
nodeTool: opts.nodeTool,
}

// hack to test the seedprovider works in k8s, this should be moved somewhere better
Copy link
Member

Choose a reason for hiding this comment

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

Create an issue for this and link to it below the comment.

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


newContents := strings.Replace(string(read),
"org.apache.cassandra.locator.SimpleSeedProvider",
"io.k8s.cassandra.KubernetesSeedProvider", -1)
Copy link
Member

Choose a reason for hiding this comment

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

What if the config file doesn't contain org.apache.cassandra.locator.SimpleSeedProvider ?

Might be better to use yaml tools to set this variable even if it doesn't already exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a good idea, otherwise we're relying on the config file from the cassandra container being in a certain state when we start making these modifications. Maybe we should address this in #251, though?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should address this in #251, though?

That's fine by me.

This adds and configures the seed provider from kubernetes/examples.
@kragniz kragniz changed the title Proof of concept: add kubernetes-cassandra seed provider Add kubernetes-cassandra seed provider Feb 19, 2018
Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

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

/lgtm

@jetstack-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wallrj

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@jetstack-ci-bot
Copy link
Contributor

/test all [submit-queue is verifying that this PR is safe to merge]

@jetstack-ci-bot
Copy link
Contributor

Automatic merge from submit-queue.

@jetstack-ci-bot jetstack-ci-bot merged commit ae5ced2 into jetstack:master Feb 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use the Kubernetes seed provider for Cassandra
4 participants