Skip to content

feat(argo-cd): Add ability to annotate Deployments and StatefulSets#1608

Merged
mkilchhofer merged 4 commits intoargoproj:mainfrom
jstewart612:argo-cd-annotate-addtl-objects
Nov 30, 2022
Merged

feat(argo-cd): Add ability to annotate Deployments and StatefulSets#1608
mkilchhofer merged 4 commits intoargoproj:mainfrom
jstewart612:argo-cd-annotate-addtl-objects

Conversation

@jstewart612
Copy link
Contributor

@jstewart612 jstewart612 commented Oct 31, 2022

Signed-off-by: John Stewart jstewart@rentpath.com

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • I have bumped the chart version according to versioning
  • I have updated the documentation according to documentation
  • I have updated the chart changelog with all the changes that come with this pull request according to changelog.
  • Any new values are backwards compatible and/or have sensible default.
  • I have signed off all my commits as required by DCO.
  • My build is green (troubleshooting builds).

Changes are automatically published when merged to main. They are not published on branches.

Signed-off-by: John Stewart <jstewart@rentpath.com>
level: info

# -- Annotations for the all deployed Statefulsets
statefulsetAnnotations: {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the type important or simple annotations would be enough? Technically all things in this chart are Deployments and only controller component is StatefulSet.

Copy link
Contributor Author

@jstewart612 jstewart612 Nov 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elsewhere in this chart is the value concept of podAnnotations. As such, since it was accepted, I presumed this was a desired standard of distinguish that which you were annotating. Therefore, I carried forward that convention. Reworking to dissolve that convention is something theoretically doable... but it feels like scope creep against what this PR is trying to solve... no?

If you disagree, perhaps a more general convention could be adopted throughout. Maybe a generalized "annotations" key with subkeys "pod", "deployment", and "statefulset"? Even if only one of the statefulsets are present in the entire helm chart, it is, and it's not a choice I made... and therefore one for which I have a use case that must account that I suspect others may have as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I'm asking because If you take a look on every single resource in this chart (services, accounts, secrets, configmaps, etc.) you will see annotations and labels as a standard for metadata section. Yet the PR is using nonstandard controller.deploymentAnnotations for metadata section. This is would also imply that controller with kind: StatefulSet is actually a deployment which is not true.

  2. For global section I'm wondering if globally defined common annotations should be split based on component kind and what is the actual real use case for that.

Copy link
Contributor Author

@jstewart612 jstewart612 Nov 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is inaccurate to say "every single resource in this chart":

| global.podAnnotations | object | `{}` | Annotations for the all deployed pods |
| configs.credentialTemplatesAnnotations | object | `{}` | Annotations to be added to `configs.credentialTemplates` Secret |
| configs.repositoriesAnnotations | object | `{}` | Annotations to be added to `configs.repositories` Secret |
| controller.podAnnotations | object | `{}` | Annotations to be added to application controller pods |
| repoServer.podAnnotations | object | `{}` | Annotations to be added to repo server pods |
| server.podAnnotations | object | `{}` | Annotations to be added to server pods |
| dex.podAnnotations | object | `{}` | Annotations to be added to the Dex server pods |
| redis.podAnnotations | object | `{}` | Annotations to be added to the Redis server pods |
| applicationSet.podAnnotations | object | `{}` | Annotations for the controller pods |
| notifications.podAnnotations | object | `{}` | Annotations to be applied to the controller Pods |

The "actual real use case for that", in this case, is third party software suites that operate based on said annotations that I cannot presently use with your helm chart. For example, Stakater Reloader https://github.com/stakater/Reloader. There are secrets in the helm chart that the software does not reload the pods for when required to do so. As such, our organizational strategy is to leverage this whenever applications have edge cases where Secrets data they use do not reload upon that data's change when required to. Any extra Secret I add to related Deployments or Statefulsets will operate this way. The only one I know of that you auto reload is SSL cert for argocd-server, and we've even had that fail on us once (cert-manager updated the Secret for the TLS cert, argo-cd did not reload it until pod termination and restart... that will be a separate issue with our findings there).

As for global, I'll rephrase my first response on the matter. I wouldn't be opposed to, say:

global.annotations.pod
global.annotations.statefulset
global.annotations.deployment

If we did this, though, global.podAnnotations would then become redundant, and, naturally, for consistency, you'd want to rip that out. Will you require this of me to approve this PR? I was also trying to avoid making other people change things about how they use things (a breaking change).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining this and you are right that there are some places where this convention isn't followed. I was trying to figure why are new specific definitions for annotations required so we can avoid unnecessary tech debt.

Signed-off-by: John Stewart <32647598+jstewart612@users.noreply.github.com>
@pdrastil
Copy link
Member

pdrastil commented Nov 4, 2022

Thank you for explaining. Now I see where this is heading. I've actually discussed usage of Reloader with @mkilchhofer as we are aware of problems with automatic restarts of pods when some externally managed secrets or configmaps change and I haven't immediately recognised that this PR is related to Reloader.

Use cases for this PR will be to add support for reloading all running pods when configmap or secret changes like this:

global:
  deploymentAnnotations:
    reloader.stakater.com/auto: "true"
  statefulsetAnnotations:
    reloader.stakater.com/auto: "true"

Or in some cases it might be selective reload like this:

# Reload resources with match
global:
  deploymentAnnotations:
    reloader.stakater.com/search: "true"
  statefulsetAnnotations:
    reloader.stakater.com/search: "true"

configs:
  params:
    annotations:
      reloader.stakater.com/match: "true"

# Reloads specific secret
controller:
  annotations:
    secret.reloader.stakater.com/reload: "argocd-repo-server-tls"

repoServer:
  annotations:
    secret.reloader.stakater.com/reload: "argocd-repo-server-tls"

To get approval:

  1. Please change deploymentAnnotations to annotations on individual component level
  2. I would keep global defaults as they are now. It's kinda copy & paste of same annotation into 2 places but It's possible that we might want to introduce common annotations for every resource or default annotations for specific resources if we see need for that. @mkilchhofer @yu-croco @jmeridth wdyt?

Edit maybe just deploymentAnnotations in global section would be enough to avoid copy & paste even if it's not accurate for STS.

@jmeridth
Copy link
Member

jmeridth commented Nov 4, 2022

@pdrastil there is controller.deploymentAnnotations in the argo-workflows chart currently. We use that at my day job for reloader annotations currently. argo-cd chart may have other annotations that could be "centralized" but we may want to think about this across all charts maybe? I'm a fan of specific but can be outvoted. @mkilchhofer @yu-croco

@pdrastil
Copy link
Member

pdrastil commented Nov 4, 2022

@pdrastil If you mean all charts then it's about naming things in global section more than component level as it's common to group multiple deployments under single umbrella chart.

@mkilchhofer
Copy link
Member

@pdrastil If you mean all charts then it's about naming things in global section more than component level as it's common to group multiple deployments under single umbrella chart.

Sure? Do you like the setup where multiple Argo components are deployed together with an umbrella chart? I always try to avoid this to have smaller piece of potential breaking stuff at once :-D

Copy link
Member

@mkilchhofer mkilchhofer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
@mkilchhofer mkilchhofer force-pushed the argo-cd-annotate-addtl-objects branch from 3704e91 to 64b2087 Compare November 30, 2022 22:35
@mkilchhofer mkilchhofer merged commit b97e652 into argoproj:main Nov 30, 2022
@jstewart612 jstewart612 deleted the argo-cd-annotate-addtl-objects branch December 1, 2022 00:02
ilia-medvedev added a commit to codefresh-io/argo-helm that referenced this pull request Feb 2, 2023
* feat(argo-cd): Upgrade Argo CD to 2.5.0 (argoproj#1568)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* chore(github): Bump GitHub actions versions (argoproj#1575)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* fix(argo-cd): Chart NOTES nil references (argoproj#1582)

Signed-off-by: Filipe Santos <filipe@not.sh>

* docs(argo-cd): Improve documentation (argoproj#1584)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* fix(argo-workflows): serviceaccount rbac when sso is enabled (argoproj#1586)

Signed-off-by: Nick Fisher <nxf5025@gmail.com>

Signed-off-by: Nick Fisher <nxf5025@gmail.com>

* Fix incorrect applicationSet property in README (argoproj#1590)

Based on [here](https://github.com/argoproj/argo-helm/blob/55b8b34d20ebaf38fa05e1113daf30220d11e725/charts/argo-cd/templates/argocd-applicationset/deployment.yaml#L9), I think `replicas` should be `replicaCount` (though `replicas` would be more consistent).

Signed-off-by: Ashlin Eldridge <ashlin.eldridge@gmail.com>

Signed-off-by: Ashlin Eldridge <ashlin.eldridge@gmail.com>

* fix(argo-cd): Remove AWS volume from server (argoproj#1591)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* chore(argo-cd): Cleanup Redis manifest (argoproj#1577)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* fix(argo-cd): Fix migration path for server configs (argoproj#1585)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* fix(argo-cd): Type conversion for ConfigMaps values (argoproj#1594)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* feat(argo-cd): Add probes for ApplicationSet controller (argoproj#1532)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* chore(argo-cd): Remove liveness probe from application controller (argoproj#1581)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* chore(github): Add dependabot.yml (argoproj#1595)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* feat(argo-cd): Set container security contexts (argoproj#1579)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* feat(argo-cd): Support custom TLS certificates for Dex (argoproj#1477)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* feat(argo-cd): Support manually managed TLS certificate for Server (argoproj#1534)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* fix(argo-cd): Don't install CRDs for disabled components (argoproj#1596)

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* fix(argo-cd): update network policy port name (argoproj#1603)

Signed-off-by: Eric Cimino <ecimino@vailsys.com>

* chore(argo-workflows): Update ArgoWorkflows to v3.4.3 (argoproj#1610)

Signed-off-by: yu-croco <yu.croco@gmail.com>

* fix(argo-cd): Replace coalesce with merge for old config values (argoproj#1612)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* feat(argo-cd): Add revisionHistoryLimit (argoproj#1599)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Upgrade Argo Image to the latest (argoproj#1614)

Signed-off-by: Dong Wang <wd@wdicc.com>

Signed-off-by: Dong Wang <wd@wdicc.com>

* chore(argo-cd): Update redis-ha (argoproj#1617)

Signed-off-by: yu-croco <yu.croco@gmail.com>

* fix(argo-cd): Add /tmp voulmeMount to extensions container (argoproj#1620)

* Fixes argoproj#1619 - Add /tmp voulmeMount to extensions container

Signed-off-by: Tim Van de Walle <tvandewalle@trek10.com>

* Bump version, add change notes

Signed-off-by: Tim Van de Walle <tvandewalle@trek10.com>

Signed-off-by: Tim Van de Walle <tvandewalle@trek10.com>

* fix(argo-cd): Add missing ClusterRole permissions to argo-cd-server to manage Application in all namespaces (argoproj#1621)

Signed-off-by: Elad Dolev <dolevelad@gmail.com>

* fix(argo-cd): Use Dex non-distroless image (argoproj#1626)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* chore(argo-cd): Upgrade Argo CD to 2.5.2 (argoproj#1628)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Allow to add custom artifact repository (argoproj#1453)

Signed-off-by: Max Kochubey <20810306+maxkochubey@users.noreply.github.com>

Signed-off-by: Max Kochubey <20810306+maxkochubey@users.noreply.github.com>

* fix(argo-cd): Use raw json for cluster credentials for Vault compatibility (argoproj#1634)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>
Co-authored-by: Aikawa <yu.croco@gmail.com>

* fix(argo-cd): Cluster credentials config should be a string (argoproj#1636)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* fix(argo-workflows): Added missing attribute for sso (argoproj#1641)

Signed-off-by: yu-croco <yu.croco@gmail.com>

* docs(argo-cd): Improve changelog information (argoproj#1652)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* chore(argo-cd): Consolidated GnuPG configuration (argoproj#1609)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* fix(argo-cd): Invalid argocd-gpg-keys-cm template (argoproj#1656)

The template removed a little too much whitespace resulting in an invalid ConfigMap.

Error:
```
Error: YAML parse error on argocd/charts/argo-cd/templates/argocd-configs/argocd-gpg-keys-cm.yaml: error converting YAML to JSON: yaml: line 10: mapping values are not allowed in this context
```

Signed-off-by: Allex <allexveldman+github@gmail.com>

Signed-off-by: Allex <allexveldman+github@gmail.com>

* feat(argo-workflows): Allow controller to whitelist secrets (argoproj#1646)

* allow users to whitelist secrets

Signed-off-by: emmayylu <84873428+yolu-kxs@users.noreply.github.com>

* remove unnecessary if-statement

Signed-off-by: emmayylu <44856279+emmayylu@users.noreply.github.com>

* use square bracket for array

Signed-off-by: emmayylu <44856279+emmayylu@users.noreply.github.com>

* fix typo and update readme

Signed-off-by: emmayylu <44856279+emmayylu@users.noreply.github.com>

Signed-off-by: emmayylu <84873428+yolu-kxs@users.noreply.github.com>
Signed-off-by: emmayylu <44856279+emmayylu@users.noreply.github.com>
Co-authored-by: emmayylu <84873428+yolu-kxs@users.noreply.github.com>

* feat(argo-workflows): Add labels for ServiceAccounts (argoproj#1665)

* Add labels for ServiceAccounts

Signed-off-by: Eugene Lugovtsov <lug.zhenia@gmail.com>

* fix workflow serviceaccount labels

Signed-off-by: Eugene Lugovtsov <lug.zhenia@gmail.com>

* fix docs

Signed-off-by: Eugene Lugovtsov <lug.zhenia@gmail.com>

Signed-off-by: Eugene Lugovtsov <lug.zhenia@gmail.com>

* fix(argo-cd): deprecate server.extraArgs."--insecure" (argoproj#1669)

Signed-off-by: GitHub <noreply@github.com>

Signed-off-by: GitHub <noreply@github.com>

* chore(argo-workflows): Support workflow retention (argoproj#1668)

Signed-off-by: yu-croco <yu.croco@gmail.com>

* feat(argo-cd): Upgrade argocd to v2.5.3 (argoproj#1671)

Signed-off-by: smcavallo <smcavallo@hotmail.com>

* fix helm install md (argoproj#1672)

Signed-off-by: fsl <1171313930@qq.com>

Signed-off-by: fsl <1171313930@qq.com>

* feat(argo-cd): Add Repo Server strict TLS cert support (argoproj#1673)

Signed-off-by: Karl Parry <karl.parry@imbursepayments.com>

* chore(argo-workflows): Update Argo Workflows to v3.4.4 (argoproj#1674)

Signed-off-by: yu-croco <yu.croco@gmail.com>

* fix(argo-cd): Rename tls secret to include the -secret suffix (argoproj#1676)

- "[Fixed]: TLS secret name so Dex correctly generates the checksum for argocd-dex-server-tls."
- "[Fixed]: Standardise the naming convention of the TLS secret manifests."
- "[Added]: Add checksum to Repo-Server for the argocd-repo-server-tls secret."

Signed-off-by: Karl Parry <karl.parry@imbursepayments.com>

* chore(argo-cd): Remove duplicate ApplicationSet features (argoproj#1598)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* feat(argo-cd): Add ability to annotate Deployments and StatefulSets (argoproj#1608)

* feat(argo-cd): Add ability to annotate Deployments and StatefulSets

Signed-off-by: John Stewart <jstewart@rentpath.com>

* fix: Controller and AppSet controller was mixed

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

Signed-off-by: John Stewart <jstewart@rentpath.com>
Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* chart update WIP

* backport applicationset

* backport applicationset

* argocd 2.5.5

---------

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>
Signed-off-by: Filipe Santos <filipe@not.sh>
Signed-off-by: Nick Fisher <nxf5025@gmail.com>
Signed-off-by: Ashlin Eldridge <ashlin.eldridge@gmail.com>
Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
Signed-off-by: Eric Cimino <ecimino@vailsys.com>
Signed-off-by: yu-croco <yu.croco@gmail.com>
Signed-off-by: Dong Wang <wd@wdicc.com>
Signed-off-by: Tim Van de Walle <tvandewalle@trek10.com>
Signed-off-by: Elad Dolev <dolevelad@gmail.com>
Signed-off-by: Max Kochubey <20810306+maxkochubey@users.noreply.github.com>
Signed-off-by: Allex <allexveldman+github@gmail.com>
Signed-off-by: emmayylu <84873428+yolu-kxs@users.noreply.github.com>
Signed-off-by: emmayylu <44856279+emmayylu@users.noreply.github.com>
Signed-off-by: Eugene Lugovtsov <lug.zhenia@gmail.com>
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: smcavallo <smcavallo@hotmail.com>
Signed-off-by: fsl <1171313930@qq.com>
Signed-off-by: Karl Parry <karl.parry@imbursepayments.com>
Signed-off-by: John Stewart <jstewart@rentpath.com>
Co-authored-by: Petr Drastil <petr.drastil@gmail.com>
Co-authored-by: Filipe <filipe@not.sh>
Co-authored-by: Nick Fisher <nxf5025@gmail.com>
Co-authored-by: Ashlin Eldridge <ashlin.eldridge@gmail.com>
Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
Co-authored-by: Eric Cimino <58572548+cimin0@users.noreply.github.com>
Co-authored-by: Aikawa <yu.croco@gmail.com>
Co-authored-by: Dong Wang <wd@wdicc.com>
Co-authored-by: tvandewalle <1022306+tvandewalle@users.noreply.github.com>
Co-authored-by: Elad Dolev <dolevelad@gmail.com>
Co-authored-by: Max Kochubey <20810306+maxkochubey@users.noreply.github.com>
Co-authored-by: Allex <a.veldman@chain-stock.com>
Co-authored-by: emmayylu <44856279+emmayylu@users.noreply.github.com>
Co-authored-by: emmayylu <84873428+yolu-kxs@users.noreply.github.com>
Co-authored-by: Eugene Lugovtsov <34510252+EugeneLugovtsov@users.noreply.github.com>
Co-authored-by: Zadkiel Aharonian <zadkiel.aharonian@gmail.com>
Co-authored-by: smcavallo <smcavallo@users.noreply.github.com>
Co-authored-by: fsl <1171313930@qq.com>
Co-authored-by: Karl Parry <88431088+karlparry@users.noreply.github.com>
Co-authored-by: John Stewart <32647598+jstewart612@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants