Skip to content

Commit acd3c84

Browse files
authored
Merge pull request #3 from DO-Solutions/lb-updates
Lb updates
2 parents ae71a9b + 77fe227 commit acd3c84

4 files changed

Lines changed: 9 additions & 26 deletions

File tree

helm/templates/frontend.yaml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -149,28 +149,7 @@ spec:
149149
port: 80
150150
targetPort: 8080
151151

152-
{{/*{{- if .Values.frontend.tls }}*/}}
153-
{{/*apiVersion: cert-manager.io/v1*/}}
154-
{{/*kind: Issuer*/}}
155-
{{/*metadata:*/}}
156-
{{/* name: {{ .Values.frontend.name }}-external*/}}
157-
{{/* namespace: {{ .Release.Namespace }}*/}}
158-
{{/*spec:*/}}
159-
{{/* # ACME issuer configuration*/}}
160-
{{/* # `email` - the email address to be associated with the ACME account (make sure it's a valid one)*/}}
161-
{{/* # `server` - the URL used to access the ACME server’s directory endpoint*/}}
162-
{{/* # `privateKeySecretRef` - Kubernetes Secret to store the automatically generated ACME account private key*/}}
163-
{{/* acme:*/}}
164-
{{/* email: <YOUR_VALID_EMAIL_ADDRESS_HERE>*/}}
165-
{{/* server: https://acme-v02.api.letsencrypt.org/directory*/}}
166-
{{/* privateKeySecretRef:*/}}
167-
{{/* name: letsencrypt-{{ .Values.frontend.name }}-external-private-key*/}}
168-
{{/* solvers:*/}}
169-
{{/* # Use the HTTP-01 challenge provider*/}}
170-
{{/* - http01:*/}}
171-
{{/* ingress:*/}}
172-
{{/* class: cilium*/}}
173-
{{/*{{- end }}*/}}
152+
174153
{{- if .Values.devDeployment }}
175154
# Dev deployment: Expose via LoadBalancer Service
176155
---

helm/templates/loadgenerator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ spec:
9595
image: busybox:latest@sha256:37f7b378a29ceb4c551b1b5582e27747b855bbfaa73fa11914fe0df028dc581f
9696
env:
9797
- name: FRONTEND_ADDR
98-
value: "{{ .Values.frontend.name }}:80"
98+
value: "{{ default .Values.frontend.name .Values.frontend.fqdn }}"
9999
{{- end }}
100100
containers:
101101
- name: main

src/loadgenerator/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ COPY requirements.txt .
2525
RUN pip install --prefix="/install" -r requirements.txt
2626

2727
FROM base
28+
ENV USERS=10
29+
ENV RATE=1
2830

2931
RUN apk update \
3032
&& apk add --no-cache libstdc++ \
@@ -40,4 +42,6 @@ COPY locustfile.py .
4042
# enable gevent support in debugger
4143
ENV GEVENT_SUPPORT=True
4244

43-
ENTRYPOINT locust --host="http://${FRONTEND_ADDR}" --headless -u "${USERS:-10}" -r "${RATE:-1}" 2>&1
45+
# Will automatically follow redirects in case HTTP -> HTTPS redirect in place
46+
ENTRYPOINT ["/bin/sh", "-c", "locust --host=\"http://$FRONTEND_ADDR\" --headless -u \"${USERS}\" -r \"${RATE}\""]
47+

src/loadgenerator/locustfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616

1717
import random
18-
from locust import FastHttpUser, TaskSet, between
18+
from locust import HttpUser, TaskSet, between
1919
from faker import Faker
2020
import datetime
2121
fake = Faker()
@@ -87,6 +87,6 @@ def on_start(self):
8787
viewCart: 3,
8888
checkout: 1}
8989

90-
class WebsiteUser(FastHttpUser):
90+
class WebsiteUser(HttpUser):
9191
tasks = [UserBehavior]
9292
wait_time = between(1, 10)

0 commit comments

Comments
 (0)