Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Kube annotations for Deis applications #545

Closed
intellix opened this issue Oct 11, 2016 · 7 comments
Closed

Kube annotations for Deis applications #545

intellix opened this issue Oct 11, 2016 · 7 comments

Comments

@intellix
Copy link
Contributor

intellix commented Oct 11, 2016

TL;DR: K8S Annotations for attaching arbitrary metadata to applications for attaching/retrieving from Deis API

So I'm creating Heroku-style pipelines using the Atlassian stack. We have JIRA issues created like FE-1231 and then create pull-requests and commits with the issue number prefixed:

Branch: FE-1231-footer-styling
Commit: FE-1231 fix(footer): improve the styling to not glitch

I've got webhooks making POST requests to an Express middleware for creating applications in the Pull-Request lifecycle like:

PR Opened: deis apps:create myproject-pr-1 --remote myproject-pr-1
PR Declined: deis apps:destroy --app myproject-pr-1 --confirm myproject-pr-1
PR Updated: git push myproject-pr-1 origin/myproject-pr-1

Once my middleware server is fully working, I want to create 3-lane UI for showing the Pull-requests in their lifecycle by using the Deis API.

Column 1: List of PR applications
Column 2: Staging [deploy to Production]
Column 3: Production

When I create these 3 columns of cards, it would be nice to present additional data such as the

  • JIRA ID
  • PR Title
  • PR Comment
  • Commit hash
  • PR Creator

At the moment, I can only attach tags, and that complains that there aren't any Nodes to match against. I'll have to use kubectl for the time being to attach them, but guessing I need to retrieve them via the k8s API as well

@bacongobbler
Copy link
Member

Is this something that cannot be handled through deis config? Perhaps I'm missing the main use case here for how one would use the labels.

@kmala
Copy link
Contributor

kmala commented Oct 11, 2016

i think he wants to add few annotations to the apps so that he can filter using k8s api and show different statistics/details of his CI flow.

@bacongobbler
Copy link
Member

Right, so my issue with a new deis annotate feature (or equivalent) comes down to whether this makes sense within Workflow. From an application's standpoint this does not make sense for their use case. For a user that is assumed to not have access to the kubernetes API (e.g. a multi-tenant world, which I'd like us to eventually become) what use case does this solve that deis config doesn't already?

@intellix
Copy link
Contributor Author

I wasn't aware of config actually. Was pointed towards K8S Annotations when I asked about storing arbitrary data :)

It looks like environment variables would work for me. Unless anyone else has any reason for k8s annotations in their app I see no reason to keep this issue.

@bacongobbler
Copy link
Member

Sounds good. Let's close this out for now then :)

@intellix
Copy link
Contributor Author

Actually I have one thought about annotations.
I'm now using config to group applications for pipelines like:

myapp: {
  pipeline: "myapp"
}

myapp-staging: {
  pipeline: "myapp"
}

myapp-pr-1: {
  pipeline: "myapp"
}

When I create a pipeline for an application it triggers a rebuild because of new config. The rebuild isn't required and there's no way to stop that.

@mirague
Copy link

mirague commented Feb 28, 2017

In order to use kube2iam you need to add an annotation to your Pods with the desired IAM role. Now this can be achieved by kubectl edit deployment but this doesn't persist through Deis upgrades of the app.

Being able to set an annotation on a deployment (and thus on pods) would be extremely helpful. It would allow the use of kube2iam to selectively add AWS IAM roles to apps and to enable certain k8s alpha features, e.g. Node Affinity/Anti-Affinity.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants