Unable to set hostalias in opensearchcluster

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Environment: kubernetes
opensearch operator - 2.7.0
opensearch & dashboard version - 2.17.0

Describe the issue:
Am trying to set the hostalias in opensearch nodes. But, unable to set hostalias in kind: opensearchcluster.

Configuration:

Relevant Logs or Screenshots:

@rmssath Why would need to set hostnames in the pods? Are your referring to pod name or OS level pod hostname?

Hi @pablo,

To configure the snapshot repository with s3, we have deployed minio in our environment which is accessible only through host entry.

so we need to add hostalias in the opensearch CR

@rmssath I’ve tested minio with helm charts and OpenSearch Operator.
In both cases I didn’t need any extra host entries to resolve my minio hostname as were resolved by my external DNS server.

@rmssath Could you share your OpenSearch s3 configuration?

@pablo ,

We are running the below command inside the pod to create s3 repo in opensearch.

curl -u “admin:xxxxxx” -XPUT -k ‘https://test-cluster:9200/_snapshot/backup-s3-repository?verify=true&pretty’ -H ‘Content-Type: application/json’ -d’{“type”: “s3”,“settings”: {“endpoint”: “https://minio.test.com”, “bucket”: “test-cluster”, “region”: “us-east-1”, “access_key”: “xxxxxx”, “secret_key”: “xxxxxxxx”, “base_path”: “test-opensearch”, “path_style_access”: true }}’

Above minio.test.com is not accessible over the internet. It is deployed internally with different subnet.

So we cannot access this minio.test.com directly from opensearch pods. It requires host entry.

@rmssath My OpenSearch node are running on the local k8s and can access my internal minio node. It’s on the same network but that shouldn’t be an issue as my names are resolved through DNS server.
My pods are using k8s host’s DNS configuration successfully.

If it is different network, then we need option to add the hostalias