Skip to content

Commit

Permalink
Fix rebased errors
Browse files Browse the repository at this point in the history
Signed-off-by: Drumil Patel <[email protected]>
  • Loading branch information
weastel committed Aug 20, 2020
1 parent 98c4c40 commit 7a302e8
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
6 changes: 4 additions & 2 deletions infra/infra.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func main() {
// EKS based commands
e := eks.New(dr)
k8sEKS := app.Command("eks", "Amazon Elastic Kubernetes Service - https://aws.amazon.com/eks").
Action(e.NewEKSClient)
Action(e.SetupDeploymentResources)
k8sEKS.Flag("auth", "filename which consist eks credentials.").
PlaceHolder("credentials").
Short('a').
Expand All @@ -97,6 +97,7 @@ func main() {

// 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)
Expand All @@ -117,7 +118,8 @@ func main() {
Action(e.AllNodeGroupsDeleted)

// K8s resource operations.
k8sEKSResource := k8sEKS.Command("resource", `Apply and delete different k8s resources - deployments, services, config maps etc.Required variables -v REGION:europe-west1-b -v CLUSTER_NAME:test `).
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.NewK8sProvider).
Action(e.K8SDeploymentsParse)
k8sEKSResource.Command("apply", "eks resource apply -a credentials -f manifestsFileOrFolder -v hashStable:COMMIT1 -v hashTesting:COMMIT2").
Expand Down
5 changes: 4 additions & 1 deletion pkg/provider/eks/eks.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (c *EKS) K8SDeploymentsParse(*kingpin.ParseContext) error {
log.Fatalf("Couldn't parse deployment files: %v", err)
}

for _, deployment := range deploymentResource {
for name, deployment := range deploymentResource {

decode := scheme.Codecs.UniversalDeserializer().Decode
k8sObjects := make([]runtime.Object, 0)
Expand All @@ -183,6 +183,9 @@ func (c *EKS) K8SDeploymentsParse(*kingpin.ParseContext) error {
}

resource, _, err := decode([]byte(text), nil, nil)
// DEBUG
fmt.Print(name)

if err != nil {
return errors.Wrapf(err, "decoding the resource file:%v, section:%v...", deployment.FileName, text[:100])
}
Expand Down
1 change: 0 additions & 1 deletion prombench/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ resource_apply:
resource_delete:
$(INFRA_CMD) ${PROVIDER} resource delete -a ${AUTH_FILE} \
-v ZONE:${ZONE} -v GKE_PROJECT_ID:${GKE_PROJECT_ID} \
-v REGION:${REGION} \
-v CLUSTER_NAME:${CLUSTER_NAME} -v PR_NUMBER:${PR_NUMBER} \
-f manifests/prombench/benchmark/1c_cluster-role-binding.yaml \
-f manifests/prombench/benchmark/1a_namespace.yaml
Expand Down
6 changes: 3 additions & 3 deletions prombench/docs/eks.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export GITHUB_REPO=prometheus
- Deploy the [nginx-ingress-controller](https://github.com/kubernetes/ingress-nginx), Prometheus-Meta, Loki, Grafana, Alertmanager & Github Notifier.

```
../infra/infra eks resource apply -a $AUTH_FILE -v REGION:$REGION \
../infra/infra eks resource apply -a $AUTH_FILE -v ZONE:$ZONE \
-v CLUSTER_NAME:$CLUSTER_NAME -v DOMAIN_NAME:$DOMAIN_NAME \
-v GRAFANA_ADMIN_PASSWORD:$GRAFANA_ADMIN_PASSWORD \
-v OAUTH_TOKEN="$(printf $OAUTH_TOKEN | base64 -w 0)" \
Expand Down Expand Up @@ -98,15 +98,15 @@ export PR_NUMBER=<PR to benchmark against the selected $RELEASE>

```
../infra/infra eks nodegroups create -a $AUTH_FILE \
-v REGION:$REGION -v NODE_ROLE:$NODE_ROLE -v ROLE_ARN:$ROLE_ARN -v SUBNET_IDS:$SUBNET_IDS -v SEPARATOR:$SEPARATOR -v CLUSTER_NAME:$CLUSTER_NAME \
-v ZONE:$ZONE -v NODE_ROLE:$NODE_ROLE -v ROLE_ARN:$ROLE_ARN -v SUBNET_IDS:$SUBNET_IDS -v SEPARATOR:$SEPARATOR -v CLUSTER_NAME:$CLUSTER_NAME \
-v PR_NUMBER:$PR_NUMBER -f manifests/prombench/nodepools_eks.yaml
```

- Deploy the k8s objects

```
../infra/infra eks resource apply -a $AUTH_FILE \
-v REGION:$REGION -v CLUSTER_NAME:$CLUSTER_NAME \
-v ZONE:$ZONE -v CLUSTER_NAME:$CLUSTER_NAME \
-v PR_NUMBER:$PR_NUMBER -v RELEASE:$RELEASE -v DOMAIN_NAME:$DOMAIN_NAME \
-v GITHUB_ORG:${GITHUB_ORG} -v GITHUB_REPO:${GITHUB_REPO} \
-f manifests/prombench/benchmark
Expand Down
8 changes: 4 additions & 4 deletions prombench/manifests/cluster_eks.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
cluster:
name: {{ .CLUSTER_NAME }}
version: 1.14
rolearn: {{ .ROLE_ARN }}
rolearn: {{ .EKS_CLUSTER_ROLE_ARN }}
resourcesvpcconfig:
endpointpublicaccess: true
subnetids:
{{ range $subnetId := split .SUBNET_IDS .SEPARATOR }}
{{ range $subnetId := split .EKS_SUBNET_IDS .SEPARATOR }}
- {{ $subnetId }}
{{ end }}
nodegroups:
- nodegroupname: main-node
noderole: {{ .NODE_ROLE }}
noderole: {{ .EKS_WORKER_ROLE_ARN }}
disksize: 300
subnets:
{{ range $subnetId := split .SUBNET_IDS .SEPARATOR }}
{{ range $subnetId := split .EKS_SUBNET_IDS .SEPARATOR }}
- {{ $subnetId }}
{{ end }}
instancetypes:
Expand Down
8 changes: 4 additions & 4 deletions prombench/manifests/prombench/nodes_eks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ cluster:
name: {{ .CLUSTER_NAME }}
nodegroups:
- nodegroupname: prometheus-{{ .PR_NUMBER }}
noderole: {{ .NODE_ROLE }}
noderole: {{ .EKS_WORKER_ROLE_ARN }}
disksize: 100
subnets:
{{ range $subnetId := split .SUBNET_IDS .SEPARATOR }}
{{ range $subnetId := split .EKS_SUBNET_IDS .SEPARATOR }}
- {{ $subnetId }}
{{ end }}
instancetypes:
Expand All @@ -18,10 +18,10 @@ nodegroups:
isolation: prometheus
node-name: prometheus-{{ .PR_NUMBER }}
- nodegroupname: nodes-{{ .PR_NUMBER }}
noderole: {{ .NODE_ROLE }}
noderole: {{ .EKS_WORKER_ROLE_ARN }}
disksize: 100
subnets:
{{ range $subnetId := split .SUBNET_IDS .SEPARATOR }}
{{ range $subnetId := split .EKS_SUBNET_IDS .SEPARATOR }}
- {{ $subnetId }}
{{ end }}
instancetypes:
Expand Down

0 comments on commit 7a302e8

Please sign in to comment.