Fix backend Elasticsearch connectivity for local dev and app logs.
Auto port-forward using the registered cluster kubeconfig, default to loopback outside Kubernetes, route log APIs by app cluster, and document platform env settings. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -36,8 +36,12 @@ export default () => ({
|
||||
},
|
||||
|
||||
elasticsearch: {
|
||||
/** API host for log search. Use cluster DNS in-cluster; 127.0.0.1 + port-forward when backend runs locally. */
|
||||
host: process.env.ELASTICSEARCH_HOST || 'elasticsearch.logging.svc.cluster.local',
|
||||
/** API host for log search. In-cluster: cluster DNS. Local dev: loopback + auto port-forward. */
|
||||
host:
|
||||
process.env.ELASTICSEARCH_HOST ||
|
||||
(process.env.KUBERNETES_SERVICE_HOST
|
||||
? 'elasticsearch.logging.svc.cluster.local'
|
||||
: '127.0.0.1'),
|
||||
port: parseInt(process.env.ELASTICSEARCH_PORT || '9200', 10),
|
||||
/** In development with loopback host, start kubectl port-forward on API boot (set false to manage manually). */
|
||||
autoPortForward: process.env.ELASTICSEARCH_AUTO_PORT_FORWARD ?? 'true',
|
||||
|
||||
Reference in New Issue
Block a user