gravitational / teleport

The easiest, and most secure way to access and protect all of your infrastructure.
https://goteleport.com
GNU Affero General Public License v3.0
17.42k stars 1.74k forks source link

Kubernetes app discovery : be able to filter on annotations #38001

Open mtparet opened 7 months ago

mtparet commented 7 months ago

What would you like Teleport to do?

We can filter applications (ie: kubernetes services) on labels but not on annotations although most helm chart offer customization of annotations but not often labels.

    # Matchers for discovering services inside Kubernetes clusters and exposing them as Teleport apps
    # When the `kubernetes` value is set, the `discovery_group` parameter is mandatory and should be set to
    # the name of Kubernetes cluster where the discovery service is running.
    kubernetes:
      # Type of services to discover. Currently, only "app" is supported. Default value is `["app"]`
    - types: ["app"]
      # List of namespaces of the Kubernetes cluster to search in. Default value is `*` to search all namespaces.
      namespaces: ["test", "staging"]
      # List of Kubernetes labels to match when the Discovery service queries Kubernetes cluster services.
      # Default value is `*`: `*` to match any labels.
      labels:
        "purpose": "monitoring"
        "department": "security"
      annotations: <- the filter key we want to add
        "teleport-apps": "enabled"

What problem does this solve?

Be able to activate kubernetes app discover, it exposes too many applications for now and we cannot filter these correctly without using filters on annotations.

If a workaround exists, please include it.

Manually define applications but it's painful.

zmb3 commented 7 months ago

In #36394 a teleport.dev/ignore annotation was added that may help you to filter out apps you don't want to discover.

mtparet commented 7 months ago

Ignore will not really work correctly for us because it means we have to add it to hundred services and we have to continuously monitor new services to add these annotations on these.