Skip to content

Nomad ACL support for meta tag filtering.  #24715

Open
@dkyanakiev

Description

@dkyanakiev

Proposal

Hi there 👋
Currently the ACLs for namespaces have to be created on a per namespace basis or if you use a wildcard.

namespace "dev-*" {
  policy = "read"
  capabilities = [
    "read-logs",
    "submit-job"
  ]
}

The problem comes when you want to have a policy that is applied to X namespaces that for example don't follow name pattern, so the wildcard cant work. If they are a handful you can always duplicate the policy but this scales really poorly. Since namespaces already have meta tags, it makes sense to be able to create a policy applicable to many namespaces based on meta tags.

Use-cases

Example of a policy with a filter

namespace {
  filter {
    meta = "team == 'abc'"
  }
  policy = "read"
  capabilities = [
    "alloc-lifecycle",
    "dispatch-job",
    "read-logs",
    "submit-job",
    "csi-mount-volume"
  ]
}

This way in a scenario where namespaces and change ownerships and teams that interact with them, you could easily have a policy that would match all the namespaces with the correct meta.

This basically flips the filter from the name to inside the filter block, it would allow for combinations

namespace { 
  filter {
    name = "dev-*"
  }
 ...
}

Which would works as before, when you have a name with wildcard
or allow for a combination

namespace { 
  filter {
      meta = "team == 'abc'"
      name = "dev-*"
    }
...
}

Have something be applied on a specific name + meta tag match

namespace "foo" {
  meta = {
    env = "dev"
    team = "abc"
  }
}

Because meta changes on the namespace, do not impact the workloads, unlike the job changes to the meta, this would allow for generic policies controlled by the meta tags

Attempted Solutions

Could not any existing feature that solves this, right now the issue is to just have a namespace naming pattern tied to a team for example, but that is not ideal as teams can change and it causes lots of issues to move workloads to updates namespaces.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Needs Roadmapping

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions