forked from HariSekhon/Kubernetes-configs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
argocd-kustomization.yaml
173 lines (162 loc) · 6.7 KB
/
argocd-kustomization.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#
# Author: Hari Sekhon
# Date: 2021-06-11 11:35:45 +0100 (Fri, 11 Jun 2021)
#
# vim:ts=2:sts=2:sw=2:et
# lint: k8s
#
# https://github.com/HariSekhon/Kubernetes-configs
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
# ============================================================================ #
# A r g o C D K u s t o m i z a t i o n
# ============================================================================ #
# initial admin password:
#
# kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 --decode
# run: argocd app sync argocd --local $PWD --dry-run
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: argocd
# XXX: bases are deprecated and 'kustomize edit' will remove them and add them to the bottom of the resources section, messing up your ordering, so put straight into the top of resources now
#
# Add resources from a URL - notice this is not the same as the browse path which is https://github.com/argoproj/argo-cd/tree/master/manifests/cluster-install
#bases: # // is intentional to only copy from this path down
#- github.com/argoproj/argo-cd//manifests/cluster-install?ref=v2.0.3
#
# but // causes this error in Kustomize 3.5 (the argocd-repo-server.kustomize.patch.yaml upgrades Kustomize and should fix this too):
#
# Error: accumulating resources: accumulateFile "accumulating resources from 'github.com/argoproj/argo-cd//manifests/cluster-install?ref=v2.0.3': evalsymlink failure on '/tmp/git@repo/argocd/overlay/github.com/argoproj/argo-cd/manifests/cluster-install?ref=v2.0.3' : lstat /tmp/git@repo/argocd/overlay/github.com: no such file or directory", accumulateDirector: "recursed accumulation of path '/tmp/kustomize-881686007/repo': accumulating resources: accumulateFile \"accumulating resources from '../namespace-install': evalsymlink failure on '/tmp/kustomize-881686007/namespace-install' : lstat /tmp/kustomize-881686007/namespace-install: no such file or directory\", loader.New \"Error loading ../namespace-install with git: url lacks host: ../namespace-install, dir: evalsymlink failure on '/tmp/kustomize-881686007/namespace-install' : lstat /tmp/kustomize-881686007/namespace-install: no such file or directory, get: invalid source string: ../namespace-install\""
#
# so keep it simple, this works:
#- github.com/argoproj/argo-cd/manifests/cluster-install?ref=v2.0.3
# or integrate the newer helm chart:
#
# https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd
#
# (see kustomization.yaml for how to do this)
#
resources:
#- https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
- https://raw.githubusercontent.com/argoproj/argo-cd/v2.1.7/manifests/ha/install.yaml
- argocd-namespace.yaml
- argocd-self.yaml # GitOps self-management tracking of ArgoCD config itself
# XXX: Edit ingress address before uncommenting
#- argocd-ingress.yaml
# XXX: Edit ingress address before uncommenting
#- argocd-ingress-grpc.yaml
- argocd-projects.yaml # auto-loads projects under k8s/argocd/projects
- argocd-apps.yaml # auto-loads applications under k8s/argocd/apps
#- clusters-secrets.yaml
#- repos-secrets.yaml
#
# XXX: simpler solution if using this for Kustomize External Bases, if using the same repo, is ensure the app is set to use the https://github.com url instead of the git@github.com address
#- git-askpass.configmap.yaml
# XXX: don't define namespace in these patches, will break patching, see argocd-cm.repos.patch.yaml for details why
patchesStrategicMerge:
# Repos:
#
- argocd-cm.repos.patch.yaml
#
# Bugfix for GitHub updating its security keys, more details in the patch
- argocd-ssh-known-hosts-cm.patch.yaml
#
# Kustomize - download specific version:
#
- argocd-repo-server.kustomize.patch.yaml
- argocd-cm.kustomize-buildoptions.patch.yaml
#
# Azure AD SSO patches:
#
#- argocd-cm.azure-ad.patch.yaml
#- argocd-cm.users.patch.yaml
#- argocd-rbac-cm.patch.yaml
#
# GitHub Webhook Secret:
#
#- argocd-secret.github-webhook.patch.yaml
#
# Status Badge:
#
#- argocd-cm.statusbadge.patch.yaml
#
# done in argocd-namespace.yaml
#- goldilocks-namespace-enable.patch.yaml
# ArgoCD doesn't come with default resources - https://github.com/argoproj/argo-cd/issues/7772
patches:
# XXX: seems missing from newer 2.1 HA install but this matching is silently ignored
- path: argocd-resources.argocd-application-controller.jsonpatch.yaml
target:
name: argocd-application-controller
kind: StatefulSet
group: apps
version: v1
- path: argocd-resources.argocd-dex-server.jsonpatch.yaml
target:
name: argocd-dex-server
kind: Deployment
group: apps
version: v1
# XXX: not present in 2.1 HA install but silently ignored
- path: argocd-resources.argocd-redis.jsonpatch.yaml
target:
name: argocd-redis
kind: Deployment
group: apps
version: v1
# XXX: only present in HA install
- path: argocd-resources.argocd-redis-ha-haproxy.jsonpatch.yaml
target:
name: argocd-redis-ha-haproxy
kind: Deployment
group: apps
version: v1
- path: argocd-resources.argocd-repo-server.jsonpatch.yaml
target:
name: argocd-repo-server
kind: Deployment
group: apps
version: v1
- path: argocd-resources.argocd-server.jsonpatch.yaml
target:
name: argocd-server
kind: Deployment
group: apps
version: v1
# ArgoCD default project can't be modified via Kustomize because it is not in the remote base objects
#patchesJson6902:
# - target:
# version: argoproj.io/v1alpha1
# kind: AppProject
# name: default
# path: argocd-proj-default.jsonpatch.yaml
# XXX: disable ArgoCD + Apps auto-sync, then click to disable the auto-sync on a specific app for development out of working directory, eg. using Skaffold
#patchesJson6902:
# - target:
# group: argoproj.io
# version: v1alpha1
# kind: Application
# name: argocd
# namespace: argocd
# path: argocd-disable-autosync.jsonpatch.yaml
# - target:
# group: argoproj.io
# version: v1alpha1
# kind: Application
# name: apps
# namespace: argocd
# path: argocd-disable-autosync.patch.yaml
# XXX: disable autosync for all apps while doing development eg. with Skaffold - you probably want the more targeted approach above
#patches:
# - path: argocd-disable-autosync.patch.yaml
# target:
# group: argoproj.io
# version: v1alpha1
# kind: Application
# namespace: argocd