Skip to content

Commit 0142162

Browse files
authored
Merge pull request #1258 from rackerlabs/argocd-update
feat(argocd): switch to deploying ArgoCD directly via helm chart
2 parents 2a772c0 + 06afdeb commit 0142162

File tree

10 files changed

+78
-118
lines changed

10 files changed

+78
-118
lines changed

apps/appsets/argocd/appset-argocd.yaml

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,35 +28,22 @@ spec:
2828
spec:
2929
project: default
3030
sources:
31+
- repoURL: https://argoproj.github.io/argo-helm
32+
chart: argo-cd
33+
targetRevision: 8.3.9
34+
helm:
35+
releaseName: argo-cd
36+
valueFiles:
37+
- $understack/components/argocd/values.yaml
38+
- $deploy/{{.name}}/helm-configs/argocd.yaml
39+
ignoreMissingValueFiles: true
3140
- repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
3241
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
33-
path: bootstrap/argocd/
34-
kustomize:
35-
components:
36-
- components/sso
37-
patches:
38-
- target:
39-
kind: ConfigMap
40-
name: argocd-cm
41-
patch: |-
42-
- op: replace
43-
path: /data/url
44-
value: https://argocd.{{index .metadata.annotations "dns_zone"}}
45-
- target:
46-
kind: Ingress
47-
patch: |-
48-
- op: replace
49-
path: /spec/rules/0/host
50-
value: argocd.{{index .metadata.annotations "dns_zone"}}
51-
- op: replace
52-
path: /spec/tls/0/hosts/0
53-
value: argocd.{{index .metadata.annotations "dns_zone"}}
54-
- op: replace
55-
path: '/metadata/annotations/cert-manager.io~1cluster-issuer'
56-
value: understack-cluster-issuer
42+
ref: understack
5743
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
5844
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
5945
path: '{{.name}}/manifests/argocd'
46+
ref: deploy
6047
ignoreDifferences:
6148
- kind: Secret
6249
namespace: argocd

bootstrap/argocd.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
thisdir=$(dirname "$0")
6+
7+
argocd_repo=$(cat "${thisdir}/../apps/appsets/argocd/appset-argocd.yaml" | yq -r '.spec.template.spec.sources[0].repoURL')
8+
argocd_rev=$(cat "${thisdir}/../apps/appsets/argocd/appset-argocd.yaml" | yq -r '.spec.template.spec.sources[0].targetRevision')
9+
10+
helm repo add argo "${argocd_repo}"
11+
helm repo update argo
12+
13+
helm template argo-cd argo-cd \
14+
--version "${argocd_rev}" \
15+
--create-namespace \
16+
-f "${thisdir}/../components/argocd/values.yaml" \
17+
| kubectl -n argocd apply -f -

bootstrap/argocd/components/sso/external-secret-argocd-sso.yaml

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

bootstrap/argocd/components/sso/kustomization.yaml

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

bootstrap/argocd/kustomization.yaml

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

bootstrap/argocd/namespace.yaml

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

bootstrap/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ kind: Kustomization
44

55
resources:
66
- sealed-secrets/
7-
- argocd/
File renamed without changes.

docs/deploy-guide/gitops-install.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,19 @@ your shell.
112112

113113
### Populating the infrastructure
114114

115-
TODO: some examples and documentation on how to build out a cluster
115+
For details on how to configure ArgoCD, see the
116+
[Management Cluster](./management-cluster.md) page.
116117

117118
### Bootstrapping ArgoCD and Sealed-Secrets
118119

119120
If you do not have ArgoCD deployed then you can use the following:
120121

121122
```bash
122-
kubectl kustomize --enable-helm https://github.com/rackerlabs/understack/bootstrap/ | kubectl apply -f -
123+
kubectl kustomize --enable-helm \
124+
https://github.com/rackerlabs/understack/bootstrap/sealed-secrets/ \
125+
| kubectl apply -f -
126+
cd path_to_understack_repo
127+
./bootstrap/argocd.sh
123128
```
124129

125130
### Generating secrets

docs/deploy-guide/management-cluster.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,53 @@ approach that UnderStack uses to deploy it's services with ArgoCD is the
1313
If you already have [ArgoCD][argocd] deployed and available to be used then you
1414
can skip this section.
1515

16+
### Configuring ArgoCD
17+
18+
To configure ArgoCD you'll need to create a `$DEPLOY_NAME/helm-configs/argocd.yaml`
19+
in your deploy repo. In there you can configure the DNS name that will be used
20+
for the Ingress as well as the authentication. An example of which can be:
21+
22+
```yaml title="$DEPLOY_NAME/helm-configs/argocd.yaml"
23+
global:
24+
domain: argocd.your.dns.zone
25+
26+
configs:
27+
cm:
28+
oidc.config: |-
29+
name: SSO
30+
issuer: $argocd-sso:issuer
31+
clientID: $argocd-sso:client-id
32+
clientSecret: $argocd-sso:client-secret
33+
requiredIDTokenClaims: {"groups": {"essential": true}}
34+
cliClientID: argocdcli
35+
```
36+
37+
This assumes that you have a `Secret` in the `argocd` namespace called `argocd-sso`
38+
which has the following keys:
39+
40+
- `issuer`
41+
- `client-id`
42+
- `client-secret`
43+
44+
Which will be used for OIDC authentication. See [Configuring Dex](./config-dex.md)
45+
for information on how to use the [Dex](https://dexidp.io) that is included
46+
for authentication.
47+
48+
You can also include the following:
49+
50+
```yaml ttile="$DEPLOY_NAME/helm-configs/argocd.yaml"
51+
extraObjects:
52+
- # k8s object like a secret definition
53+
```
54+
55+
Or any other valid values for the Argo CD Helm Chart.
56+
1657
The following command will do an initial deployment of ArgoCD that can
1758
then be customized further.
1859

1960
```bash title="installing ArgoCD"
20-
kubectl kustomize --enable-helm https://github.com/rackerlabs/understack/bootstrap/argocd/ | kubectl apply -f -
61+
cd path_to_understack_repo
62+
./bootstrap/argocd.sh
2163
```
2264

2365
## Configuring your Global and/or Site Cluster in ArgoCD

0 commit comments

Comments
 (0)