# Connecting to remote fleet server

**URL:** <https://discuss.elastic.co/t/connecting-to-remote-fleet-server/305523>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [May 24, 2022, 3:26pm UTC](https://discuss.elastic.co/t/connecting-to-remote-fleet-server/305523 "2022-05-24T15:26:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![manpreet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manpreet/32/97650_2.png) [@manpreet](https://discuss.elastic.co/u/manpreet)\
**Post date:** [May 24, 2022, 3:26pm UTC](https://discuss.elastic.co/t/connecting-to-remote-fleet-server/305523/1 "2022-05-24T15:26:59Z")

</div>

When configuring fleet server on the kubernetes cluster running the elasticssearch/kibana as well works, but when I try to use the same fleet server from a remote cluster the config I receive points to the "service" url in the fleet server cluster.

Fleet server running in cluster 1: [https://fleet-server-agent.namespace.svc:8220](https://fleet-server-agent.namespace.svc:8220)

A load balancer than makes it available on [https://monitoring.example.com:8220](https://monitoring.example.com:8220)

Remote fleet agent is connecting to [https://monitoring.example.com:8220](https://monitoring.example.com:8220)

But then it receive fleet url as [https://fleet-server-agent.namespace.svc:8220](https://fleet-server-agent.namespace.svc:8220) even though i am creating a daemonset on remote cluster with env variable pointing to [https://monitoring.example.com:8220](https://monitoring.example.com:8220)

Do i need to run a fleet server on every cluster i create?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 24, 2022, 10:50pm UTC](https://discuss.elastic.co/t/connecting-to-remote-fleet-server/305523/2 "2022-05-24T22:50:20Z")

</div>

Are you using ECK to host things?

---

<div class="post-metadata">

**Author:** ![manpreet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manpreet/32/97650_2.png) [@manpreet](https://discuss.elastic.co/u/manpreet)\
**Post date:** [May 25, 2022, 5:09am UTC](https://discuss.elastic.co/t/connecting-to-remote-fleet-server/305523/3 "2022-05-25T05:09:58Z")

</div>

Yes ECK to host

1. Elasticsearch
2. Kibana (User ref)
3. APM Server (using ref)
4. Fleet Server (using refs)
5. Elastic Agent (Using Refs)

Second cluster

1. Elastic Agent (using daemonset)

Kibana Config

```auto
elasticsearch:
  hosts:
  - https://cluster-es-http.esstack.svc:9200
  serviceAccountToken: <value>
  ssl:
    certificateAuthorities: /usr/share/kibana/config/elasticsearch-certs/ca.crt
    verificationMode: certificate
monitoring:
  ui:
    container:
      elasticsearch:
        enabled: true
server:
  host: 0.0.0.0
  name: es-cluster
  publicBaseUrl: https://monitoring.example.com
  ssl:
    certificate: /mnt/elastic-internal/http-certs/tls.crt
    enabled: true
    key: /mnt/elastic-internal/http-certs/tls.key
xpack:
  encryptedSavedObjects:
    encryptionKey: <value>
  fleet:
    agentPolicies:
    - id: eck-fleet-server
      is_default_fleet_server: true
      monitoring_enabled:
      - logs
      - metrics
      name: Fleet Server on ECK policy
      namespace: fleetserver
      package_policies:
      - id: fleet_server-1
        name: fleet_server-1
        package:
          name: fleet_server
    - id: eck-agent
      is_default: true
      monitoring_enabled:
      - logs
      - metrics
      name: Elastic Agent on ECK policy
      namespace: kubernetes
      package_policies:
      - id: system-1
        name: system-1
        package:
          name: system
      - id: kubernetes-1
        name: kubernetes-1
        package:
          name: kubernetes
      unenroll_timeout: 900
    agents:
      elasticsearch:
        hosts:
        - https://monitoring.example.com:9200
      fleet_server:
        hosts:
        - https://monitoring.example.com:8220
    packages:
    - name: system
      version: latest
    - name: elastic_agent
      version: latest
    - name: fleet_server
      version: latest
    - name: kubernetes
      version: latest
    - name: aws
      version: latest
  license_management:
    ui:
      enabled: false
  reporting:
    encryptionKey: <value>
  security:
    authc:
      providers:
        basic:
          basic1:
            order: 1

```

---

<div class="post-metadata">

**Author:** ![manpreet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manpreet/32/97650_2.png) [@manpreet](https://discuss.elastic.co/u/manpreet)\
**Post date:** [May 25, 2022, 2:21pm UTC](https://discuss.elastic.co/t/connecting-to-remote-fleet-server/305523/4 "2022-05-25T14:21:06Z")

</div>

To reproduce the problem:

1. 2 Kubernetes clusters
2. ES/Kibana/Fleet/Agent on Cluster 1
3. Expose Fleet/Kibana on cluster 1 using loadbalancer
4. Setup Agents only on cluster 2 to use fleet server on Cluster 1.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 22, 2022, 2:21pm UTC](https://discuss.elastic.co/t/connecting-to-remote-fleet-server/305523/5 "2022-06-22T14:21:51Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
