diff --git a/solutions/deploy-argocd-apps-pull/argocd-pull-model.md b/solutions/deploy-argocd-apps-pull/argocd-pull-model.md index 88b646402..d79f9f2d0 100644 --- a/solutions/deploy-argocd-apps-pull/argocd-pull-model.md +++ b/solutions/deploy-argocd-apps-pull/argocd-pull-model.md @@ -2,11 +2,8 @@ The [ArgoCD](https://argo-cd.readthedocs.io/en/stable/) application controller uses the hub-spoke pattern or pull model mechanism for decentralized resource delivery to remote clusters. By using [Open Cluster Management (OCM)](https://open-cluster-management.io/) APIs and components, the ArgoCD Applications will be pulled from the multi-cluster control plane hub cluster down to -the registered OCM managed clusters. To try it out, check out the [Getting Started Guide](getting-started.md) +the registered OCM managed clusters. To try it out, check out the [Getting Started Guide](getting-started.md). -**Note:** The primary goal of this project is to migrate existing native OCM application delivery `AppSubscription` users to ArgoCD. -The pull model described in this project might not be suitable for every situation. -It is designed with the existing OCM AppSubscription users in mind to match their existing use cases. ## Overview The current ArgoCD resource delivery is primarily pushing resources from a centralized cluster to the remote/managed clusters. diff --git a/solutions/deploy-argocd-apps-pull/getting-started.md b/solutions/deploy-argocd-apps-pull/getting-started.md index ab9d3ece2..d740d7b55 100644 --- a/solutions/deploy-argocd-apps-pull/getting-started.md +++ b/solutions/deploy-argocd-apps-pull/getting-started.md @@ -1,8 +1,15 @@ # Getting Started ### Prerequisites -- [kind](https://kind.sigs.k8s.io) must be installed on your local machine. The Kubernetes version must be >= 1.19, see [kind user guide](https://kind.sigs.k8s.io/docs/user/quick-start/#creating-a-cluster) for more details. -- +- [kind](https://kind.sigs.k8s.io) must be installed on your local machine. The Kubernetes version must be >= 1.19. See the [kind user guide](https://kind.sigs.k8s.io/docs/user/quick-start/#creating-a-cluster) for more details. +- Download and install [clusteradm](https://github.com/open-cluster-management-io/clusteradm/releases). For Linux OS, run the following commands: + + ``` + wget -qO- https://github.com/open-cluster-management-io/clusteradm/releases/latest/download/clusteradm_linux_amd64.tar.gz | sudo tar -xvz -C /usr/local/bin/ + + sudo chmod +x /usr/local/bin/clusteradm + ``` +- The [kubectl](https://kubernetes.io/docs/reference/kubectl/) cli, which should be compatible with your Kubernetes version. See [install and setup](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#before-you-begin) for more info. ### Steps 1. Setup an OCM Hub cluster and registered an OCM Managed cluster. @@ -13,62 +20,65 @@ See [Open Cluster Management Quick Start](https://open-cluster-management.io/getting-started/quick-start/) for more details. 2. Install ArgoCD on the hub cluster and both managed clusters. - ``` - kubectl config use-context kind-hub #repeat for kind-cluster1 and kind-cluster2 - kubectl create namespace argocd - kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml - ``` - See [ArgoCD website](https://argo-cd.readthedocs.io/en/stable/getting_started/) for more details. - -3. On the Hub cluster, scale down the Application controller: ``` - kubectl -n argocd scale statefulset/argocd-application-controller --replicas 0 + for i in "hub" "cluster1" "cluster2" + do + kubectl config use-context kind-$i + kubectl create namespace argocd + kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml + done ``` - **Note:** This step is not necssary if the ArgoCD instance you are using contains the feature: - https://argo-cd.readthedocs.io/en/latest/user-guide/skip_reconcile/ + See [ArgoCD website](https://argo-cd.readthedocs.io/en/stable/getting_started/) for more details. -1. Install the Pull controller: +1. Install the Pull controller on the hub cluster: ``` + kubectl config use-context kind-hub kubectl apply -f https://raw.githubusercontent.com/open-cluster-management-io/argocd-pull-integration/main/deploy/install.yaml ``` -1. If your controller starts successfully, you should see: +2. If your controller starts successfully, you should see: ``` $ kubectl -n open-cluster-management get deploy | grep pull argocd-pull-integration-controller-manager 1/1 1 1 106s ``` -1. On the Hub cluster, create an ArgoCD cluster secret that represents the managed cluster. This step can be automated with [OCM auto import controller](https://github.com/open-cluster-management-io/multicloud-integrations/). +3. On the Hub cluster, create ArgoCD cluster secrets that represent the managed clusters. This step can be automated with [OCM auto import controller](https://github.com/open-cluster-management-io/multicloud-integrations/). - **Note**: replace the `cluster-name` with the registered managed cluster name. ``` - cat <-secret # cluster1-secret - namespace: argocd - labels: - argocd.argoproj.io/secret-type: cluster - type: Opaque - stringData: - name: # cluster1 - server: https://-control-plane:6443 # https://cluster1-control-plane:6443 + for i in "cluster1" "cluster2" + do + cat <