From 0d2c8fc0642640827fd5048ca83154d2a1236911 Mon Sep 17 00:00:00 2001 From: Manabu McCloskey Date: Fri, 5 Jan 2024 10:03:33 -0800 Subject: [PATCH] use annotation tracking by default (#125) * use annotation tracking by default Signed-off-by: Manabu McCloskey --- README.md | 13 +++++++++++++ hack/argo-cd/argocd-cm.yaml | 11 +++++++++++ hack/argo-cd/generate-manifests.sh | 2 +- hack/argo-cd/kustomization.yaml | 1 + .../localbuild/resources/argo/install.yaml | 7 +++++++ 5 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 hack/argo-cd/argocd-cm.yaml diff --git a/README.md b/README.md index ee5a4c98..dc5db9ba 100644 --- a/README.md +++ b/README.md @@ -243,6 +243,19 @@ apiVersion: kind.x-k8s.io/v1alpha4 ``` Next, import it `./idpbuilder create --kindConfig ` +### Default manifests installed by idpbuilder + +The default manifests for the core packages are available [here](pkg/controllers/localbuild/resources). +These are generated by scripts. If you want to make changes to them, see below. + +#### ArgoCD + +ArgoCD manifests are generated using a bash script available [here](./hack/argo-cd/generate-manifests.sh). +This script runs kustomize to modify the basic installation manifests provided by ArgoCD. Modifications include: + +1. Prevent notification and dex pods from running. This is done to keep the number of pods running low by default. +2. Use the annotation tracking instead of the default label tracking. Annotation tracking allows you to avoid [problems caused by the label tracking method](https://argo-cd.readthedocs.io/en/stable/user-guide/resource_tracking/). In addition, this configuration is required when using Crossplane. + ## Extending the IDP builder diff --git a/hack/argo-cd/argocd-cm.yaml b/hack/argo-cd/argocd-cm.yaml new file mode 100644 index 00000000..ccee805b --- /dev/null +++ b/hack/argo-cd/argocd-cm.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: argocd-cm +data: + application.resourceTrackingMethod: annotation + resource.exclusions: | + - kinds: + - ProviderConfigUsage + apiGroups: + - "*" diff --git a/hack/argo-cd/generate-manifests.sh b/hack/argo-cd/generate-manifests.sh index a3471bdb..84c9b4b9 100755 --- a/hack/argo-cd/generate-manifests.sh +++ b/hack/argo-cd/generate-manifests.sh @@ -1,5 +1,5 @@ INSTALL_YAML="pkg/controllers/localbuild/resources/argo/install.yaml" echo "# UCP ARGO INSTALL RESOURCES" > ${INSTALL_YAML} -echo "# This file is auto-generated with 'hack/argo-cd/generate-manifests.sh'." >> ${INSTALL_YAML} +echo "# This file is auto-generated with 'hack/argo-cd/generate-manifests.sh'" >> ${INSTALL_YAML} kustomize build ./hack/argo-cd/ >> ${INSTALL_YAML} diff --git a/hack/argo-cd/kustomization.yaml b/hack/argo-cd/kustomization.yaml index 7099dcad..89d2ec5f 100644 --- a/hack/argo-cd/kustomization.yaml +++ b/hack/argo-cd/kustomization.yaml @@ -6,3 +6,4 @@ resources: patches: - path: dex-server.yaml - path: notifications-controller.yaml + - path: argocd-cm.yaml diff --git a/pkg/controllers/localbuild/resources/argo/install.yaml b/pkg/controllers/localbuild/resources/argo/install.yaml index 0df06b67..bd9e5aff 100644 --- a/pkg/controllers/localbuild/resources/argo/install.yaml +++ b/pkg/controllers/localbuild/resources/argo/install.yaml @@ -18851,6 +18851,13 @@ subjects: namespace: argocd --- apiVersion: v1 +data: + application.resourceTrackingMethod: annotation + resource.exclusions: | + - kinds: + - ProviderConfigUsage + apiGroups: + - "*" kind: ConfigMap metadata: labels: