# Defining assets (or other resources) in multiple namespaces

**URL:** <https://discourse.sensu.io/t/defining-assets-or-other-resources-in-multiple-namespaces/1264>\
**Category:** Sensu Go\
**Created:** [July 17, 2019, 2:19pm UTC](https://discourse.sensu.io/t/defining-assets-or-other-resources-in-multiple-namespaces/1264 "2019-07-17T14:19:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KendallChenoweth](https://avatars.discourse-cdn.com/v4/letter/k/ecd19e/32.png) [@KendallChenoweth](https://discourse.sensu.io/u/KendallChenoweth)\
**Post date:** [July 17, 2019, 2:19pm UTC](https://discourse.sensu.io/t/defining-assets-or-other-resources-in-multiple-namespaces/1264/1 "2019-07-17T14:19:21Z")

</div>

I have an asset defined that is used for checks that will run in multiple namespaces. Do I need to define an asset for each namespace in multiple files or is there some other alternative?

I’m also interested in defining handlers, in a single file definition, to run in mulitple namespaces.

Thanks!

---

<div class="post-metadata">

**Author:** ![calebhailey](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/calebhailey/32/46_2.png) [@calebhailey](https://discourse.sensu.io/u/calebhailey)\
**Post date:** [July 17, 2019, 2:37pm UTC](https://discourse.sensu.io/t/defining-assets-or-other-resources-in-multiple-namespaces/1264/2 "2019-07-17T14:37:31Z")

</div>

Hi there, @KendallChenoweth 👋 you will need to register the asset(s) in each namespace you want to use them in, but you no longer need to hardcode this into your Asset definitions. As of Sensu Go version 5.10 you can omit the `metadata.namespaces` attribute in resource definitions and provide the namespace via `sensuctl` (defaults to the “active” namespace, or by specifying the namespace using the `--namespace` flag).

Here’s the excerpt from the 5.10.0 release notes:

> The `sensuctl create` command now supports specifying the namespace for a group of resources at the time of creation, allowing you to replicate resources across namespaces without manual editing. See the [sensuctl reference](https://docs.sensu.io/sensu-go/5.10/sensuctl/reference#creating-resources-across-namespaces) for more information and usage examples.

Source: [Sensu Go release notes - Sensu Docs](https://docs.sensu.io/sensu-go/latest/release-notes/#5-10-0-release-notes)

---

<div class="post-metadata">

**Author:** ![jspaleta](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jspaleta/32/141_2.png) [@jspaleta](https://discourse.sensu.io/u/jspaleta)\
**Post date:** [July 17, 2019, 7:22pm UTC](https://discourse.sensu.io/t/defining-assets-or-other-resources-in-multiple-namespaces/1264/3 "2019-07-17T19:22:26Z")

</div>

More on this new feature.  
We just adjusted [Bonsai Asset Index](https://bonsai.sensu.io) to work better with 5.10+. so Bonsai no longer hardcodes the namespace by default for generated asset configuration files. It should be much easier now to apply the Bonsai provided asset configs into you artive namespace now!
