Seamlessly Access Private Git Repositories in EKS with Argo CD
In today's cloud-native landscape, accessing private Git repositories from your Amazon EKS cluster is crucial for maintaining security and efficiency. Argo CD can manage your Kubernetes applications, but it struggles with private repositories out of the box. This is where AWS CodeConnections comes in, providing a secure and authenticated way to connect your EKS environment to private Git servers like GitHub Enterprise or GitLab.
AWS CodeConnections operates by creating a cross-account elastic network interface (ENI) within your specified VPC. This setup connects directly to your private Git server, ensuring that all communications remain secure. You need to configure several parameters, including the GIT_ENDPOINT_URL, REGION, VPC_ID, SUBNET_IDS, and SECURITY_GROUP_ID. For instance, you might set your GIT_ENDPOINT_URL to https://github.example.com and specify the appropriate subnet IDs for your VPC. Once configured, you can create a connection using the AWS CLI, allowing Argo CD to pull from your private repository seamlessly.
In production, ensure you have the AWS CLI version 2.x or later installed and configured, along with kubectl access to your EKS cluster. Be aware of the TLS certificate requirements; only include the TlsCertificate field if your Git server uses a privately signed certificate. This integration can significantly streamline your CI/CD processes, but remember to monitor your network configurations and permissions closely to avoid connectivity issues.
Key takeaways
- →Configure AWS CodeConnections to create a secure network path for your private Git server.
- →Set the GIT_ENDPOINT_URL to your private Git server's URL for seamless access.
- →Use the AWS CLI to create connections and hosts for your Git repositories.
- →Include the TlsCertificate field only if using a privately signed certificate.
- →Ensure you have the necessary permissions to create CodeConnections and VPC resources.
Why it matters
Integrating private Git repositories with Argo CD in EKS enhances security and streamlines deployment workflows, allowing teams to maintain a robust CI/CD pipeline without compromising on access control.
Code examples
export GIT_ENDPOINT_URL="https://github.example.com" # Private Git Server URL
export REGION="us-west-2"
export VPC_ID="vpc-0c0a64adaa55b2dde" # VPC ID where the Host will be created
export SUBNET_IDS="subnet-0099c63c1499e95c6,subnet-0849c92d198b5ff9b"
export SECURITY_GROUP_ID="sg-08e49afc4f10e1792"1export HOST_ARN=$(aws codeconnections create-host \
2 --name "github-" \
3 --provider-type GitHubEnterpriseServer \
4 --provider-endpoint "$GIT_ENDPOINT_URL" \
5 --vpc-configuration file://vpc-config.json \
6 --region "$REGION" \
7 --query 'HostArn' --output text)1apiVersion: argoproj.io/v1alpha1
2kind: Application
3metadata:
4 name: guestbook
5 namespace: argocd
6spec:
7 project: default
8 source:
9 repoURL: https://codeconnections.<CodeConnection_Region>.amazonaws.com/git-http/<Your_Account_ID>/<CodeConnection_Region>/<Connection_ID>/<Git_Username/Git_Organization/Project>/<Git_Repository>.git
10 targetRevision: HEAD
11 path: guestbook
12 destination:
13 server: arn:aws:eks:<EKS_Cluster_Region>:<Account_ID>:cluster/<Target_EKS_Cluster_Name>
14 namespace: guestbookWhen NOT to use this
The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.
Want the complete reference?
Read official docs35% off the CKA and other certifications with code OCT26NONCYBER, or 40% off Kubernetes security certs (CKS, KCSA) with OCT26CYBER.
CiliumCon Returns: Scaling eBPF Networking at KubeCon 2026
CiliumCon is back, and it's crucial for anyone involved in Kubernetes networking. With Cilium as the de facto CNI, understanding its eBPF foundation is key to managing workloads at scale. Don't miss out on the insights that could elevate your cloud-native architecture.
OVHcloud Joins CNCF: What This Means for Kubernetes in Europe
The CNCF's new partnership with OVHcloud marks a significant shift for Kubernetes in Europe. With OVHcloud operating thousands of production Kubernetes clusters using Cilium, this collaboration promises enhanced networking and security for multi-tenant environments.
Migrating to ALB: Mastering oauth2-proxy in Kubernetes
Switching from NGINX Ingress to ALB can be tricky, especially when handling oauth2-proxy. Learn how to configure oauth2-proxy to work seamlessly with ALB's OIDC authentication capabilities.
Get the daily digest
One email. 5 articles. Every morning.
No spam. Unsubscribe anytime.