Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Connecting External Private GKE Cluster to argoCD

I have two different projects, 
I have Install ArgoCD on my devOps project(project 1) on Private GKE Cluster, Now I want to connect my( External ) Private GKE Cluster (project 2) to ArgoCD. How Can I connect External private Cluster to ArgoCD. Can you please help me with steps. 

Solved Solved
0 2 973
1 ACCEPTED SOLUTION

Hey @harshada2828 ! Let's try to solve your issue with the following steps:

  • Generate a kubeconfig: Create a kubeconfig file for the external private GKE cluster. This file will contain the cluster configuration details required for ArgoCD to interact with it.
  • Store kubeconfig securely: Consider using a secret management solution to store the kubeconfig securely.

Use argocd cluster add command: Add the external cluster to ArgoCD using the following command:

argocd cluster add <cluster-name> --kubeconfig <path-to-kubeconfig>
  • Replace <cluster-name> with a descriptive name for the cluster and <path-to-kubeconfig> with the path to the kubeconfig file.
  • Address Certificate Verification Issues: If you encounter certificate verification issues, use the --insecure flag. However, this is not recommended for production environments. Consider using self-signed certificates or configuring trust between the clusters.
  • Ensure that the ArgoCD server is accessible from the external cluster. This might involve creating a LoadBalancer service or NodePort service.
  • Set up appropriate authentication mechanisms for ArgoCD to securely communicate with the external cluster.
  • Network Policies: Implement network policies on both clusters to restrict traffic between ArgoCD and the external cluster.
  • Security: Use strong authentication and authorization mechanisms to protect your clusters.
  • Testing: Thoroughly test the connection between ArgoCD and the external cluster to ensure proper functionality.

 

Troubleshooting

  • Verify network connectivity: Use tools like ping or traceroute to check network reachability between the clusters.
  • Check kubeconfig file: Ensure the kubeconfig file is correct and has necessary permissions.
  • Review ArgoCD logs: Inspect ArgoCD logs for error messages or clues about the issue.
  • Verify cluster roles and permissions: Ensure ArgoCD has the necessary permissions to manage resources on the external cluster.

Additional Tips

  • Consider using a cluster management tool: Tools like multicluster-management can simplify managing multiple clusters.
  • Implement RBAC: Use Role-Based Access Control to restrict access to resources on both clusters.
  • Monitor performance: Monitor the performance of ArgoCD and the external cluster to identify potential bottlenecks.

Please see: https://argo-cd.readthedocs.io/en/stable/user-guide/commands/argocd_cluster_add/ | https://github.com/lcostea/argocd-config/blob/master/docs/2-add-external-clusters.md | https://devopscube.com/configure-multiple-kubernetes-clusters-argo-cd/ 

 

View solution in original post

2 REPLIES 2

Hey @harshada2828 ! Let's try to solve your issue with the following steps:

  • Generate a kubeconfig: Create a kubeconfig file for the external private GKE cluster. This file will contain the cluster configuration details required for ArgoCD to interact with it.
  • Store kubeconfig securely: Consider using a secret management solution to store the kubeconfig securely.

Use argocd cluster add command: Add the external cluster to ArgoCD using the following command:

argocd cluster add <cluster-name> --kubeconfig <path-to-kubeconfig>
  • Replace <cluster-name> with a descriptive name for the cluster and <path-to-kubeconfig> with the path to the kubeconfig file.
  • Address Certificate Verification Issues: If you encounter certificate verification issues, use the --insecure flag. However, this is not recommended for production environments. Consider using self-signed certificates or configuring trust between the clusters.
  • Ensure that the ArgoCD server is accessible from the external cluster. This might involve creating a LoadBalancer service or NodePort service.
  • Set up appropriate authentication mechanisms for ArgoCD to securely communicate with the external cluster.
  • Network Policies: Implement network policies on both clusters to restrict traffic between ArgoCD and the external cluster.
  • Security: Use strong authentication and authorization mechanisms to protect your clusters.
  • Testing: Thoroughly test the connection between ArgoCD and the external cluster to ensure proper functionality.

 

Troubleshooting

  • Verify network connectivity: Use tools like ping or traceroute to check network reachability between the clusters.
  • Check kubeconfig file: Ensure the kubeconfig file is correct and has necessary permissions.
  • Review ArgoCD logs: Inspect ArgoCD logs for error messages or clues about the issue.
  • Verify cluster roles and permissions: Ensure ArgoCD has the necessary permissions to manage resources on the external cluster.

Additional Tips

  • Consider using a cluster management tool: Tools like multicluster-management can simplify managing multiple clusters.
  • Implement RBAC: Use Role-Based Access Control to restrict access to resources on both clusters.
  • Monitor performance: Monitor the performance of ArgoCD and the external cluster to identify potential bottlenecks.

Please see: https://argo-cd.readthedocs.io/en/stable/user-guide/commands/argocd_cluster_add/ | https://github.com/lcostea/argocd-config/blob/master/docs/2-add-external-clusters.md | https://devopscube.com/configure-multiple-kubernetes-clusters-argo-cd/ 

 

The above answer was helpful, but is there any other way to connect Cluster to Argo CD Like from UI or using YAML File ? 

Top Labels in this Space