Sample APM Project on Kubernetes is empty?

I'm trying out Elasticsearch with APM on Kubernetes. I downloaded this file:

Then changed the Elasticsearch deployment to have 1 node instead of 3. Just for reference, this is now what it looks like:

# This sample sets up a an Elasticsearch cluster along with a Kibana instance
# and an APM server, configured to be able to communicate with each other
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: es-apm-sample
spec:
  version: 8.14.0
  nodeSets:
  - name: default
    count: 1
    config:
      # This setting could have performance implications for production clusters.
      # See: https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-virtual-memory.html
      node.store.allow_mmap: false
---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: kb-apm-sample
spec:
  version: 8.14.0
  count: 1
  elasticsearchRef:
    name: "es-apm-sample"
  config:
    xpack.fleet.packages:
    - name: apm
      version: latest
---
apiVersion: apm.k8s.elastic.co/v1
kind: ApmServer
metadata:
  name: apm-apm-sample
spec:
  version: 8.14.0
  count: 1
  elasticsearchRef:
    name: "es-apm-sample"
  # this allows ECK to configure automatically the Kibana endpoint as described in https://www.elastic.co/guide/en/apm/server/current/setup-kibana-endpoint.html
  kibanaRef:
    name: "kb-apm-sample"

I tried running this commands and it gave these results

kubectl apply -f apm_es_kibana.yaml

# then wait a few minutes

kubectl get pods
NAME                                         READY   STATUS     RESTARTS   AGE
apm-apm-sample-apm-server-686554bf55-d6skf   1/1     Running    0          2m46s
es-apm-sample-es-default-0                   1/1     Running    0          2m49s
kb-apm-sample-kb-59d7684764-j85hd            1/1     Running    0          2m46s

kubectl get apm
NAME             HEALTH   NODES   VERSION   AGE
apm-apm-sample   green    1       8.14.0    4m6

kubectl get elasticsearch
NAME            HEALTH   NODES   VERSION   PHASE   AGE
es-apm-sample   green    1       8.14.0    Ready   4m19s

kubectl get kibana
NAME            HEALTH   NODES   VERSION   AGE
kb-apm-sample   green    1       8.14.0    4m30s


kubectl port-forward service/kb-apm-sample-kb-http --address 192.168.0.101 5601

Then I login to Kibana at this url https://192.168.0.101:5601, and then I click to Fleet>Agents and Fleet>Agent Policies but both screens show empty as shown below:

I thought I should see at least one agent for the Fleet server and one policy that has APM integration. Did I do something wrong or did I miss a step?

I think I must be missing something very obvious, because I just ran this command:

helm install eck-apm elastic/eck-stack --values https://raw.githubusercontent.com/elastic/cloud-on-k8s/2.14/deploy/eck-stack/examples/apm-server/basic.yaml -n elastic-stack2;

kubectl get pods -n elastic-stack2
NAME                                                READY   STATUS    RESTARTS   AGE
eck-apm-eck-apm-server-apm-server-f998b8c69-ggfx5   1/1     Running   0          11m
elasticsearch-es-default-0                          1/1     Running   0          11m
kibana-kb-8b787568b-zlck5                           1/1     Running   0          11m

And I can login to kibana, and again, the fleetagents and agent policies are not there.

This means using two different approaches (kubectl apply vs. helm) and they both yield the same result whereby there are no fleet agents or agent policies.

I must be misunderstanding the Elasticsearch documentation. I am clearly missing some steps that are obvious to everyone else, but has completely gone over my head.

Can someone tell me what I'm missing?

And a little more background which might explain my confusion...I was reading this blog a while back:

And all I had to do was docker-compose up using this file:

And then the agent policies and agents were immediately visible in Kibana. So I was just under the impression that kubectl apply -f .... or helm install ... would have done something similar...

Hello @learningelastic, the problem is that the kubernetes template example you're using is missing the relevant resources. It doesn't contain the same list of resources as the shared docker compose file, which includes fleet, logstash, etc.

Depending on what you are trying to achieve, you will need to use other template recipes and modify them according to your needs. For example, if you want to start a fleet server with APM integration, you could use the following recipe: Fleet APM Integration.

1 Like