Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

kubernetes: Feature Request: Step Pod Annotations #38

Closed
benwilson512 opened this issue Jan 16, 2019 · 8 comments
Closed

kubernetes: Feature Request: Step Pod Annotations #38

benwilson512 opened this issue Jan 16, 2019 · 8 comments
Labels
kubernetes Issues related to the Kubernetes Engine

Comments

@benwilson512
Copy link

Use Case

Specific use case: Enabling AWS IAM roles for each pod step.

Kube2IAM works by looking at annotations on a given pod to figure out which role to provide info for. Before, we could just annotate the agent pods, but now each step is running in a new pod and we need a way to annotate that.

In general though there are a variety of K8s features that use annotations.

API

From an API perspective, we could treat this a bit like limits were handled in: #29 . This has the perk that you could apply very specific roles to each step of the pipeline.

@benwilson512 benwilson512 changed the title Step Pod Annotations [Kubernetes] Feature Request: Step Pod Annotations Jan 16, 2019
@bradrydzewski bradrydzewski changed the title [Kubernetes] Feature Request: Step Pod Annotations kubernetes: Feature Request: Step Pod Annotations Jan 22, 2019
@bradrydzewski bradrydzewski added the kubernetes Issues related to the Kubernetes Engine label Jan 22, 2019
@srhopkins
Copy link

srhopkins commented Mar 21, 2019

Is there a work around for this currently? We are blocked as we're unable to access s3 buckets that we use kiam roles with.

@kevtaylor
Copy link

@srhopkins We have an opensource project that uses mutatingwebhooks to apply rules onto namespaces, which might be an option for you https://github.com/HotelsDotCom/kube-graffiti

@willejs
Copy link

willejs commented Jul 1, 2019

@bradrydzewski there are two PRs that address this, can you review them?

@willejs
Copy link

willejs commented Jul 1, 2019

@kevtaylor thats a really cool project. I don't think this will work with the way drone k8s jobs currently work though? The jobs expose info via annotations instead of labels, and the only labels that it sets in the spec that you could use field selectors is job-name, which would be a bit nasty... What are you guys doing? I am curious.
I think the answer is to either fix the runtime annotations as per this PR or use kube-graffiti when there are proper labels added?

@kevtaylor
Copy link

@willejs kube-grafitti can do labels and annotations - we use it to decorate namespaces / kiam policies in general - but appreciate it may be tricky if annotations are dynamic

@willejs
Copy link

willejs commented Jul 1, 2019

@kevtaylor yeah, you can paint labels or annotations, but you can only match on labels or field selectors (name, namespace) so i don't think it's going to work well in the current state?
Adding the annotation to the job would work, but I am also thinking that this might not even be the way to go considering the other runtime changes...
#69

@Sluggerman
Copy link

Hello Drone team,

Firstly thank you for the great tool and all your hard work!

We are also in need of being able to set kube2iam pod annotations, so jobs could natively authenticate in AWS with number of use cases such as ECR, S3, Vault AWS auth etc.

We would really appreciate if this could be added to Drone sooner.

@bradrydzewski
Copy link
Member

there is a new (still experimental) kubernetes runner that supports annotations:
https://github.com/drone-runners/drone-runner-kube

kind: pipeline
type: kubernetes

metadata:
  annotations:
    foo: bar

steps: [ ... ]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kubernetes Issues related to the Kubernetes Engine
Projects
None yet
Development

No branches or pull requests

6 participants