How to update the service Type fro ClusterIp to NodePort in OpenSearch K8s Operator cluster?
Hi @ramesh.ar16,
Have you checked the below: opensearch-k8s-operator/docs/userguide/main.md at main · opensearch-project/opensearch-k8s-operator · GitHub
Best,
mj
Hi @Mantas ,
Yes, it is for dashboard service. But, I am looking for the api endpoint service. The default type is ClusterIP.
Thanks,
@ramesh.ar16 Did you resolve the issue? (exposing Cluster itself via 80/443 port)
@ramesh.ar16 According to the opensearchclusters.opensearch.opster.io CRD only OpenSearch Dashboards has configurable service. The documentation suggested by @Mantas follow this logic.
I would suggest to open feature request if you’d like use CRD to manage the service type.
As a workaround I suggest to just edit the service directly in the k8s cluster and change it to the NodePort type.
@pablo, as CRD of OpenSearchClusters (kind) is defined so, users can edit the service using kubectl and change it to NodePort type. (from ClusterIP type)
However, if I want to provide Managed OpenSearch Service using the operator, it is inefficient to edit the Service (api resource) manually everytime when a developer tries to create a cluster with endpoints of Cluster and its Dashboards.
@yeonghyeonKo This is configurable only for OpenSearch Dashboards (5601). OpenSearch cluster (9200) is deployed with ClusterIP and can’t be changed from the CRD level.
I see few options here.
- Use ingress against 9200. This way any modification of CRD won’t overwrite service configuration. Also, ingress will bring a layer of abstraction and won’t expose any custom ports.
- Expand the definition of the CRD and include type of service for 9200.
- Create a Feature Request to implement the type of service for 9200.
The second solution requires knowledge of CRD, ingress is easier to implement in my opinion.