-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
amber
committed
Oct 22, 2024
1 parent
0293ea0
commit 6962a88
Showing
16 changed files
with
177 additions
and
146 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: locust-config | ||
namespace: locust | ||
data: | ||
locust.py: | | ||
from locust import HttpUser, task, between | ||
class NshmUser(HttpUser): | ||
wait_time = between(1, 5) | ||
@task | ||
def web_service(self): | ||
self.client.get("/") | ||
@task | ||
def account_service(self): | ||
self.client.get("/api/accounts") | ||
@task | ||
def item_service(self): | ||
self.client.get("/api/items") | ||
@task | ||
def wishlist_service(self): | ||
self.client.get("/api/wishlists") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: locust-master | ||
namespace: locust | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: locust-master | ||
template: | ||
metadata: | ||
labels: | ||
app: locust-master | ||
spec: | ||
containers: | ||
- name: locust | ||
image: locustio/locust:latest | ||
args: | ||
- "-f" | ||
- "/mnt/locust/locust.py" | ||
- "--master" | ||
- "--host=http://www.nshm.store" | ||
ports: | ||
- containerPort: 8089 | ||
volumeMounts: | ||
- name: locust | ||
mountPath: /mnt/locust | ||
volumes: | ||
- name: locust | ||
configMap: | ||
name: locust-config | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: locust-master | ||
namespace: locust | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app: locust-master | ||
ports: | ||
- protocol: TCP | ||
port: 8089 | ||
targetPort: 8089 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: locust-worker | ||
namespace: locust | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: locust-worker | ||
template: | ||
metadata: | ||
labels: | ||
app: locust-worker | ||
spec: | ||
containers: | ||
- name: locust | ||
image: locustio/locust:latest | ||
args: | ||
- "-f" | ||
- "/mnt/locust/locust.py" | ||
- "--worker" | ||
- "--master-host=locust-master" | ||
resources: | ||
requests: | ||
cpu: "500m" | ||
memory: "512Mi" | ||
limits: | ||
cpu: "1" | ||
memory: "1Gi" | ||
volumeMounts: | ||
- name: locust | ||
mountPath: /mnt/locust | ||
volumes: | ||
- name: locust | ||
configMap: | ||
name: locust-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: autoscaling/v2beta2 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: locust-worker-hpa | ||
namespace: locust | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: locust-worker | ||
minReplicas: 1 | ||
maxReplicas: 10 | ||
metrics: | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
target: | ||
type: Utilization | ||
averageUtilization: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.terraform/ | ||
*.tfstate* | ||
modules/ec2/setup/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters