cass-operator icon indicating copy to clipboard operation
cass-operator copied to clipboard

Allow management-api in different port

Open burmanm opened this issue 3 years ago • 7 comments

What is missing? Currently management-api is considered to be always in the port 8080 by the cass-operator. We should allow PodHost to define a port as well to simplify testing and potentially allow deployments where the port is different.

┆Issue is synchronized with this Jira Story by Unito ┆Issue Number: CASS-52

burmanm avatar Dec 02 '21 09:12 burmanm

And/or we should also allow management api initialization to be captured and mocked so that we could inject httpclient there.

burmanm avatar Dec 02 '21 09:12 burmanm

Hi @burmanm I have been using host networking for the multi-cluster k8ssandra deployment. Node local dns process is running on port 8080 on all the worker nodes. So, there was a port conflict with cass-management API. This feature would be of great value. May I know any updates and when this feature would be rolled out?

Ajith-ceg avatar Jul 14 '23 05:07 Ajith-ceg

Part of the work is done in the envtesting PR. This allows the cass-operator to query the modified port, but it does not yet allow changing them from the CRD. That'll require another set of changes to expose the port settings.

burmanm avatar Aug 25 '23 15:08 burmanm

What is the problem with CRD? Could you pls elaborate on it? And Good to know that work is going on this...thanks for your update @burmanm

Ajith-ceg avatar Sep 08 '23 05:09 Ajith-ceg

What is the problem with CRD? Could you pls elaborate on it?

There's nothing in the CRD that would allow overriding ports. The ports are currently hardcoded in cass-operator. That said, I could enable changing them through the PodTemplateSpec in the containerPorts, but that would be somewhat hidden feature in that case. Maybe that would be fine.

burmanm avatar Sep 11 '23 07:09 burmanm

Actually, there's no need to do any of that, we already supported it in the PodTemplateSpec. See the test in commit https://github.com/k8ssandra/cass-operator/commit/52a430d06a211db4579d6243a96d6d03d2c8fada

That would change the mgmt-api port that cass-operator calls. It does not however modify the port that management-api itself listens to. That's defined in the Dockerfile entrypoitn of mgmt-api:

https://github.com/k8ssandra/management-api-for-apache-cassandra/blob/ce77e239a69697926777866a8db7d7530b9d503a/scripts/docker-entrypoint.sh#L182

Which you will need to override for mgmt-api to listen to in a different port. That's the problem with running in hostnetwork for everything, we can't do do port forwards.

burmanm avatar Sep 11 '23 08:09 burmanm

Relevant: https://github.com/k8ssandra/management-api-for-apache-cassandra/pull/418

burmanm avatar Nov 06 '23 19:11 burmanm