Skip to content

Commit 85fa909

Browse files
committed
Fresh creation of new preprod branch
1 parent 320e0d6 commit 85fa909

File tree

178 files changed

+37247
-1142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+37247
-1142
lines changed

kubernetes/helm_charts/local/argo-cd/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ To add a new application to be managed by Argo CD through this Helm chart:
4848

4949
2. **Define Applications in `values.yaml`:**
5050
Add the new application's details in the `values.yaml` file under the `applications` section:
51+
5152
```yaml
5253
applications:
5354
- name: new-app
@@ -60,6 +61,32 @@ To add a new application to be managed by Argo CD through this Helm chart:
6061
chart: optional-chart-name
6162
pluginName: optional-plugin
6263
pluginEnv: 'optional-path-to-chart-values'
64+
```
65+
66+
3. **Define AppliactionSets in `values.yaml`:**
67+
Add the new application's sets details in the `values.yaml` file under the `applicationSets` section:
68+
69+
```yaml
70+
applicationSets:
71+
- name: argocd
72+
applications:
73+
- name: argocd
74+
namespace: argocd
75+
repoURL: 'https://github.com/opentelekomcloud-infra/system-config.git'
76+
targetRevision: feature-1299-Make_ArgoCD_a_part_of_the_ArgoCD_Apps
77+
path: kubernetes/helm_charts/upstream/argo-cd
78+
pluginName: argocd-vault-plugin-helm-with-args
79+
pluginEnv: '-f values-{{ .cluster.name }}.yaml'
80+
server: https://kubernetes.default.svc
81+
- name: argocd-additional-manifests
82+
namespace: argocd
83+
repoURL: 'https://github.com/opentelekomcloud-infra/system-config.git'
84+
targetRevision: feature-1299-Make_ArgoCD_a_part_of_the_ArgoCD_Apps
85+
path: github/system-config/kubernetes/helm_charts/local/argo-cd
86+
pluginName: argocd-vault-plugin-helm-with-args
87+
pluginEnv: '-f values-{{ .cluster.name }}.yaml'
88+
server: https://kubernetes.default.svc
89+
```
6390

6491
### Manual Deployment of Applications
6592

kubernetes/helm_charts/local/argo-cd/templates/applications.yaml

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{{- range .Values.applicationSets }}
2+
{{- $appSet := . }}
3+
apiVersion: argoproj.io/v1alpha1
4+
kind: ApplicationSet
5+
metadata:
6+
name: {{ .name }}
7+
namespace: {{ default "argocd" $.Values.namespace }}
8+
spec:
9+
generators:
10+
- matrix:
11+
generators:
12+
- list:
13+
elements:
14+
{{- range .applications }}
15+
{{- $app := . }}
16+
- name: {{ $app.name | quote }}
17+
namespace: {{ $app.namespace | default "default" | quote }}
18+
repoURL: {{ $app.repoURL | quote }}
19+
targetRevision: {{ $app.targetRevision | default "main" | quote }}
20+
path: {{ $app.path | quote }}
21+
project: {{ $app.project | default $appSet.project | default "infra" | quote }}
22+
pluginName: {{ $app.pluginName | default "argocd-vault-plugin-helm" | quote }}
23+
pluginEnv: {{ $app.pluginEnv | default "" | quote }}
24+
{{- if $app.syncPolicy }}
25+
syncPolicy: {{ $app.syncPolicy | toJson | quote }}
26+
{{- end }}
27+
{{- end }}
28+
- list:
29+
elements:
30+
{{- $clusters := list }}
31+
{{- range .applications }}
32+
{{- if .clusters }}
33+
{{- $clusters = .clusters }}
34+
{{- break }}
35+
{{- end }}
36+
{{- end }}
37+
{{- if not $clusters }}
38+
{{- $clusters = list "in-cluster" }}
39+
{{- end }}
40+
{{- range $clusters }}
41+
- cluster: {{ . | quote }}
42+
{{- end }}
43+
template:
44+
metadata:
45+
name: '{{ "{{name}}" }}-{{ "{{cluster}}" }}'
46+
spec:
47+
project: '{{ "{{project}}" }}'
48+
source:
49+
repoURL: '{{ "{{repoURL}}" }}'
50+
targetRevision: '{{ "{{targetRevision}}" }}'
51+
path: '{{ "{{path}}" }}'
52+
plugin:
53+
name: '{{ "{{pluginName}}" }}'
54+
env:
55+
- name: ARGOCD_ENV_HELM_ARGS
56+
value: '{{ "{{pluginEnv}}" }}'
57+
destination:
58+
name: '{{ "{{cluster}}" }}'
59+
namespace: '{{ "{{namespace}}" }}'
60+
syncPolicy:
61+
automated:
62+
prune: true
63+
selfHeal: true
64+
syncOptions:
65+
- CreateNamespace=true
66+
---
67+
{{- end }}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{{- range $app := $.Values.applications }}
2+
{{- $appName := $app.name }}
3+
{{- range $cluster := $app.clusters }}
4+
{{- $config := $app.config }}
5+
---
6+
apiVersion: argoproj.io/v1alpha1
7+
kind: Application
8+
metadata:
9+
name: {{ $appName }}-{{ $cluster }}
10+
namespace: {{ default "argocd" }}
11+
spec:
12+
project: {{ $config.project | quote }}
13+
source:
14+
repoURL: {{ $config.repoURL | quote }}
15+
targetRevision: {{ $config.targetRevision | quote }}
16+
path: {{ $config.path | quote }}
17+
{{- if $config.pluginName }}
18+
plugin:
19+
name: {{ $config.pluginName | quote }}
20+
env:
21+
- name: HELM_ARGS
22+
value: {{ $config.pluginEnv | quote }}
23+
{{- if $config.pluginParameters }}
24+
{{- range $param := $config.pluginParameters }}
25+
- name: HELM_PARAM_{{ $param.name | upper | replace "." "_" }}
26+
value: {{ $param.value | quote }}
27+
{{- end }}
28+
{{- end }}
29+
{{- else if $config.helm }}
30+
helm:
31+
{{ toYaml $config.helm | indent 6 }}
32+
{{- end }}
33+
{{- if $config.kustomize }}
34+
kustomize:
35+
{{ toYaml $config.kustomize | indent 6 }}
36+
{{- end }}
37+
destination:
38+
name: {{ $cluster }}
39+
namespace: {{ $config.namespace | quote }}
40+
{{- if $config.syncPolicy }}
41+
syncPolicy:
42+
{{ toYaml $config.syncPolicy | indent 4 }}
43+
{{- end }}
44+
{{- end }}
45+
{{- end }}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{- if .Values.clusters }}
2+
{{- range $clusterName, $cluster := .Values.clusters }}
3+
---
4+
apiVersion: v1
5+
kind: Secret
6+
metadata:
7+
name: {{ $clusterName }}
8+
namespace: {{ $.Release.Namespace }}
9+
labels:
10+
argocd.argoproj.io/secret-type: cluster
11+
app.kubernetes.io/part-of: argocd
12+
app.kubernetes.io/component: cluster-secret
13+
type: Opaque
14+
stringData:
15+
name: {{ $cluster.name }}
16+
server: {{ $cluster.server }}
17+
config: |
18+
{"tlsClientConfig":{"insecure":{{ $cluster.config.tlsClientConfig.insecure | toJson }},
19+
{{- $tlsConfig := list -}}
20+
{{- $tlsConfig = append $tlsConfig (printf "\"certData\":\"<path:secret/data/argocd/clusters/%s#certData>\"" $cluster.name) -}}
21+
{{- $tlsConfig = append $tlsConfig (printf "\"keyData\":\"<path:secret/data/argocd/clusters/%s#keyData>\"" $cluster.name) -}}
22+
{{- $tlsConfig = append $tlsConfig (printf "\"caData\":\"<path:secret/data/argocd/clusters/%s#caData>\"" $cluster.name) -}}
23+
{{- if $tlsConfig -}}
24+
{{ join "," $tlsConfig }}
25+
{{- end }}}}
26+
{{- end }}
27+
{{- end }}

kubernetes/helm_charts/local/argo-cd/templates/projects.yaml renamed to kubernetes/helm_charts/local/argo-cd/templates/argocd-projects.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apiVersion: argoproj.io/v1alpha1
44
kind: AppProject
55
metadata:
66
name: {{ .name }}
7-
namespace: {{ $.Values.global.argocdNamespace }}
7+
namespace: {{ default "argocd" }}
88
spec:
99
description: {{ .description | quote }}
1010
sourceRepos:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{- if and .Values.repositorySecret (hasKey .Values.repositorySecret "enabled") .Values.repositorySecret.enabled }}
2+
---
3+
apiVersion: v1
4+
kind: Secret
5+
metadata:
6+
annotations:
7+
managed-by: argocd.argoproj.io
8+
labels:
9+
argocd.argoproj.io/secret-type: repository
10+
name: {{ .Values.repositorySecret.name }}
11+
namespace: {{ .Values.repositorySecret.namespace | default "argocd" }}
12+
type: Opaque
13+
data:
14+
name: {{ .Values.repositorySecret.data.name | quote }}
15+
project: {{ .Values.repositorySecret.data.project | quote }}
16+
type: {{ .Values.repositorySecret.data.type | quote }}
17+
url: {{ .Values.repositorySecret.data.url | quote }}
18+
{{- end }}

kubernetes/helm_charts/local/argo-cd/templates/backstage-agrocd.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

kubernetes/helm_charts/local/argo-cd/templates/dependencytrack-argocd.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{{- if and .Values.repoServerSecretAccess (hasKey .Values.repoServerSecretAccess "enabled") .Values.repoServerSecretAccess.enabled }}
2+
---
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
kind: Role
5+
metadata:
6+
name: argocd-repo-server-secrets
7+
namespace: {{ .Values.repoServerSecretAccess.namespace | default "argocd" }}
8+
rules:
9+
- apiGroups: [""]
10+
resources: ["secrets"]
11+
verbs: ["get", "list"]
12+
---
13+
apiVersion: rbac.authorization.k8s.io/v1
14+
kind: RoleBinding
15+
metadata:
16+
name: argocd-repo-server-secrets
17+
namespace: {{ .Values.repoServerSecretAccess.namespace | default "argocd" }}
18+
roleRef:
19+
apiGroup: rbac.authorization.k8s.io
20+
kind: Role
21+
name: argocd-repo-server-secrets
22+
subjects:
23+
- kind: ServiceAccount
24+
name: {{ .Values.repoServerSecretAccess.serviceAccount | default "argocd-preprod-repo-server" }}
25+
namespace: {{ .Values.repoServerSecretAccess.namespace | default "argocd" }}
26+
{{- end }}

0 commit comments

Comments
 (0)