0.1.5 • Published 2 years ago

kit-infra-test v0.1.5

Weekly downloads
-
License
Apache-2
Repository
-
Last release
2 years ago

Kubernetes Iteration Toolkit Infrastructure

Overview:

The Kubernetes Iteration Toolkit (KIT) infrastructure is a Cloud Development Kit (CDK) application that stands up the base infrastructure to test in a Kubernetes-native manner. The K8s components installed directly within the CDK application are for ease of bootstrapping and applying IAM permissions. All other components are able to be installed via Flux resources.

Components:

KIT Infrastructure creates a base K8s cluster with below add-ons by default but also provides an ability to not install some of these addons optionally through CDK context. Add-ons include permissions scoped to the pod using IAM Roles for Service Accounts (IRSA).

  • EKS Cluster (host cluster)
  • EKS Managed Node Group (for critical add-ons mentioned below)
  • EBS CSI Driver (optional)
  • AWS Load Balancer Controller
  • Karpenter (optional)
  • Flux v2
  • Kubernetes Iteration Toolkit (KIT) Operator (optional)

Flux is setup, by deafult, to monitor the KIT git repo path ./infrastructure/k8s-config/clusters/kit-infrastructure, which includes other add-ons that do not require AWS credentials such as tekton, prometheus, grafana, and the metrics-server.

Getting Started:

To launch the KIT infrastructure, ensure you have the following installed:

By default, the CDK application will wire up a Flux config that will monitor for k8s manifests within the KIT repo at infrastructure/k8s-config/clusters/kit-infrastructure. The parameters supplied to the CDK app will allow you to wire up your own application's repo so that you can place tekton test files and other cluster components there.

As an example, below are the parameters used for the Karpenter project.

cdk bootstrap
cdk deploy KITInfrastructure --no-rollback \
 -c TestFluxRepoName="karpenter" \
 -c TestFluxRepoURL="https://github.com/aws/karpenter" \
 -c TestFluxRepoBranch="main" \
 -c TestFluxRepoPath="./test/infrastructure/clusters/test-infra" \
 -c TestNamespace="karpenter-tests" \
 -c TestServiceAccount="karpenter-tests"

As an example, below are the parmeters used if you want to selectively disable some addons like Karpenter, EBSCSIDriver, KIT.

cdk bootstrap
cdk deploy KITInfrastructure --no-rollback \
 -c TestNamespace="tekton-pipelines" \
 -c TestServiceAccount="tekton-pipelines-executor" \
 -c AWSEBSCSIDriverAddon=false \
 -c KarpenterAddon=false \
 -c KITAddon=false \

Context Parameters:

Context ParamDescriptionDefault
FluxRepoURLFlux Source git repo URL to synchronize KIT infrastructure like Tektonhttps://github.com/awslabs/kubernetes-iteration-toolkit
FluxRepoBranchFlux Source git repo branch to synchronize KIT infrastructuremain
FluxRepoPathFlux Source git repo path to Kubernetes resources./infrastructure/k8s-config/clusters/kit-infrastructure
TestFluxRepoNameFlux Source git repo name to synchronize application tests like Tekton Tasks and Pipelines
TestFluxRepoURLFlux Source git repo URL to synchronize application tests
TestFluxRepoBranchFlux Source git repo branch to synchronize application tests
TestFluxRepoPathFlux Source git repo path to Kubernetes resources
TestNamespaceNamespace for application tests to run in
TestServiceAccountService Account for application tests to run with
KITAddonKIT CRD addon that gets installed on KIT Infrastructure by defaulttrue
KarpenterAddonKarpenter CRD addon that gets installed on KIT Infrastructure by defaulttrue
AWSEBSCSIDriverAddonAWSEBSCSIDriver CRD addon that gets installed on KIT Infrastructure by defaulttrue