Skip to content

Missing permissions in kubernetes deployment manifest of Elastic-Agent  #35

Closed

Description

@Danouchka

Deploying https://github.com/elastic/endpoint/tree/main/releases/8.5.0/kubernetes/deploy on GKE, we can see this error from elastic-agent

metricbeat stderr: "E1108 07:59:03.061004 1702055 reflector.go:138] pkg/mod/k8s.io/client-go@v0.23.4/tools/cache/reflector.go:167: Failed to watch *v1.StorageClass: failed to list *v1.StorageClass: storageclasses.storage.k8s.io is forbidden: User \"system:serviceaccount:kube-system:elastic-agent\" cannot list resource \"storageclasses\" in API group \"storage.k8s.io\" at the cluster scope\n"

I think this should be added in the manifest

  • apiGroups: ["rbac.authorization.k8s.io"]
    resources:
    - clusterrolebindings
    - clusterroles
    - rolebindings
    - roles
    verbs: ["get", "list", "watch"]

Activity

  1. added
    bug
    on Nov 8, 2022
  2. Danouchka commented on Nov 30, 2022

    @Danouchka
    Author
  3. crowens commented on Jan 10, 2023

    @crowens
    Collaborator

    @Danouchka is this still an issue? @norrietaylor

  4. Danouchka commented on Jan 10, 2023

    @Danouchka
    Author

    Hi, As I have said, when I add the permissions on the manifest, the Elastic Agent does not send any error

  5. norrietaylor commented on Jan 11, 2023

    @norrietaylor
    Contributor

    Hello @Danouchka! Thanks for the feedback and suggestion here.

    @mjwolf is going to take a look at this and provide a solution. At first glance, those changes look reasonable; we should find out why they are missing.

    I have a couple of questions:

    1. Have you made any other changes to the YAML provided here? If so, can you share them?
    2. What version of the Elastic stack are you connecting to?
    3. Can you tell me anything else about your GKE cluster? The version, node type? (I assume this isn't autopilot)
  6. Danouchka commented on Jan 11, 2023

    @Danouchka
    Author

    Hello

    Please find my answers below
    Have you made any other changes to the YAML provided here? If so, can you share them? => No other changes
    What version of the Elastic stack are you connecting to? => 8.5.3
    Can you tell me anything else about your GKE cluster? The version, node type? (I assume this isn't autopilot) => 1.23.13-gke.900, no autopilot

  7. mjwolf commented on Jan 11, 2023

    @mjwolf
    Contributor

    There was already a fix for this in the agent template (this part of the elastic-defend template uses the agent template). I've created a PR to port the fix to the defend template

  8. norrietaylor commented on Jan 12, 2023

    @norrietaylor
    Contributor

    Thanks for the quick turnaround on this, @mjwolf. I appreciate it.

  9. added a commit that references this issue on Jan 19, 2023
    a1fcb5d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugv8.5.0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions