Skip to content

Commit 90dc264

Browse files
author
TheCodingSheikh
committed
feat: add kubecodex helm chart
1 parent 37518d1 commit 90dc264

File tree

5 files changed

+110
-0
lines changed

5 files changed

+110
-0
lines changed

charts/kubecodex/Chart.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v2
2+
name: kubecodex
3+
description: A Helm chart for deploying kubecodex style projects
4+
type: application
5+
version: 1.0.0
6+
appVersion: "1.0.0"
7+
keywords:
8+
- kubecodex
9+
- helm
10+
- kubernetes
11+
- gitops
12+
- argocd
13+
maintainers:
14+
- name: TheCodingSheikh
15+
sources:
16+
- https://github.com/TheCodingSheikh/kubecodex
17+
home: https://github.com/TheCodingSheikh/kubecodex

charts/kubecodex/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# KubeCodex Helm Chart
2+
3+
for https://github.com/TheCodingSheikh/kubecodex
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{{- range .Values.projects }}
2+
apiVersion: argoproj.io/v1alpha1
3+
kind: ApplicationSet
4+
metadata:
5+
annotations:
6+
argocd.argoproj.io/sync-wave: "0"
7+
name: "{{ . }}"
8+
namespace: "{{ $.Values.argoNamespace }}"
9+
spec:
10+
goTemplate: true
11+
goTemplateOptions: ["missingkey=default"]
12+
generators:
13+
- git:
14+
repoURL: "{{ $.Values.repoURL }}"
15+
revision: "HEAD"
16+
requeueAfterSeconds: 20
17+
files:
18+
- path: "apps/*/{{ . }}/**/config.yaml"
19+
values:
20+
cluster: "{{ `{{index .path.segments 1}}` }}"
21+
project: "{{ `{{index .path.segments 2`}} }}"
22+
app_path: "{{ `{{.path.path}}` }}"
23+
name: "{{ `{{.path.basename}}` }}"
24+
template:
25+
metadata:
26+
name: '{{ `{{ default ( printf "%s-%s" .values.cluster ( .values.app_path | replace "/" "-" | trimPrefix ( printf "apps-%s-%s-" .values.cluster .values.project ) ) ) .appName }}` }}'
27+
namespace: "{{ $.Values.argoNamespace }}"
28+
spec:
29+
destination:
30+
namespace: '{{ `{{ default ( .values.app_path | replace "/" "-" | trimPrefix ( printf "apps-%s-%s-" .values.cluster .values.project ) ) .destNamespace }}` }}'
31+
name: "{{ `{{ default .values.cluster .destServer }}` }}"
32+
project: "{{ `{{.values.project}}` }}"
33+
source:
34+
repoURL: {{ printf "{{ default \"%s\" .repoURL }}" $.Values.repoURL | quote }}
35+
targetRevision: '{{ `{{ default "HEAD" .srcTargetRevision }}` }}'
36+
path: '{{ `{{ default .values.app_path .srcPath }}` }}'
37+
syncPolicy:
38+
automated:
39+
allowEmpty: true
40+
prune: true
41+
selfHeal: true
42+
retry:
43+
limit: 30
44+
backoff:
45+
duration: 20s
46+
factor: 1
47+
maxDuration: 20s
48+
syncOptions:
49+
- CreateNamespace=true
50+
templatePatch: |
51+
metadata:
52+
labels:
53+
app.kubernetes.io/name: '{{ `{{.values.app_path | replace "/" "-" | trimPrefix (printf "apps-%s-%s-" .values.cluster .values.project)}}` }}'
54+
{{ `{{- range $key, $value := .labels }}` }}
55+
{{ `{{ $key }}` }}: {{ `{{ $value | quote }}` }}
56+
{{ `{{- end }}` }}
57+
annotations:
58+
{{ `{{- range $key, $value := .annotations }}` }}
59+
{{ `{{ $key }}` }}: {{ `{{ $value | quote }}` }}
60+
{{ `{{- end }}` }}
61+
syncPolicy: {}
62+
---
63+
{{- end }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{{- range .Values.projects }}
2+
apiVersion: argoproj.io/v1alpha1
3+
kind: AppProject
4+
metadata:
5+
annotations:
6+
argocd.argoproj.io/sync-options: PruneLast=true
7+
argocd.argoproj.io/sync-wave: "-2"
8+
name: "{{ . }}"
9+
namespace: "{{ $.Values.argoNamespace }}"
10+
spec:
11+
clusterResourceWhitelist:
12+
- group: "*"
13+
kind: "*"
14+
destinations:
15+
- namespace: "*"
16+
server: "*"
17+
namespaceResourceWhitelist:
18+
- group: "*"
19+
kind: "*"
20+
sourceRepos:
21+
- "*"
22+
---
23+
{{- end }}

charts/kubecodex/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
argoNamespace: argocd
2+
repoURL: https://github.com/TheCodingSheikh/kubecodex
3+
projects:
4+
- project-1

0 commit comments

Comments
 (0)