Skip to content

Commit

Permalink
Adding options to prombench's Makefile. (#581)
Browse files Browse the repository at this point in the history
* Adding options to prombench's Makefile.

The options include commands to create and delete the core infrastructure as well as to apply cluster-wide resources.

Signed-off-by: saketjajoo <[email protected]>

* Updating the prombench docs to reuse the commands in Makefile.

Instead of having separate commands to create the core infrastructure
for various cloud providers, the commands from the Makefile can be
resued. This commit changes the docs accordingly to reflect this.

Signed-off-by: saketjajoo <[email protected]>

---------

Signed-off-by: saketjajoo <[email protected]>
  • Loading branch information
saketjajoo authored Jul 5, 2023
1 parent 78258fc commit 884e6fc
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 40 deletions.
29 changes: 29 additions & 0 deletions prombench/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,35 @@ deploy: node_create resource_apply
# if k8s resources are not already cleared
clean: resource_delete node_delete

cluster_create:
${INFRA_CMD} ${PROVIDER} cluster create -a ${AUTH_FILE} \
-v ZONE:${ZONE} -v GKE_PROJECT_ID:${GKE_PROJECT_ID} \
-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} -v SEPARATOR:${SEPARATOR} \
-v CLUSTER_NAME:${CLUSTER_NAME} -v PR_NUMBER:${PR_NUMBER} \
-f manifests/cluster_${PROVIDER}.yaml

cluster_resource_apply:
${INFRA_CMD} ${PROVIDER} resource apply -a ${AUTH_FILE} \
-v ZONE:${ZONE} -v GKE_PROJECT_ID:${GKE_PROJECT_ID} \
-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} -v SEPARATOR:${SEPARATOR} \
-v CLUSTER_NAME:${CLUSTER_NAME} -v PR_NUMBER:${PR_NUMBER} -v DOMAIN_NAME:${DOMAIN_NAME} -v RELEASE:${RELEASE} \
-v GRAFANA_ADMIN_PASSWORD:${GRAFANA_ADMIN_PASSWORD} \
-v SERVICEACCOUNT_CLIENT_EMAIL:${SERVICEACCOUNT_CLIENT_EMAIL} \
-v OAUTH_TOKEN="$(printf ${OAUTH_TOKEN} | base64 -w 0)" \
-v WH_SECRET="$(printf ${WH_SECRET} | base64 -w 0)" \
-v GITHUB_ORG:${GITHUB_ORG} -v GITHUB_REPO:${GITHUB_REPO} \
-f manifests/cluster-infra

cluster_delete:
${INFRA_CMD} ${PROVIDER} cluster delete -a ${AUTH_FILE} \
-v ZONE:${ZONE} -v GKE_PROJECT_ID:${GKE_PROJECT_ID} \
-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} -v SEPARATOR:${SEPARATOR} \
-v CLUSTER_NAME:${CLUSTER_NAME} -v PR_NUMBER:${PR_NUMBER} \
-f manifests/cluster_${PROVIDER}.yaml

node_create:
${INFRA_CMD} ${PROVIDER} nodes create -a ${AUTH_FILE} \
-v ZONE:${ZONE} -v GKE_PROJECT_ID:${GKE_PROJECT_ID} \
Expand Down
27 changes: 5 additions & 22 deletions prombench/docs/eks.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@ export EKS_CLUSTER_ROLE_ARN=<Amazon EKS cluster role ARN>
# then passing it with the -v flag. It is used to split DeploymentVar into a slice.
export SEPARATOR=,
export EKS_SUBNET_IDS=SUBNETID1,SUBNETID2,SUBNETID3
export PROVIDER=eks

../infra/infra eks cluster create -a $AUTH_FILE -v ZONE:$ZONE \
-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 \
-v CLUSTER_NAME:$CLUSTER_NAME \
-f manifests/cluster_eks.yaml
make cluster_create
```


Expand All @@ -64,13 +61,7 @@ export GITHUB_REPO=prometheus
- Deploy the [nginx-ingress-controller](https://github.com/kubernetes/ingress-nginx), Prometheus-Meta, Loki, Grafana, Alertmanager & Github Notifier.

```shell
../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)" \
-v WH_SECRET="$(printf $WH_SECRET | base64 -w 0)" \
-v GITHUB_ORG:$GITHUB_ORG -v GITHUB_REPO:$GITHUB_REPO \
-f manifests/cluster-infra
make cluster_resource_apply
```

- The output will show the ingress IP which will be used to point the domain name to.
Expand All @@ -95,19 +86,11 @@ export PR_NUMBER=<PR to benchmark against the selected $RELEASE>
- Create the nodegroups for the k8s objects

```shell
../infra/infra eks nodes create -a $AUTH_FILE \
-v ZONE:$ZONE -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 \
-v CLUSTER_NAME:$CLUSTER_NAME \
-v PR_NUMBER:$PR_NUMBER -f manifests/prombench/nodes_eks.yaml
make node_create
```

- Deploy the k8s objects

```shell
../infra/infra eks resource apply -a $AUTH_FILE \
-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
make resource_apply
```
23 changes: 5 additions & 18 deletions prombench/docs/gke.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export GKE_PROJECT_ID=<google-cloud project-id>
export CLUSTER_NAME=prombench
export ZONE=us-east1-b
export AUTH_FILE=<path to service-account.json>
export PROVIDER=gke
../infra/infra gke cluster create -a $AUTH_FILE -v GKE_PROJECT_ID:$GKE_PROJECT_ID \
-v ZONE:$ZONE -v CLUSTER_NAME:$CLUSTER_NAME -f manifests/cluster_gke.yaml
make cluster_create
```

### Deploy monitoring components
Expand All @@ -50,14 +50,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 gke resource apply -a $AUTH_FILE -v GKE_PROJECT_ID:$GKE_PROJECT_ID -v ZONE:$ZONE \
-v CLUSTER_NAME:$CLUSTER_NAME -v DOMAIN_NAME:$DOMAIN_NAME \
-v GRAFANA_ADMIN_PASSWORD:$GRAFANA_ADMIN_PASSWORD \
-v SERVICEACCOUNT_CLIENT_EMAIL:$SERVICEACCOUNT_CLIENT_EMAIL \
-v OAUTH_TOKEN="$(printf $OAUTH_TOKEN | base64 -w 0)" \
-v WH_SECRET="$(printf $WH_SECRET | base64 -w 0)" \
-v GITHUB_ORG:$GITHUB_ORG -v GITHUB_REPO:$GITHUB_REPO \
-f manifests/cluster-infra
make cluster_resource_apply
```

- The output will show the ingress IP which will be used to point the domain name to. Alternatively you can see it from the GKE/Services tab.
Expand All @@ -83,17 +76,11 @@ export PR_NUMBER=<PR to benchmark against the selected $RELEASE>
- Create the nodepools for the k8s objects

```
../infra/infra gke nodes create -a $AUTH_FILE \
-v ZONE:$ZONE -v GKE_PROJECT_ID:$GKE_PROJECT_ID -v CLUSTER_NAME:$CLUSTER_NAME \
-v PR_NUMBER:$PR_NUMBER -f manifests/prombench/nodes_gke.yaml
make node_create
```

- Deploy the k8s objects

```
../infra/infra gke resource apply -a $AUTH_FILE \
-v ZONE:$ZONE -v GKE_PROJECT_ID:$GKE_PROJECT_ID -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
make resource_apply
```

0 comments on commit 884e6fc

Please sign in to comment.