How to install elastic search fleet server on Kubernetes

I think I have been going round and round with the whole setup. I am able to get the fleet connection working when working with ECK on cloud. Since it's a managed instance it comes prebuilt with fleet server installed. while installing agents on my OTHER Kubernetes cluster I can just use the fleet URL provided by managed ECK. my configuration looks like this.

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: elastic-agent
  namespace: kube-system
.
.
.
- name: FLEET_URL
  value: "https://XXXX.fleet.eastus.azure.elastic-cloud.com:443"
- name: FLEET_ENROLLMENT_TOKEN
  value: "XXX=="

correct me if I am wrong this is the fleet server that is installed on managed elastic cloud.

This works perfectly fine I can see data flowing from my prod cluster to this managed ECK cluster.

Now I want to setup fleet server on my monitoring cluster and hoping to see data going from one cluster to this monitoring cluster, just like what I did with managed ECK.

This is the agent server definition I have

apiVersion: agent.k8s.elastic.co/v1alpha1
kind: Agent
metadata:
  name: fleet-server
spec:
  version: 8.6.2
  kibanaRef:
    name: kibana
  elasticsearchRefs:
  - name: elastic
  mode: fleet
  fleetServerEnabled: true
  deployment:
    replicas: 1
    podTemplate:
      spec:
        serviceAccountName: fleet-server
        automountServiceAccountToken: true
        securityContext:
          runAsUser: 0

I can see fleet-server pod running, also see Fleet Server Hosts populated as https://fleet-server-agent-http.default.svc:8220 in Kibana. Based on this I should be able to add Fleet Server in kibana. When I follow the directions to add fleet server in kibana finally I end up with command which looks something like this.

curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-8.6.2-linux-x86_64.tar.gz
tar xzvf elastic-agent-8.6.2-linux-x86_64.tar.gz
cd elastic-agent-8.6.2-linux-x86_64
sudo ./elastic-agent install \
  --fleet-server-es=https://ES_INGRESS:443 \
  --fleet-server-service-token=XXX \
  --fleet-server-policy=fleet-server-policy

I am not sure where are we suppose to run this command in Kubernetes.

I was expecting something like a YAML which can setup agent-server for me on this self managed monitoring cluster.

what am I missing here.

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