Skip to content

Commit

Permalink
feat: add annotations through values (#181)
Browse files Browse the repository at this point in the history
This allows us to add additional annotations to applications via globals
  • Loading branch information
saidsef authored Nov 23, 2024
1 parent 124f331 commit 3933560
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 19 deletions.
6 changes: 4 additions & 2 deletions charts/applicationset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: argocd-applicationsets-services
description: A Helm chart for ArgoCD ApplicationSets, a declarative, GitOps continuous delivery tool for Kubernetes
type: application
version: &version "0.13.6"
version: &version "0.14.0"
appVersion: *version
kubeVersion: ">= 1.28"
home: https://github.com/saidsef/argocd-applicationsets-services
Expand All @@ -23,8 +23,10 @@ sources:
annotations:
artifacthub.io/license: "Apache-2.0"
artifacthub.io/changes: |
- kind: added
description: ability to add extra annotations via values file
- kind: changed
description: updated ci pipeline to provide dependency review
description: updated helm readme file
artifacthub.io/links: |
- name: README
url: https://raw.githubusercontent.com/saidsef/argocd-applicationsets-services/main/README.md
Expand Down
8 changes: 4 additions & 4 deletions charts/applicationset/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# argocd-applicationsets-services

![Version: 0.13.3](https://img.shields.io/badge/Version-0.13.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.13.3](https://img.shields.io/badge/AppVersion-0.13.3-informational?style=flat-square)
![Version: 0.14.0](https://img.shields.io/badge/Version-0.14.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.14.0](https://img.shields.io/badge/AppVersion-0.14.0-informational?style=flat-square)

A Helm chart for ArgoCD ApplicationSets, a declarative, GitOps continuous delivery tool for Kubernetes

Expand All @@ -26,10 +26,10 @@ Kubernetes: `>= 1.28`
|-----|------|---------|-------------|
| github | object | `{"api":"https://api.github.com","label":"preview","owner":"saidsef","path":"deployment","secretKey":"","secretName":""}` | GitHub repo configuration parameters |
| gitlab | object | `{"api":"https://gitlab.com","group":"saidsef","label":"preview","path":"deployment","secretKey":"","secretName":""}` | GitLab repo configuration parameters |
| globals | object | `{"deployToNamespace":"previews","label":"preview","notificationChannel":"argocd","requeueAfterSeconds":500,"retryBackoffDuration":"10s","revisionHistoryLimit":2,"server":"https://kubernetes.default.svc","syncOptions":["ApplyOutOfSyncOnly=true","CreateNamespace=true","PruneLast=true","PrunePropagationPolicy=foreground","RespectIgnoreDifferences=true","Validate=false"]}` | Global default variables |
| globals | object | `{"annotations":{"notifications.argoproj.io/subscribe.on-deleted.slack":"argocd","notifications.argoproj.io/subscribe.on-deployed.slack":"argocd","notifications.argoproj.io/subscribe.on-health-degraded.slack":"argocd","notifications.argoproj.io/subscribe.on-sync-failed.slack":"argocd","notifications.argoproj.io/subscribe.on-sync-running.slack":"argocd"},"deployToNamespace":"previews","label":"preview","requeueAfterSeconds":500,"retryBackoffDuration":"10s","revisionHistoryLimit":2,"server":"https://kubernetes.default.svc","syncOptions":["ApplyOutOfSyncOnly=true","CreateNamespace=true","PruneLast=true","PrunePropagationPolicy=foreground","RespectIgnoreDifferences=true","Validate=false"]}` | Global default variables |
| globals.annotations | object | `{"notifications.argoproj.io/subscribe.on-deleted.slack":"argocd","notifications.argoproj.io/subscribe.on-deployed.slack":"argocd","notifications.argoproj.io/subscribe.on-health-degraded.slack":"argocd","notifications.argoproj.io/subscribe.on-sync-failed.slack":"argocd","notifications.argoproj.io/subscribe.on-sync-running.slack":"argocd"}` | applications annotations @schema-pattern: ^[a-zA-Z0-9_-]+$ |
| globals.deployToNamespace | string | `"previews"` | Kubernetes namespace to deploy previews |
| globals.label | string | `"preview"` | GitHub label to filter PRs that you want to target |
| globals.notificationChannel | string | `"argocd"` | ArgoCD Slack notification channel |
| globals.requeueAfterSeconds | int | `500` | GitHub polling rate (seconds) |
| globals.retryBackoffDuration | string | `"10s"` | The amount to back off retries of failed syncs |
| globals.revisionHistoryLimit | int | `2` | How many old objects should be retained |
Expand All @@ -41,7 +41,7 @@ Kubernetes: `>= 1.28`
| project.destinations | list | `[{"name":"*","namespace":"previews","server":"*"}]` | Only permit applications to deploy to the previews namespace in the same cluster |
| project.namespaceResourceBlacklist | list | `[{"group":"argoproj.io","kind":"AppProject"}]` | Allow all namespaced-scoped resources to be created, except for AppProject |
| project.sourceRepos | list | `["*"]` | Allow from all repositories |
| repos | object | `{"github":[{"images":["docker.io/saidsef/node-webserver:{{branch}}"],"name":"node-webserver"},{"name":"alpine-jenkins-dockerfile","path":"deployment/preview"},{"images":["docker.io/saidsef/aws-kinesis-local:{{branch}}"],"name":"aws-kinesis-local"},{"images":["docker.io/saidsef/aws-dynamodb-local:{{branch}}"],"name":"aws-dynamodb-local"},{"name":"tika-document-to-text","path":"deployment/preview"},{"images":["docker.io/saidsef/k8s-spot-termination-notice:merge"],"name":"k8s-spot-termination-notice"},{"name":"scapy-containerised","path":"charts/scapy","values":{"image":{"tag":"{{branch}}"}}},{"chart":"reverse-geocoding","name":"faas-reverse-geocoding","parameters":[{"name":"image.tag","value":"{{branch}}"},{"name":"ingress.enabled","value":"true"},{"name":"ingress.enabled","value":"true"},{"name":"ingress.hosts[0].host","value":"{{branch}}"}],"repoUrl":"https://saidsef.github.io/faas-reverse-geocoding"}],"gitlab":{}}` | List of repo names and override images for preview environment to dynamically pass the branch of the pull request head use '{{branch}}' variable see: https://argocd-applicationset.readthedocs.io/en/stable/Generators-Pull-Request/#template |
| repos | object | `{"github":[{"images":["docker.io/saidsef/node-webserver:{{branch}}"],"name":"node-webserver"},{"name":"alpine-jenkins-dockerfile","path":"deployment/preview"},{"images":["docker.io/saidsef/aws-kinesis-local:{{branch}}"],"name":"aws-kinesis-local"},{"images":["docker.io/saidsef/aws-dynamodb-local:{{branch}}"],"name":"aws-dynamodb-local"},{"name":"tika-document-to-text","path":"deployment/preview"},{"images":["docker.io/saidsef/k8s-spot-termination-notice:merge"],"name":"k8s-spot-termination-notice"},{"name":"scapy-containerised","path":"charts/scapy","values":{"image":{"tag":"{{branch}}"}}},{"chart":"reverse-geocoding","name":"faas-reverse-geocoding","parameters":[{"name":"image.tag","value":"{{branch}}"},{"name":"ingress.enabled","value":"true"},{"name":"ingress.hosts[0].host","value":"{{branch}}"}],"repoUrl":"https://saidsef.github.io/faas-reverse-geocoding"}],"gitlab":{}}` | List of repo names and override images for preview environment to dynamically pass the branch of the pull request head use '{{branch}}' variable see: https://argocd-applicationset.readthedocs.io/en/stable/Generators-Pull-Request/#template |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
8 changes: 3 additions & 5 deletions charts/applicationset/templates/github-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,9 @@ spec:
argocd.argoproj.io/application-set-refresh: 'true'
argocd.argoproj.io/head: {{ $headShortSha }}
link.argocd.argoproj.io/external-link: '{{ $pr }}/{{ $github.owner }}/{{or $repo.name $repo.path}}/pull/{{ $dqf }}number{{ $dqb }}'
notifications.argoproj.io/subscribe.on-deleted.slack: {{ $notificationChannel }}
notifications.argoproj.io/subscribe.on-deployed.slack: {{ $notificationChannel }}
notifications.argoproj.io/subscribe.on-health-degraded.slack: {{ $notificationChannel }}
notifications.argoproj.io/subscribe.on-sync-failed.slack: {{ $notificationChannel }}
notifications.argoproj.io/subscribe.on-sync-running.slack: {{ $notificationChannel }}
{{- with $globals.annotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
revisionHistoryLimit: {{ $globals.revisionHistoryLimit }}
source:
Expand Down
8 changes: 3 additions & 5 deletions charts/applicationset/templates/gitlab-mr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@ spec:
argocd.argoproj.io/application-set-refresh: 'true'
argocd.argoproj.io/head: {{ $headShortSha }}
link.argocd.argoproj.io/external-link: '{{ $gitlab.api }}/{{ $gitlab.group }}/{{or $repo.name $repo.path}}/-/merge_requests/{{ $dqf }}number{{ $dqb }}'
notifications.argoproj.io/subscribe.on-deleted.slack: {{ $notificationChannel }}
notifications.argoproj.io/subscribe.on-deployed.slack: {{ $notificationChannel }}
notifications.argoproj.io/subscribe.on-health-degraded.slack: {{ $notificationChannel }}
notifications.argoproj.io/subscribe.on-sync-failed.slack: {{ $notificationChannel }}
notifications.argoproj.io/subscribe.on-sync-running.slack: {{ $notificationChannel }}
{{- with $globals.annotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
revisionHistoryLimit: {{ $globals.revisionHistoryLimit }}
source:
Expand Down
12 changes: 9 additions & 3 deletions charts/applicationset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ namespace: 'argocd'

# -- Global default variables
globals:
# -- applications annotations
# @schema-pattern: ^[a-zA-Z0-9_-]+$
annotations:
notifications.argoproj.io/subscribe.on-deleted.slack: argocd
notifications.argoproj.io/subscribe.on-deployed.slack: argocd
notifications.argoproj.io/subscribe.on-health-degraded.slack: argocd
notifications.argoproj.io/subscribe.on-sync-failed.slack: argocd
notifications.argoproj.io/subscribe.on-sync-running.slack: argocd

# -- (int) GitHub polling rate (seconds)
requeueAfterSeconds: 500

Expand All @@ -18,9 +27,6 @@ globals:
# -- ArgoCD server address, use 'all' to use cluster generator
server: 'https://kubernetes.default.svc'

# -- ArgoCD Slack notification channel
notificationChannel: 'argocd'

# -- Kubernetes namespace to deploy previews
deployToNamespace: 'previews'

Expand Down

0 comments on commit 3933560

Please sign in to comment.