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

Add e2e tests for multi-namespaces deployments #782

Closed
sebgl opened this issue May 8, 2019 · 6 comments · Fixed by #1446
Closed

Add e2e tests for multi-namespaces deployments #782

sebgl opened this issue May 8, 2019 · 6 comments · Fixed by #1446
Assignees
Labels
justdoit Continuous improvement not related to a specific feature >test Related to unit/integration/e2e tests

Comments

@sebgl
Copy link
Contributor

sebgl commented May 8, 2019

Use case:

  • Kibana in one namespace
  • Elasticsearch in another namespace

Association should correctly be established between both.

So far our E2E tests do rely on a default e2e namespace for most tests.
Here we need more plumbing to support multiple namespaces in the tests.

@sebgl sebgl added the justdoit Continuous improvement not related to a specific feature label May 8, 2019
@charith-elastic charith-elastic self-assigned this Jul 16, 2019
@charith-elastic
Copy link
Contributor

Some of the current assumptions in our test bootstrap code makes implementing this a bit tricky and more involved than I anticipated. I raised #1251 to discuss this further.

@anyasabo
Copy link
Contributor

Can you help me understand this use case? Why would we want them in separate namespaces?

@sebgl sebgl added the >test Related to unit/integration/e2e tests label Jul 17, 2019
@sebgl
Copy link
Contributor Author

sebgl commented Jul 17, 2019

Can you help me understand this use case? Why would we want them in separate namespaces?

The use case would be to allow certain users (eg. a team in your org) to manipulate ES clusters, and let other users (eg. another team) tweak their Kibana settings with no access to the Elasticsearch namespace.
This is probably a corner case that may not be very useful. We still implemented it to make sure we get this flexibility if we need to.

@charith-elastic
Copy link
Contributor

I encountered a catch-22 situation while trying to write this test.

  • When we setup the E2E test environment each namespace gets its own operator because creating a single operator for all the test namespaces will require too many privileges and makes test isolation difficult.
  • When KB and ES are managed by two different operators, the association does not work because the association controller can't watch the Elasticsearch resource running in the other namespace.

Due to these reasons, I have a test that works locally (operator is managing all namespaces) but it cannot be run in the CI environment (operator restricted to a single namespace). Rather than adding too many privileges to the CI environment, I am inclined to wait for a fix to #1438.

@barkbay
Copy link
Contributor

barkbay commented Aug 19, 2019

Reopening this issue as multi-namespaces scenarios are still not run in our CI process.

@pebrc
Copy link
Collaborator

pebrc commented May 5, 2020

We have now this:

func TestCrossNSAssociation(t *testing.T) {
esNamespace := test.Ctx().ManagedNamespace(0)
kbNamespace := test.Ctx().ManagedNamespace(1)
name := "test-cross-ns-assoc"
esBuilder := elasticsearch.NewBuilder(name).
WithNamespace(esNamespace).
WithESMasterDataNodes(1, elasticsearch.DefaultResources).
WithRestrictedSecurityContext()
kbBuilder := kibana.NewBuilder(name).
WithNamespace(kbNamespace).
WithElasticsearchRef(esBuilder.Ref()).
WithNodeCount(1).
WithRestrictedSecurityContext()
test.Sequence(nil, test.EmptySteps, esBuilder, kbBuilder).RunSequential(t)
}

Which makes me think we can close this issue. Please reopen if you had additional scenarios in mind.

@pebrc pebrc closed this as completed May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
justdoit Continuous improvement not related to a specific feature >test Related to unit/integration/e2e tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants