Skip to content

Commit cef74c2

Browse files
j-zimnowodamerllsvcAPLBototomi-admin
authored
feat: upgrade argocd image updater and leverage argocd application sources (#2642)
Co-authored-by: Matthias Erll <merll@akamai.com> Co-authored-by: merll <merll@users.noreply.github.com> Co-authored-by: svcAPLBot <174728082+svcAPLBot@users.noreply.github.com> Co-authored-by: otomi-admin <pipeline@cluster.local>
1 parent a2bcd4b commit cef74c2

38 files changed

+901
-424
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: argocd-image-updater
3+
description: ArgoCD Image Updater
4+
type: application
5+
version: 1.0.0
6+
appVersion: v0.17.0
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "argocd-image-updater.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "argocd-image-updater.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "argocd-image-updater.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "argocd-image-updater.labels" -}}
37+
helm.sh/chart: {{ include "argocd-image-updater.chart" . }}
38+
{{ include "argocd-image-updater.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "argocd-image-updater.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "argocd-image-updater.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "argocd-image-updater.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "argocd-image-updater.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: Role
3+
metadata:
4+
name: argocd-image-updater
5+
namespace: {{ .Release.Namespace | quote }}
6+
labels:
7+
app.kubernetes.io/component: controller
8+
app.kubernetes.io/part-of: argocd-image-updater
9+
{{- include "argocd-image-updater.labels" . | nindent 4 }}
10+
rules:
11+
- apiGroups:
12+
- ""
13+
resources:
14+
- secrets
15+
- configmaps
16+
verbs:
17+
- get
18+
- list
19+
- watch
20+
---
21+
apiVersion: rbac.authorization.k8s.io/v1
22+
kind: ClusterRole
23+
metadata:
24+
name: argocd-image-updater
25+
labels:
26+
app.kubernetes.io/component: controller
27+
app.kubernetes.io/part-of: argocd-image-updater
28+
{{- include "argocd-image-updater.labels" . | nindent 4 }}
29+
rules:
30+
- apiGroups:
31+
- ""
32+
resources:
33+
- events
34+
verbs:
35+
- create
36+
- apiGroups:
37+
- argoproj.io
38+
resources:
39+
- applications
40+
verbs:
41+
- get
42+
- list
43+
- update
44+
- patch
45+
---
46+
apiVersion: rbac.authorization.k8s.io/v1
47+
kind: RoleBinding
48+
metadata:
49+
name: argocd-image-updater
50+
namespace: {{ .Release.Namespace | quote }}
51+
labels:
52+
app.kubernetes.io/component: controller
53+
app.kubernetes.io/part-of: argocd-image-updater
54+
{{- include "argocd-image-updater.labels" . | nindent 4 }}
55+
roleRef:
56+
apiGroup: rbac.authorization.k8s.io
57+
kind: Role
58+
name: argocd-image-updater
59+
subjects:
60+
- kind: ServiceAccount
61+
name: argocd-image-updater
62+
namespace: '{{ .Release.Namespace }}'
63+
---
64+
apiVersion: rbac.authorization.k8s.io/v1
65+
kind: ClusterRoleBinding
66+
metadata:
67+
name: argocd-image-updater
68+
labels:
69+
app.kubernetes.io/component: controller
70+
app.kubernetes.io/part-of: argocd-image-updater
71+
{{- include "argocd-image-updater.labels" . | nindent 4 }}
72+
roleRef:
73+
apiGroup: rbac.authorization.k8s.io
74+
kind: ClusterRole
75+
name: argocd-image-updater
76+
subjects:
77+
- kind: ServiceAccount
78+
name: argocd-image-updater
79+
namespace: '{{ .Release.Namespace }}'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: argocd-image-updater-config
5+
namespace: {{ .Release.Namespace | quote }}
6+
labels:
7+
app.kubernetes.io/part-of: argocd-image-updater
8+
{{- include "argocd-image-updater.labels" . | nindent 4 }}

0 commit comments

Comments
 (0)