Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
03b4431
Add documentation for gke and update file names in both prombench and…
weastel Aug 14, 2020
168afb7
Replace occurence of PROJECT_ID to GKE_PROJECT_ID in gke.md
weastel Aug 15, 2020
202294d
Move gke specific files to environment directory
weastel May 17, 2020
91a777c
Add authentication support for eks
weastel May 19, 2020
9845e35
Add support for deploymentRangeVars
weastel May 25, 2020
8ee3357
Add cluster and nodepool related functionalities for EKS
weastel Jun 10, 2020
975029a
Add NewK8sProvider support for eks and CLI related changes to incorpo…
weastel Jun 17, 2020
e944eff
Fix minor tweaks
weastel Jun 19, 2020
7ade54c
Add readme.md changes
weastel Jun 19, 2020
1876850
Fix NewK8sProvider
weastel Jun 23, 2020
fd57eed
Change instance type of eks so it matches gke configurations
weastel Jun 24, 2020
604e893
Fix PR to solve test based issues
weastel Jun 26, 2020
f22d10a
Chnage as per review
weastel Jul 6, 2020
f9157f7
Run genflagdocs.sh to pass test
weastel Jul 6, 2020
b7cbe4c
Add documentation for eks
weastel Jul 7, 2020
2bb46e5
Make makefile more readable
weastel Jul 19, 2020
f30a228
remove rangeVars and change documentation for the same and minor fixes
weastel Jul 19, 2020
2b291e6
Run docs cmd
weastel Jul 19, 2020
0db7285
Fix go mod and update eks.go file
weastel Jul 19, 2020
ed35226
Update documentations
weastel Jul 29, 2020
9a2afdd
CHnage toml based credentials to yaml based
weastel Aug 3, 2020
1ad5384
CHnage toml based credentials to yaml based
weastel Aug 3, 2020
c9e343f
Fix formatting issues
weastel Aug 3, 2020
4238719
Add docs
weastel Aug 3, 2020
b6ce4e7
Add info command for eks and documentational changes
weastel Aug 15, 2020
0032526
Remove unnecessary debugging
weastel Aug 16, 2020
e882504
Rebased with respect to gke specific and added info command
weastel Aug 17, 2020
6872fe1
Fix rebased errors
weastel Aug 20, 2020
77c7248
Update docs changes and remove uneccessary debugging
weastel Aug 21, 2020
91eaacd
Add documentational chages
weastel Aug 23, 2020
aa8fd1d
Change logging for log.Fatal to fmt.Error
weastel Aug 25, 2020
3dfc2ae
Add aws iam based authentication
weastel Aug 30, 2020
44870e4
Add SERVICEACCOUNT_CLIENT_EMAIL as [email protected] by default
weastel Sep 3, 2020
a13d384
Display hostname for eks ingress service
weastel Sep 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions funcbench/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ clean: resource_delete cluster_delete
cluster_create:
$(INFRA_CMD) $(PROVIDER) cluster create -a ${AUTH_FILE} \
-v GKE_PROJECT_ID:${GKE_PROJECT_ID} -v ZONE:${ZONE} -v CLUSTER_NAME:funcbench-${PR_NUMBER} -v PR_NUMBER:${PR_NUMBER} \
-v EKS_WORKER_ROLE_ARN:${EKS_WORKER_ROLE_ARN} -v EKS_CLUSTER_ROLE_ARN:${EKS_CLUSTER_ROLE_ARN} \
-v EKS_SUBNET_IDS:${EKS_SUBNET_IDS} \
-f manifests/cluster_$(PROVIDER).yaml

cluster_delete:
$(INFRA_CMD) $(PROVIDER) cluster delete -a ${AUTH_FILE} \
-v GKE_PROJECT_ID:${GKE_PROJECT_ID} -v ZONE:${ZONE} -v CLUSTER_NAME:funcbench-${PR_NUMBER} -v PR_NUMBER:${PR_NUMBER} \
-v EKS_WORKER_ROLE_ARN:${EKS_WORKER_ROLE_ARN} -v EKS_CLUSTER_ROLE_ARN:${EKS_CLUSTER_ROLE_ARN} \
-v EKS_SUBNET_IDS:${EKS_SUBNET_IDS} \
-f manifests/cluster_$(PROVIDER).yaml

resource_apply:
Expand Down
26 changes: 26 additions & 0 deletions funcbench/manifests/cluster_eks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
cluster:
name: {{ .CLUSTER_NAME }}
version: 1.16
rolearn: {{ .ROLE_ARN }}
resourcesvpcconfig:
endpointpublicaccess: true
subnetids:
{{ range $subnetId := split .SUBNET_IDS .SEPARATOR }}
- {{ $subnetId }}
{{ end }}
nodegroups:
- nodegroupname: {{ .CLUSTER_NAME }}
noderole: {{ .NODE_ROLE }}
disksize: 100
subnets:
{{ range $subnetId := split .SUBNET_IDS .SEPARATOR }}
- {{ $subnetId }}
{{ end }}
instancetypes:
- r6g.xlarge
scalingconfig:
desiredsize: 1
maxsize: 1
minsize: 1
labels:
node-name: funcbench-{{ .PR_NUMBER }}
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.12

require (
cloud.google.com/go v0.56.0
github.com/aws/aws-sdk-go v1.34.5
github.com/go-git/go-git-fixtures/v4 v4.0.1
github.com/go-git/go-git/v5 v5.1.0
github.com/google/go-github/v29 v29.0.3
Expand All @@ -24,5 +25,6 @@ require (
k8s.io/apiextensions-apiserver v0.18.4
k8s.io/apimachinery v0.18.4
k8s.io/client-go v0.18.4
sigs.k8s.io/aws-iam-authenticator v0.5.1
sigs.k8s.io/kind v0.8.1
)
54 changes: 54 additions & 0 deletions go.sum

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,39 @@ Commands:
kind resource delete -f manifestsFileOrFolder -v hashStable:COMMIT1 -v
hashTesting:COMMIT2

eks info
eks info -v hashStable:COMMIT1 -v hashTesting:COMMIT2

eks cluster create
eks cluster create -a credentials -f FileOrFolder

eks cluster delete
eks cluster delete -a credentials -f FileOrFolder

eks nodes create
eks nodes create -a authFile -f FileOrFolder -v ZONE:eu-west-1 -v
CLUSTER_NAME:test -v EKS_SUBNET_IDS: subnetId1,subnetId2,subnetId3

eks nodes delete
eks nodes delete -a authFile -f FileOrFolder -v ZONE:eu-west-1 -v
CLUSTER_NAME:test -v EKS_SUBNET_IDS: subnetId1,subnetId2,subnetId3

eks nodes check-running
eks nodes check-running -a credentails -f FileOrFolder -v ZONE:eu-west-1 -v
CLUSTER_NAME:test -v EKS_SUBNET_IDS: subnetId1,subnetId2,subnetId3

eks nodes check-deleted
eks nodes check-deleted -a authFile -f FileOrFolder -v ZONE:eu-west-1 -v
CLUSTER_NAME:test -v EKS_SUBNET_IDS: subnetId1,subnetId2,subnetId3

eks resource apply
eks resource apply -a credentials -f manifestsFileOrFolder -v
hashStable:COMMIT1 -v hashTesting:COMMIT2

eks resource delete
eks resource delete -a credentials -f manifestsFileOrFolder -v
hashStable:COMMIT1 -v hashTesting:COMMIT2


```

Expand Down
45 changes: 45 additions & 0 deletions infra/infra.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"github.com/pkg/errors"
"github.com/prometheus/test-infra/pkg/provider"
"github.com/prometheus/test-infra/pkg/provider/eks"
"github.com/prometheus/test-infra/pkg/provider/gke"
kind "github.com/prometheus/test-infra/pkg/provider/kind"
"gopkg.in/alecthomas/kingpin.v2"
Expand Down Expand Up @@ -107,6 +108,50 @@ func main() {
k8sKINDResource.Command("delete", "kind resource delete -f manifestsFileOrFolder -v hashStable:COMMIT1 -v hashTesting:COMMIT2").
Action(k.ResourceDelete)

// EKS based commands
e := eks.New(dr)
k8sEKS := app.Command("eks", "Amazon Elastic Kubernetes Service - https://aws.amazon.com/eks").
Action(e.SetupDeploymentResources)
k8sEKS.Flag("auth", "filename which consist eks credentials.").
PlaceHolder("credentials").
Short('a').
StringVar(&e.Auth)

k8sEKS.Command("info", "eks info -v hashStable:COMMIT1 -v hashTesting:COMMIT2").
Action(e.GetDeploymentVars)

// EKS Cluster operations
k8sEKSCluster := k8sEKS.Command("cluster", "manage EKS clusters").
Action(e.NewEKSClient).
Action(e.EKSDeploymentParse)
k8sEKSCluster.Command("create", "eks cluster create -a credentials -f FileOrFolder").
Action(e.ClusterCreate)
k8sEKSCluster.Command("delete", "eks cluster delete -a credentials -f FileOrFolder").
Action(e.ClusterDelete)

// Cluster node-pool operations
k8sEKSNodeGroup := k8sEKS.Command("nodes", "manage EKS clusters nodegroups").
Action(e.NewEKSClient).
Action(e.EKSDeploymentParse)
k8sEKSNodeGroup.Command("create", "eks nodes create -a authFile -f FileOrFolder -v ZONE:eu-west-1 -v CLUSTER_NAME:test -v EKS_SUBNET_IDS: subnetId1,subnetId2,subnetId3").
Action(e.NodeGroupCreate)
k8sEKSNodeGroup.Command("delete", "eks nodes delete -a authFile -f FileOrFolder -v ZONE:eu-west-1 -v CLUSTER_NAME:test -v EKS_SUBNET_IDS: subnetId1,subnetId2,subnetId3").
Action(e.NodeGroupDelete)
k8sEKSNodeGroup.Command("check-running", "eks nodes check-running -a credentails -f FileOrFolder -v ZONE:eu-west-1 -v CLUSTER_NAME:test -v EKS_SUBNET_IDS: subnetId1,subnetId2,subnetId3").
Action(e.AllNodeGroupsRunning)
k8sEKSNodeGroup.Command("check-deleted", "eks nodes check-deleted -a authFile -f FileOrFolder -v ZONE:eu-west-1 -v CLUSTER_NAME:test -v EKS_SUBNET_IDS: subnetId1,subnetId2,subnetId3").
Action(e.AllNodeGroupsDeleted)

// K8s resource operations.
k8sEKSResource := k8sEKS.Command("resource", `Apply and delete different k8s resources - deployments, services, config maps etc.Required variables -v ZONE:us-east-2 -v CLUSTER_NAME:test `).
Action(e.NewEKSClient).
Action(e.K8SDeploymentsParse).
Action(e.NewK8sProvider)
k8sEKSResource.Command("apply", "eks resource apply -a credentials -f manifestsFileOrFolder -v hashStable:COMMIT1 -v hashTesting:COMMIT2").
Action(e.ResourceApply)
k8sEKSResource.Command("delete", "eks resource delete -a credentials -f manifestsFileOrFolder -v hashStable:COMMIT1 -v hashTesting:COMMIT2").
Action(e.ResourceDelete)

if _, err := app.Parse(os.Args[1:]); err != nil {
fmt.Fprintln(os.Stderr, errors.Wrapf(err, "Error parsing commandline arguments"))
app.Usage(os.Args[1:])
Expand Down
Loading