Fleet Server - Waiting on default policy with Fleet Server integration

Hello,
I am not able to run Fleet. Probably I miss something but not sure; tried also quickstart yaml files, and I got the same result.

Kibana Config:

apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: $KIBANANAME
  namespace: $NAMESPACE
spec:
  version: 8.1.2
  count: 1
  http:
    tls:
      certificate:
        secretName: $KIBANANAME
  elasticsearchRef:
    name: $ESCLUSTERNAME
    namespace: $NAMESPACE
  config:
    xpack.reporting.roles.enabled: false
    xpack.reporting.kibanaServer.hostname: "localhost"
    xpack.fleet.agents.elasticsearch.hosts: ["https://$ESCLUSTERNAME-es-http.$NAMESPACE.svc:9200"]
    xpack.fleet.agents.fleet_server.hosts: ["https://fleet-server-agent-http.$NAMESPACE.svc:8220"]
    xpack.security.encryptionKey: "XXXXXXXXXXXXXXXXX"
    xpack.fleet.packages:
      - name: system
        version: latest
      - name: elastic_agent
        version: latest
      - name: log
        version: latest
      - name: fleet_server
        version: latest
    xpack.fleet.agentPolicies:
      - name: Fleet Server on ECK policy
        id: eck-fleet-server
        is_default_fleet_server: true
        namespace: $NAMESPACE
        monitoring_enabled:
          - logs
          - metrics
        package_policies:
        - name: fleet_server-1
          id: fleet_server-1
          package:
            name: fleet_server
      - name: Elastic Agent on ECK policy
        id: eck-agent
        is_default: true
        namespace: $NAMESPACE
        monitoring_enabled:
          - logs
          - metrics
        unenroll_timeout: 900
        package_policies:
        - name: system-1
          id: system-1
          package:
            name: system

Fleet Config:

apiVersion: agent.k8s.elastic.co/v1alpha1
kind: Agent
metadata:
  name: $FLEETSERVERNAME
  namespace: $NAMESPACE
spec:
  version: 8.1.2
  mode: fleet
  fleetServerEnabled: true
  kibanaRef:
    name: $KIBANANAME
    namespace: $NAMESPACE
  elasticsearchRefs:
  - name: $ESCLUSTERNAME
    namespace: $NAMESPACE
  deployment:
    replicas: 1
    podTemplate:
      spec:
        serviceAccountName: $FLEETSERVERNAME
        automountServiceAccountToken: true
        securityContext:
          runAsUser: 0
        containers:
          - name: agent
            env:
              - name: FLEET_INSECURE
                value: "true"
              - name: FLEET_ENROLLMENT_TOKEN
                value: $FLEETENROLLMENTTOKEN

...and elastic agent fleet logs:

Updating certificates in /etc/ssl/certs...
1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Requesting service_token from Kibana.
Created service_token named: token-1649804572144
Performing setup of Fleet in Kibana

{"log.level":"info","@timestamp":"2022-04-12T23:02:54.141Z","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":572},"message":"Spawning Elastic Agent daemon as a subprocess to complete bootstrap process.","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-12T23:02:54.536Z","log.origin":{"file.name":"application/application.go","file.line":68},"message":"Detecting execution mode","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-12T23:02:54.537Z","log.origin":{"file.name":"application/application.go","file.line":88},"message":"Agent is in Fleet Server bootstrap mode","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-12T23:02:55.220Z","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":744},"message":"Waiting for Elastic Agent to start Fleet Server","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-12T23:02:56.428Z","log.logger":"api","log.origin":{"file.name":"api/server.go","file.line":62},"message":"Starting stats endpoint","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-12T23:02:56.428Z","log.origin":{"file.name":"application/fleet_server_bootstrap.go","file.line":131},"message":"Agent is starting","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-12T23:02:56.429Z","log.logger":"api","log.origin":{"file.name":"api/server.go","file.line":64},"message":"Metrics endpoint listening on: /usr/share/elastic-agent/state/data/tmp/elastic-agent.sock (configured: unix:///usr/share/elastic-agent/state/data/tmp/elastic-agent.sock)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-12T23:02:56.429Z","log.origin":{"file.name":"application/fleet_server_bootstrap.go","file.line":141},"message":"Agent is stopped","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-12T23:02:56.432Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is YmhGJiPA","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-12T23:02:56.432Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 1 step(s)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-12T23:02:59.334Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2022-04-12T23:02:59Z - message: Application: fleet-server--8.1.1[]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-12T23:02:59.336Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":66},"message":"Updating internal state","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-12T23:03:00.532Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2022-04-12T23:03:00Z - message: Application: fleet-server--8.1.1[]: State changed to STARTING: Waiting on default policy with Fleet Server integration - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-12T23:03:01.224Z","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":777},"message":"Fleet Server - Waiting on default policy with Fleet Server integration","ecs.version":"1.6.0"}

Could you please advise?

Thanks & Reagrds

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