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

Running Agent as non root in a dedicated namespace is not possible #7352

Closed
barkbay opened this issue Nov 29, 2023 · 1 comment · Fixed by #7382
Closed

Running Agent as non root in a dedicated namespace is not possible #7352

barkbay opened this issue Nov 29, 2023 · 1 comment · Fixed by #7382
Assignees
Labels
>bug Something isn't working >docs Documentation

Comments

@barkbay
Copy link
Contributor

barkbay commented Nov 29, 2023

Despite what the documentation suggests:

Until version 7.14.0 and ECK version 2.10.0, Elastic Agent in Fleet mode has to run as root and in the same namespace as the Elasticsearch cluster it connects to.

It is not possible to run Agent as non root and in a namespace other than the one where Elasticsearch is deployed. This check is preventing this kind of setup to be deployed:

func applyRelatedEsAssoc(agent agentv1alpha1.Agent, esAssociation commonv1.Association, builder *defaults.PodTemplateBuilder) (*defaults.PodTemplateBuilder, error) {
	if esAssociation == nil {
		return builder, nil
	}

	esRef := esAssociation.AssociationRef()
	if !esRef.IsExternal() && !agent.Spec.FleetServerEnabled && agent.Namespace != esRef.Namespace {
		// check agent and ES share the same namespace
		return nil, fmt.Errorf(
			"agent namespace %s is different than referenced Elasticsearch namespace %s, this is not supported yet",
			agent.Namespace,
			esAssociation.AssociationRef().Namespace,
		)
	}

We should understand if it safe to remove this check and fix the documentation.

It might be an oversight of #6700

@barkbay barkbay added >bug Something isn't working >docs Documentation labels Nov 29, 2023
@barkbay
Copy link
Contributor Author

barkbay commented Nov 29, 2023

@naemono assigning to you as you mentioned you can work on it, let me know if you can't, thanks! 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working >docs Documentation
Projects
None yet
2 participants