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

Create a headless service so that other nodes can lookup the seed provider #128

Merged
merged 1 commit into from
Nov 22, 2017

Conversation

wallrj
Copy link
Member

@wallrj wallrj commented Nov 14, 2017

Fixes: #127

Release note:

NONE

@wallrj
Copy link
Member Author

wallrj commented Nov 14, 2017

/test all

@wallrj wallrj changed the title WIP: seed provider Create a headless service so that other nodes can lookup the seed provider Nov 14, 2017
@wallrj
Copy link
Member Author

wallrj commented Nov 14, 2017

/test all

@munnerz
Copy link
Contributor

munnerz commented Nov 14, 2017

/retest

@wallrj
Copy link
Member Author

wallrj commented Nov 14, 2017 via email

@wallrj
Copy link
Member Author

wallrj commented Nov 15, 2017

/test all

@wallrj wallrj changed the title Create a headless service so that other nodes can lookup the seed provider WIP: Create a headless service so that other nodes can lookup the seed provider Nov 15, 2017
@wallrj wallrj changed the title WIP: Create a headless service so that other nodes can lookup the seed provider Create a headless service so that other nodes can lookup the seed provider Nov 15, 2017
@munnerz
Copy link
Contributor

munnerz commented Nov 16, 2017

/test all

@wallrj
Copy link
Member Author

wallrj commented Nov 16, 2017

/test e2e

@wallrj
Copy link
Member Author

wallrj commented Nov 16, 2017

Logs show:

I1116 12:09:56.387] INFO  12:09:48 Starting Messaging Service on /172.17.0.8:7000 (eth0)
I1116 12:09:56.387] WARN  12:09:48 No host ID found, created 471089dd-269d-498f-a96d-1c8cb577b79c (Note: This should happen exactly once per node).
I1116 12:09:56.387] INFO  12:09:49 Handshaking version with cass-cassandra-1510834028-24677-cassandra-ringnodes-0.cass-cassandra-1510834028-24677-cassandra-seedprovider.test-cassandracluster-1510834028-24677.svc.cluster.local/172.17.0.7
I1116 12:09:56.387] WARN  12:09:54 Seed gossip version is -2147483648; will not connect with that version
I1116 12:09:56.387] INFO  12:09:54 Cannot handshake version with cass-cassandra-1510834028-24677-cassandra-ringnodes-0.cass-cassandra-1510834028-24677-cassandra-seedprovider.test-cassandracluster-1510834028-24677.svc.cluster.local/172.17.0.7
I1116 12:09:56.388] INFO  12:09:54 Handshaking version with cass-cassandra-1510834028-24677-cassandra-ringnodes-0.cass-cassandra-1510834028-24677-cassandra-seedprovider.test-cassandracluster-1510834028-24677.svc.cluster.local/172.17.0.7

Perhaps I just need to give the second node longer to connect to the first.
This test passes on my GKE cluster.

@wallrj
Copy link
Member Author

wallrj commented Nov 16, 2017

/test e2e

hack/e2e.sh Outdated
kubectl describe apiservice
kubectl logs -c apiserver -l app=navigator,component=apiserver
kubectl logs -c controller -l app=navigator,component=controller
kubectl logs -c etcd -l app=navigator,component=apiserver
Copy link
Contributor

Choose a reason for hiding this comment

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

Has all this moved somewhere else? Can't see it elsewhere in the PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added kubectl cluster-info dump --all-namespaces which appears to provide all this information and more. For example, it gives me the logs of all the cassandra pods which is how I was able to see that the test wasn't allowing long enough for the second node to join the cluster.

func(t *testing.T) {
f := newFixture(t)
f.Run()
f.AssertServicesLength(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we perform any checks to ensure the created service has the required ports/type etc. set? Or is this done elsewhere? 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

There are e2e checks for the service ports.

createService ServiceCreator,
updateService ServiceUpdater,
) error {
svc := createService(cluster)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a creator as well as an updater? In my mind, calling updateService with an &apiv1.Service{} should have the same effect as calling createService?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah - looks like that's what is always happening, but then we pass a Creator/Updater func to this function. Is there any reason for this? Do we behave differently ever? It'd be ideal to simplify it if we can.

Copy link
Member Author

Choose a reason for hiding this comment

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

I need the create function for generating services for the unit tests. But you're right, it can probably be simplified in a future branch.

func CqlServiceName(c *v1alpha1.CassandraCluster) string {
return fmt.Sprintf("%s-cql", ResourceBaseName(c))
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Note (but not required to be fixed in this PR, as I think it's a wider problem) - I've run into problems in cert-manager where resource names become too long as we just keep appending to things. We should try and work out a 'grand unified way' to generate resource names predictably.

@munnerz
Copy link
Contributor

munnerz commented Nov 17, 2017

Could you squash this into 1 commit before merge? 😄

@munnerz
Copy link
Contributor

munnerz commented Nov 17, 2017

(then all good! I don't want to say the magic phrase for fear this will auto merge... 🙄 )

@wallrj wallrj force-pushed the 127-seed-provider branch 2 times, most recently from 28a8ab5 to fa31cb5 Compare November 21, 2017 11:06
@wallrj
Copy link
Member Author

wallrj commented Nov 21, 2017

Could you squash this into 1 commit before merge?

@munnerz Done. Thanks for the review.

* Create a headless service so that other nodes can lookup the seed provider
* Create a separate CQL service which loadbalances across all the C* nodes.
* Refactor the service tests so that they can be re-used for both service controllers.

Fixes: jetstack#127

**Release note**:
```release-note
NONE
```
@munnerz
Copy link
Contributor

munnerz commented Nov 22, 2017

/lgtm
/approve

@jetstack-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: munnerz

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

@munnerz
Copy link
Contributor

munnerz commented Nov 22, 2017

/test all

@jetstack-ci-bot
Copy link
Contributor

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

1 similar 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 8c8b56c into jetstack:23-cassandra Nov 22, 2017
@wallrj wallrj deleted the 127-seed-provider branch November 22, 2017 16:29
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.

4 participants