# Sample APM Project on Kubernetes is empty?

**URL:** <https://discuss.elastic.co/t/sample-apm-project-on-kubernetes-is-empty/368608>\
**Category:** APM\
**Tags:** agent-explorer\
**Created:** [October 10, 2024, 9:04am UTC](https://discuss.elastic.co/t/sample-apm-project-on-kubernetes-is-empty/368608 "2024-10-10T09:04:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![learningelastic](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@learningelastic](https://discuss.elastic.co/u/learningelastic)\
**Post date:** [October 10, 2024, 9:04am UTC](https://discuss.elastic.co/t/sample-apm-project-on-kubernetes-is-empty/368608/1 "2024-10-10T09:04:02Z")

</div>

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

> <https://github.com/elastic/cloud-on-k8s/blob/2.14/config/samples/apm/apm_es_kibana.yaml>

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

```auto
# 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

```auto
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:

 ![Screenshot 2024-10-10 045911](https://us1.discourse-cdn.com/elastic/original/3X/c/7/c70f79e43346e94befdb21dd8582dafbe1feb57f.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/a/ea5cdd099043be74f550cc6053a7048da61783c8.png)

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?

---

<div class="post-metadata">

**Author:** ![learningelastic](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@learningelastic](https://discuss.elastic.co/u/learningelastic)\
**Post date:** [October 11, 2024, 11:24pm UTC](https://discuss.elastic.co/t/sample-apm-project-on-kubernetes-is-empty/368608/2 "2024-10-11T23:24:33Z")

</div>

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

```auto
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?

---

<div class="post-metadata">

**Author:** ![learningelastic](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@learningelastic](https://discuss.elastic.co/u/learningelastic)\
**Post date:** [October 11, 2024, 11:37pm UTC](https://discuss.elastic.co/t/sample-apm-project-on-kubernetes-is-empty/368608/3 "2024-10-11T23:37:05Z")

</div>

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

> **[Getting started with the Elastic Stack and Docker Compose: Part 2](https://www.elastic.co/blog/getting-started-with-the-elastic-stack-and-docker-compose-part-2)**
>
> In this blog, build on our previous cluster and implement additional features such as Fleet, Agent, APM, and a demo application for your POC delight! Remember, Docker Compose is not recommended for pr...

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

> <https://github.com/elkninja/elastic-stack-docker-part-two/blob/main/docker-compose.yml>

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...

---

<div class="post-metadata">

**Author:** ![Kostya\_Masliuk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kostya_masliuk/32/137867_2.png) [@Kostya\_Masliuk](https://discuss.elastic.co/u/Kostya_Masliuk)\
**Post date:** [October 12, 2024, 3:17am UTC](https://discuss.elastic.co/t/sample-apm-project-on-kubernetes-is-empty/368608/4 "2024-10-12T03:17:57Z")

</div>

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](https://github.com/elastic/cloud-on-k8s/blob/main/config/recipes/elastic-agent/fleet-apm-integration.yaml).
