# Grouping Instances

Sometimes Instances become quite large with many components. If you work on them with multiple team members, you end up having to synchronize the deployment of the Instances.

You can easily rip large Instances apart using the `group` tag, joining multiple Instances into one group and making sure the NetworkPolicies are opened to pods from other Instances within the Instance Group.

```yaml
global:
  instance:
    # -- despite the instance name, all components within this group will be prefixed
    # with the group (unless the group name and the environment name are not identical)
    # Also this makes sure the network policies are acting on the group, not on the instance.
    group: "sample-group"
```

You can query the instance group in your code with `.instance.group`.

Example: We build multiple Instances in one group:

- sample-group-backend
  - Database
  - nstl
  - rs
- sample-group-middleware
  - nappl
  - application(s)
- sample-group-frontend
  - web
  - cmis

Portainer is showing the group as if it were an single instance:

![Portainer](assets/portainer.png)



The nplus UI is showing the instances of the group:

![nplus Web Monitoring](assets/monitor.png)

And the nplus CLI is also showing single instances:

```
% kubectl get nscale
NAME                                                                 INSTANCE                         COMPONENT       TYPE            VERSION    STATUS
component.nplus.cloud/sample-group-cmis                              sample-group-frontend            cmis            cmis            9.2.1200   healthy
component.nplus.cloud/sample-group-database                          sample-group-backend             database        database        16         healthy
component.nplus.cloud/sample-group-nappl                             sample-group-middleware          nappl           core            9.2.1302   healthy
component.nplus.cloud/sample-group-rs                                sample-group-backend             rs              rs              9.2.1201   healthy
component.nplus.cloud/sample-group-web                               sample-group-frontend            web             web             9.2.1300   healthy

NAME                                                  HANDLER   VERSION    TENANT   STATUS
instance.nplus.cloud/sample-group-backend             manual    9.2.1302            healthy
instance.nplus.cloud/sample-group-frontend            manual    9.2.1302            healthy
instance.nplus.cloud/sample-group-middleware          manual    9.2.1302            healthy
```
