Failed to deploy fleet-server via eck in kubernetes

I was trying to deploy fleet server via eck in k8s. However, the fleet-server pod never spawn. Here is the config and the result of kubectl description for agent fleet-server

fleet-server.yaml

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

kubectl describe agent fleet-server

k -n elastic-system describe agent fleet-server
Name:         fleet-server
Namespace:    elastic-system
Labels:       <none>
Annotations:  association.k8s.elastic.co/es-conf-3313931196:
                {"authSecretName":"fleet-server-elastic-system-elasticsearch-agent-user","authSecretKey":"elastic-system-fleet-server-elastic-system-elast...
API Version:  agent.k8s.elastic.co/v1alpha1
Kind:         Agent
Metadata:
  Creation Timestamp:  2023-03-03T00:02:33Z
  Generation:          2
  Managed Fields:
    API Version:  agent.k8s.elastic.co/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .:
          f:kubectl.kubernetes.io/last-applied-configuration:
      f:spec:
        .:
        f:deployment:
          .:
          f:podTemplate:
            .:
            f:spec:
              .:
              f:automountServiceAccountToken:
              f:securityContext:
                .:
                f:runAsUser:
              f:serviceAccountName:
          f:replicas:
        f:elasticsearchRefs:
        f:fleetServerEnabled:
        f:kibanaRef:
          .:
          f:name:
        f:mode:
        f:version:
    Manager:      kubectl-client-side-apply
    Operation:    Update
    Time:         2023-03-03T00:02:33Z
    API Version:  agent.k8s.elastic.co/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          f:association.k8s.elastic.co/es-conf-3313931196:
      f:spec:
        f:deployment:
          f:podTemplate:
            f:metadata:
              .:
              f:creationTimestamp:
            f:spec:
              f:containers:
          f:strategy:
        f:fleetServerRef:
        f:http:
          .:
          f:service:
            .:
            f:metadata:
            f:spec:
          f:tls:
            .:
            f:certificate:
    Manager:      elastic-operator
    Operation:    Update
    Time:         2023-03-03T00:02:34Z
    API Version:  agent.k8s.elastic.co/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:status:
        .:
        f:elasticsearchAssociationsStatus:
          .:
          f:elastic-system/elasticsearch:
        f:kibanaAssociationStatus:
        f:observedGeneration:
    Manager:         elastic-operator
    Operation:       Update
    Subresource:     status
    Time:            2023-03-03T00:02:34Z
  Resource Version:  8907
  UID:               d02507f7-18e2-4305-9d48-74bead9e6203
Spec:
  Deployment:
    Pod Template:
      Metadata:
        Creation Timestamp:  <nil>
      Spec:
        Automount Service Account Token:  true
        Containers:                       <nil>
        Security Context:
          Run As User:         0
        Service Account Name:  elastic-agent
    Replicas:                  1
    Strategy:
  Elasticsearch Refs:
    Name:                elasticsearch
  Fleet Server Enabled:  true
  Fleet Server Ref:
  Http:
    Service:
      Metadata:
      Spec:
    Tls:
      Certificate:
  Kibana Ref:
    Name:   kibana
  Mode:     fleet
  Version:  7.16.1
Status:
  Elasticsearch Associations Status:
    elastic-system/elasticsearch:  Established
  Kibana Association Status:       Pending
  Observed Generation:             2
Events:
  Type     Reason                   Age              From                                 Message
  ----     ------                   ----             ----                                 -------
  Warning  AssociationError         3s (x5 over 3s)  agent-controller                     Association backend for elasticsearch is not configured
  Normal   AssociationStatusChange  3s               agent-kibana-association-controller  Association status changed from [] to [Pending]
  Warning  AssociationError         2s (x8 over 3s)  agent-controller                     Association backend for kibana is not configured
  Warning  AssociationError         2s (x8 over 3s)  agent-kibana-association-controller  Failed to find referenced backend elastic-system/: Elasticsearch.elasticsearch.k8s.elastic.co "" not found
  Normal   AssociationStatusChange  2s               agent-es-association-controller      Association status changed from [] to [elastic-system/elasticsearch: Established]

As you could see from the describe result, Elasticsearch Associations Status for elastic-system/elasticsearch is Established but only Kibana Association Status is showing Pending.

In order to rule out the issue coming from versions and k8s cluster, I tried to deploying it from minikube to local k8s from docker desktop, also upgrade the CRD from 1.8.0 to 2.6.0. but still having the same issue. Is there anyone had faced similar issue?

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