Create your Argo CD Application from a Terminal

⏱️ Estimated Time: 3 Minutes

👨‍💻 Role: Cluster Administrator

You’ll create the new Argo CD Application by passing the Application YAML to either the oc or kubectl CLI:

Are you wondering why we use the CLI instead of the UI this time? It’s because it’s good to be aware of the options available to you!

  1. Login to your OpenShift Web Console.

  2. Open the Web Terminal using the >_ icon in the top-right corner of the OpenShift Web Console.

  3. Execute the following commands to create your Argo CD Application that will create and manage your Namespace.

    export GITHUB_USERNAME=%USERID%
    export GITHUB_URL="https://raw.githubusercontent.com/$GITHUB_USERNAME/rht-summit-2023-gitops-cluster-mgmt/main/etc/managed-namespaces.application.yaml"
    
    oc apply -f $GITHUB_URL -n openshift-gitops
  4. Open the Argo CD dashboard. It should report that the managed-namespaces application is "OutOfSync".

  5. Select the managed-namespaces Application tile.

    ex4.argocd out of sync
  6. Click the Sync Status button to reveal a detailed error message.

The synchronisation failed because the Service Account used by Argo CD to communicate the the Kubernetes/OpenShift API doesn’t have the necessary permissions to manage ResourceQuotas and LimitRanges.

This class of error can be addressed by explicitly granting the Argo CD Service Account the required permissions to manage resources at the cluster-level using Kubernetes ClusterRoles and ClusterRoleBindings. The next section will demonstrate how to do this.