Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing way to add annotations to deployment #69

Open
evangelion1204 opened this issue Oct 4, 2018 · 7 comments
Open

Missing way to add annotations to deployment #69

evangelion1204 opened this issue Oct 4, 2018 · 7 comments

Comments

@evangelion1204
Copy link

Hi,

I couldn't find a way to add annotations to a deployment. For service, ingress and even pods it's straight forward. The annotation is at Zalando to define a custom log parsers for Scalyr.
Maybe I just missed the way to achieve it.

@mikkeloscar
Copy link
Contributor

That annotation is added at the pod level i.e. the podTemplate part of the spec.

Example:

apiVersion: zalando.org/v1
kind: StackSet
metadata:
  name: my-app
spec:
  ingress:
    hosts: [my-app.example.org, alt.name.org]
    backendPort: 80
  stackLifecycle:
    scaledownTTLSeconds: 300
    limit: 5
  stackTemplate:
    spec:
      version: v1
      replicas: 3
      podTemplate:
        metadata:
          annotations:
            kubernetes-log-watcher/scalyr-parser: '[{"container": "nginx", "parser": "my-parser"}]'
        spec:
          containers:
          - name: nginx
            image: nginx
            ports:
            - containerPort: 80
              name: ingress

@evangelion1204
Copy link
Author

Thanks a lot, I will try 😄

@evangelion1204
Copy link
Author

Hi, now we really need to add a annotation on deployment level. Is there any way to do it?

@mikkeloscar
Copy link
Contributor

mikkeloscar commented Oct 18, 2018

Not right now, what is the use case? :)

@evangelion1204
Copy link
Author

Our SRE added a custom scaleup/scaledown annotation that is currently only supported at deployments. I asked to move it to the service itself but he argumented that the ReplicaSet is actually owned by the deployment therefor the annotation should belong to the deployment and not service.

@mikkeloscar
Copy link
Contributor

As discussed in private this use case might not be solved by allowing specifying annotations on deployments. Rather the annotations should be on the stacks and the tool which rely on the annotation should operate on stacks instead of deployments.

@szuecs
Copy link
Member

szuecs commented Aug 29, 2024

@mikkeloscar we have the same with docker-meta in our test cluster that we need for e2e image webhook tests.
People annotated their stackset with kube-downscaler annotation : downscaler/force-uptime: "true" which is not propagated to deployment from stackset. So either we need an option to have metadata for deployment or propagate the annotation.

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

No branches or pull requests

3 participants