Skip to content

Commit 7849d32

Browse files
authored
feat(argocd): Helm chart for Argo CD applications (#10)
This PR is for creating a Helm chart for gateway argo CD applications which will be synced with Helm repository. [TD-912](https://glassdomeinc.atlassian.net/browse/TD-912) [TD-912]: https://glassdomeinc.atlassian.net/browse/TD-912?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 28cccc0 commit 7849d32

File tree

6 files changed

+187
-0
lines changed

6 files changed

+187
-0
lines changed

charts/gateway-argocd/.helmignore

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/

charts/gateway-argocd/Chart.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: gateway-argocd
3+
description: Gateway Argo CD
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "0.1.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 "gateway-argocd.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 "gateway-argocd.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 "gateway-argocd.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "gateway-argocd.labels" -}}
37+
helm.sh/chart: {{ include "gateway-argocd.chart" . }}
38+
{{ include "gateway-argocd.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 "gateway-argocd.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "gateway-argocd.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 "gateway-argocd.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "gateway-argocd.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: gateway-argocd
5+
namespace: argocd
6+
labels:
7+
name: gateway-argocd
8+
spec:
9+
project: gateway
10+
11+
source:
12+
repoURL: https://charts.glassdome.com/
13+
targetRevision: "*"
14+
chart: gateway-argocd
15+
16+
destination:
17+
server: https://kubernetes.default.svc
18+
namespace: argocd
19+
20+
syncPolicy:
21+
automated:
22+
prune: true
23+
selfHeal: true
24+
syncOptions:
25+
- PrunePropagationPolicy=foreground
26+
- PruneLast=true
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: gateway-console
5+
namespace: argocd
6+
labels:
7+
name: gateway-console
8+
spec:
9+
project: gateway
10+
11+
source:
12+
repoURL: https://charts.glassdome.com/
13+
targetRevision: "*"
14+
chart: glassdome-gateway-console
15+
16+
destination:
17+
server: https://kubernetes.default.svc
18+
namespace: glassdome-gateway-console
19+
20+
syncPolicy:
21+
automated:
22+
prune: true
23+
selfHeal: true
24+
syncOptions:
25+
- CreateNamespace=true
26+
- PrunePropagationPolicy=foreground
27+
- PruneLast=true
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: AppProject
3+
metadata:
4+
name: gateway
5+
namespace: argocd
6+
# Finalizer that ensures that project is not deleted until it is not referenced by any application
7+
finalizers:
8+
- resources-finalizer.argocd.argoproj.io
9+
spec:
10+
description: gateway
11+
12+
sourceRepos:
13+
- "*"
14+
15+
destinations:
16+
- namespace: glassdome-gateway-console
17+
server: https://kubernetes.default.svc
18+
name: in-cluster
19+
- namespace: argocd
20+
server: https://kubernetes.default.svc
21+
name: in-cluster
22+
23+
clusterResourceWhitelist:
24+
- group: ""
25+
kind: Namespace

0 commit comments

Comments
 (0)