Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: K8S IaC - GitOps with ArgoCD #2

Merged
merged 269 commits into from
May 24, 2023
Merged

feat: K8S IaC - GitOps with ArgoCD #2

merged 269 commits into from
May 24, 2023

Conversation

tty47
Copy link

@tty47 tty47 commented May 15, 2023

Description 📜

Hello team!

First of all, let me apologize for the size of this PR 🙏

TLDR:
This PR contains a lot of changes in the way that we create and provision the Kubernetes clusters for TestGround.

Original approach: ⛳️

We started developing the IaC with Terraform (EKS) + ArgoCD, but after some tests, we realized that EKS has some limitations when we need to run big clusters (>7k tests pods), this is because the CP ( K8S ControlPlane) is self-managed by AWS, and the amount of resources is managed by them.

Then, we pivoted to: 🎯

After a while, we decided to move to Kops, and following the same approach, IaC + GitOps, we now have the cluster creation with Kops + ArgoCD.

Some benefits of using this approach:

  • We manage the CP and it has autoscaling, so, no matter how many pods we want to spin up, the cluster will be able to support them.
  • GitOps, everything as code, so the configuration is in the repository.
    • We can reuse the provisioning code, as we are using ArgoCD, all the resources + tools are in the repo.
  • Portable, we can move to another cloud provider and reuse the provisioning code.
  • EFS created with Terraform
  • StorageClasses created by Terraform

ℹ️ Also, mention that both clusters are functional, you can use either of them (EKS/Kops).

Thanks in advance!


What's included in this PR 🧐

  • AMI updates:
    • Image reference updated
    • Script which installs some tools in the nodes fixed to be able to use EFS (client NFS)
  • Documentation
  • Scripts to install & delete the cluster updated
  • Remove files that are not needed anymore
  • Upgrade to v1.23.4 -> latest K8S version we can use while running Docker as CRI.
  • Helm Charts added
  • TestsGround tested

ℹ️ Once we merge this PR, we will have to update all the references to this branch.


Closes: celestiaorg/devops#123


Best 🚀

Jose Ramon Mañes

@tty47 tty47 added kubernetes Kubernetes stuffs testground TestGround labels May 15, 2023
@tty47 tty47 marked this pull request as ready for review May 15, 2023 14:04
Copy link
Member

@Bidon15 Bidon15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic job!

manifests/testground/daemon/tg-daemon-deployment.yaml Outdated Show resolved Hide resolved
terraform/main.tf Outdated Show resolved Hide resolved
terraform/main.tf Outdated Show resolved Hide resolved
terraform/main.tf Outdated Show resolved Hide resolved
terraform/main.tf Outdated Show resolved Hide resolved
terraform/main.tf Outdated Show resolved Hide resolved
Comment on lines +393 to +394
repo_url = "https://github.com/celestiaorg/testground-infra.git"
target_revision = "jose/hackground-k8s-tf" // Remove this one, should use main
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to prepare this to use testground/testground after this PR get's merged in out celestiaorg/testground and we do a proper PR to upstream

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly, I had the same idea, after we merge this PR, we'll be able to test it using the celestia repo, if everything works (it should), then, I'll prepare a new PR pointing to the final repo: testground/infra

Copy link
Member

@Bidon15 Bidon15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic job!

@Bidon15
Copy link
Member

Bidon15 commented May 16, 2023

Fantastic job!

Discard my approve :D
I mispressed the button 😓

@Bidon15 Bidon15 self-requested a review May 16, 2023 14:30
Copy link
Member

@Bidon15 Bidon15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge this and do a PR in testground/infra

@Bidon15 Bidon15 merged commit 8ffdef1 into master May 24, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request kubernetes Kubernetes stuffs testground TestGround
Projects
None yet
3 participants