{"id":24638047,"url":"https://github.com/upbound/function-argo-eks-discovery","last_synced_at":"2025-05-08T23:45:00.467Z","repository":{"id":211799097,"uuid":"729959046","full_name":"upbound/function-argo-eks-discovery","owner":"upbound","description":"discover aws eks clusters and create argocd server managed resources","archived":false,"fork":false,"pushed_at":"2024-01-22T21:50:03.000Z","size":2001,"stargazers_count":8,"open_issues_count":4,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-08T23:44:53.932Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/upbound.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-10T21:37:23.000Z","updated_at":"2024-12-12T23:43:14.000Z","dependencies_parsed_at":"2024-06-21T14:25:34.344Z","dependency_job_id":"506d2145-cdaf-4fd6-84d3-65b95b77b28d","html_url":"https://github.com/upbound/function-argo-eks-discovery","commit_stats":null,"previous_names":["upbound/function-argo-eks-discovery"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upbound%2Ffunction-argo-eks-discovery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upbound%2Ffunction-argo-eks-discovery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upbound%2Ffunction-argo-eks-discovery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upbound%2Ffunction-argo-eks-discovery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/upbound","download_url":"https://codeload.github.com/upbound/function-argo-eks-discovery/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166473,"owners_count":21864467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-25T10:12:52.397Z","updated_at":"2025-05-08T23:45:00.447Z","avatar_url":"https://github.com/upbound.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# function-argo-eks-discovery\n## Overview\n\n`function-argo-eks-discovery` is a specialized Crossplane function designed to seamlessly integrate Amazon Web Services (AWS) Elastic Kubernetes Service (EKS) clusters with ArgoCD for continuous deployment. This function provides a unique solution for automatically discovering existing AWS EKS clusters and creating corresponding managed resources of kind `Cluster` from the `provider-argocd`. This enables direct integration of these clusters with ArgoCD, facilitating automated deployment and management processes.\n\n![function](function.png)\n\n## Features\n\n- **EKS Cluster Discovery:** Automatically discovers existing AWS EKS clusters, easing the manual burden of tracking and integrating multiple clusters.\n- **Filtering Capability:** Allows users to filter clusters based on specific tags, ensuring that only relevant clusters are selected for ArgoCD integration.\n- **ArgoCD Integration:** Creates managed resources for ArgoCD, enabling it to interact with and deploy to the discovered EKS clusters.\n- **Auto-Discovery for New Clusters:** Continuously monitors for new AWS EKS clusters and integrates them with ArgoCD, keeping the deployment environment up-to-date.\n\n## Function Workflow\n\nThe `function-argo-eks-discovery` performs the following actions:\n\n1. **Retrieve Input Parameters:** Gathers necessary parameters and information from the input request to tailor the discovery process.\n\n```\napiVersion: argo.discover.upbound.io/v1alpha1\nkind: EKS\nmetadata:\n  name: aws-609897127049\n  namespace: default\nspec:\n  parameters:\n    argoRoleArn: arn:aws:iam::123456789101:role/argocd\n    assumeRoleWithWebIdentityArn: arn:aws:iam::123456789101:role/eks-reader\n    region: \"us-west-2\"\n    search:\n      key: \"argocd-autodiscover\"\n      value: \"true\"\n```\n\n2. **Initialize AWS Session and EKS Client:** Uses the AWS SDK for Go to establish a session and create an EKS client, enabling interaction with AWS services.\n\n3. **List EKS Clusters:** Queries all EKS clusters in the specified AWS region, providing a comprehensive overview of the available Kubernetes environments.\n\n4. **Filter Clusters:** Applies user-defined tags to filter the listed EKS clusters, ensuring that only clusters meeting specific criteria are selected for ArgoCD integration.\n\n5. **Generate ArgoCD Server Managed Resources:** For each cluster that matches the filtering criteria, the function decodes the certificate authority data and endpoint. It then generates a corresponding ArgoCD Server managed resource, which is added to the list of resources to be managed by ArgoCD.\n\n## Usage\n\nTo use `function-argo-eks-discovery`, follow these steps:\n\n1. **Configure AWS Credentials:** Ensure that AWS credentials are correctly set up to allow the function to access AWS EKS clusters.\n\n```\napiVersion: iam.aws.upbound.io/v1beta1\nkind: Role\nmetadata:\n  name: eks-reader\nspec:\n  forProvider:\n    assumeRolePolicy: |\n      {\n          \"Version\": \"2012-10-17\",\n          \"Statement\": [\n              {\n                  \"Effect\": \"Allow\",\n                  \"Principal\": {\n                      \"Federated\": \"arn:aws:iam::\u003caws-account-nummer\u003e:oidc-provider/proidc.upbound.io\"\n                  },\n                  \"Action\": \"sts:AssumeRoleWithWebIdentity\",\n                  \"Condition\": {\n                      \"StringLike\": {\n                          \"proidc.upbound.io:sub\": \"mcp:\u003cupbound-org\u003e/\u003ccontrolplane\u003e:function:upbound-function-argo-eks-discovery\",\n                          \"proidc.upbound.io:aud\": \"sts.amazonaws.com\"\n                      }\n                  }\n              }\n          ]\n      }\n```\n\n2. **Define Filtering Tags:** Specify the tags that will be used to filter EKS clusters for integration with ArgoCD.\n\n3. **Deploy the Function:** Deploy `function-argo-eks-discovery` within your Crossplane environment.\n\n```\napiVersion: pkg.crossplane.io/v1beta1\nkind: Function\nmetadata:\n  name: upbound-function-argo-eks-discovery\nspec:\n  package: xpkg.upbound.io/upbound/function-argo-eks-discovery:v0.1.0\n```\n\n4. **Monitor and Manage Resources:** Once deployed, the function will automatically discover and integrate new EKS clusters, which can then be monitored and managed through ArgoCD.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupbound%2Ffunction-argo-eks-discovery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fupbound%2Ffunction-argo-eks-discovery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupbound%2Ffunction-argo-eks-discovery/lists"}