# How to assign index routing allocation with APM

**URL:** <https://discuss.elastic.co/t/how-to-assign-index-routing-allocation-with-apm/306650>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [June 8, 2022, 8:10am UTC](https://discuss.elastic.co/t/how-to-assign-index-routing-allocation-with-apm/306650 "2022-06-08T08:10:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kay\_Khan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kay_khan/32/45028_2.png) [@Kay\_Khan](https://discuss.elastic.co/u/Kay_Khan)\
**Post date:** [June 8, 2022, 8:10am UTC](https://discuss.elastic.co/t/how-to-assign-index-routing-allocation-with-apm/306650/1 "2022-06-08T08:10:53Z")

</div>

I am using APM version 8.2.0, how do i allocate the indexes/data-streams to be on a specific nodeset.

For example in my metricbeat.yml and filebeat.yml i might do the following:

```auto
setup.template.settings:
      index:
        routing.allocation.require.type: "monitoring"

```

However the above does not work with apm server.

**apm.yaml**

```auto
apiVersion: apm.k8s.elastic.co/v1
kind: ApmServer
metadata:
  name: apm-server-prod
  namespace: elastic-system
spec:
  version: 8.2.0
  count: 1
  elasticsearchRef:
    name: "elasticsearch-prod"
  kibanaRef:
    name: "kibana-prod"
  http:
    service:
      spec:
        type: NodePort
  config:
    setup.template.settings:
      index:
        routing.allocation.require.type: "monitoring" // Does not work
    apm-server:
      auth:
        anonymous:
          rate_limit:
            event_limit: 300
            ip_limit: 1000
          allow_service: ["admin-dashboard"]
      rum: 
        enabled: true
        allow_origins: ["*"]

```

**kibana.yaml**

```auto
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: kibana-prod
  namespace: elastic-system
spec:
  version: 8.2.0
  count: 1
  elasticsearchRef:
    name: elasticsearch-prod
  http:
    service:
      spec:
        type: NodePort
  podTemplate:
    metadata:
      labels:
        scrape: kb
    spec:
      containers:
      - name: kibana
        resources:
          limits:
            memory: 2Gi
            cpu: 1
      nodeSelector:
        geeiq/node-type: ops
  config:
    monitoring.kibana.collection.enabled: false
    xpack.fleet.packages:
      - name: apm
        version: latest

```

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/d/9db0ac328f308b2231efe0a9a3718dd398249a20.png)

I'm looking for a solution that i can programtically make, not a manual solution using the kibana dashboard/ui

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2022, 8:11am UTC](https://discuss.elastic.co/t/how-to-assign-index-routing-allocation-with-apm/306650/2 "2022-07-06T08:11:47Z")

</div>

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