@@ -21,6 +21,7 @@ import (
21
21
22
22
"github.com/pkg/errors"
23
23
"github.com/prometheus/test-infra/pkg/provider"
24
+ "github.com/prometheus/test-infra/pkg/provider/eks"
24
25
"github.com/prometheus/test-infra/pkg/provider/gke"
25
26
kind "github.com/prometheus/test-infra/pkg/provider/kind"
26
27
"gopkg.in/alecthomas/kingpin.v2"
@@ -107,6 +108,50 @@ func main() {
107
108
k8sKINDResource .Command ("delete" , "kind resource delete -f manifestsFileOrFolder -v hashStable:COMMIT1 -v hashTesting:COMMIT2" ).
108
109
Action (k .ResourceDelete )
109
110
111
+ // EKS based commands
112
+ e := eks .New (dr )
113
+ k8sEKS := app .Command ("eks" , "Amazon Elastic Kubernetes Service - https://aws.amazon.com/eks" ).
114
+ Action (e .SetupDeploymentResources )
115
+ k8sEKS .Flag ("auth" , "filename which consist eks credentials." ).
116
+ PlaceHolder ("credentials" ).
117
+ Short ('a' ).
118
+ StringVar (& e .Auth )
119
+
120
+ k8sEKS .Command ("info" , "eks info -v hashStable:COMMIT1 -v hashTesting:COMMIT2" ).
121
+ Action (e .GetDeploymentVars )
122
+
123
+ // EKS Cluster operations
124
+ k8sEKSCluster := k8sEKS .Command ("cluster" , "manage EKS clusters" ).
125
+ Action (e .NewEKSClient ).
126
+ Action (e .EKSDeploymentParse )
127
+ k8sEKSCluster .Command ("create" , "eks cluster create -a credentials -f FileOrFolder" ).
128
+ Action (e .ClusterCreate )
129
+ k8sEKSCluster .Command ("delete" , "eks cluster delete -a credentials -f FileOrFolder" ).
130
+ Action (e .ClusterDelete )
131
+
132
+ // Cluster node-pool operations
133
+ k8sEKSNodeGroup := k8sEKS .Command ("nodes" , "manage EKS clusters nodegroups" ).
134
+ Action (e .NewEKSClient ).
135
+ Action (e .EKSDeploymentParse )
136
+ 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" ).
137
+ Action (e .NodeGroupCreate )
138
+ 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" ).
139
+ Action (e .NodeGroupDelete )
140
+ 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" ).
141
+ Action (e .AllNodeGroupsRunning )
142
+ 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" ).
143
+ Action (e .AllNodeGroupsDeleted )
144
+
145
+ // K8s resource operations.
146
+ 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 ` ).
147
+ Action (e .NewEKSClient ).
148
+ Action (e .K8SDeploymentsParse ).
149
+ Action (e .NewK8sProvider )
150
+ k8sEKSResource .Command ("apply" , "eks resource apply -a credentials -f manifestsFileOrFolder -v hashStable:COMMIT1 -v hashTesting:COMMIT2" ).
151
+ Action (e .ResourceApply )
152
+ k8sEKSResource .Command ("delete" , "eks resource delete -a credentials -f manifestsFileOrFolder -v hashStable:COMMIT1 -v hashTesting:COMMIT2" ).
153
+ Action (e .ResourceDelete )
154
+
110
155
if _ , err := app .Parse (os .Args [1 :]); err != nil {
111
156
fmt .Fprintln (os .Stderr , errors .Wrapf (err , "Error parsing commandline arguments" ))
112
157
app .Usage (os .Args [1 :])
0 commit comments