Skip to content

Commit

Permalink
[Helm] feat: add support for forward proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
karimatwa authored Dec 6, 2024
1 parent 08f707b commit b1ec981
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/helm-chart-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,9 @@ jobs:
CHART_FILE=$(basename helm-chart/*.tgz)
echo "Helm chart URL: http://${AWS_S3_BUCKET}.s3-website.${AWS_REGION}.amazonaws.com/charts/$CHART_FILE"
echo "Helm Repo Index URL: http://${AWS_S3_BUCKET}.s3-website.${AWS_REGION}.amazonaws.com/index.yaml"
- name: Create CloudFront invalidation
if: ${{ github.event_name != 'pull_request' }}
env:
CLOUDFRONT_DISTRIBUTION_ID: ${{ vars.SE_HELM_AWS_CLOUDFRONT_DISTRIBUTION_ID }}
run: aws cloudfront create-invalidation --distribution-id ${CLOUDFRONT_DISTRIBUTION_ID} --paths "/*"
2 changes: 1 addition & 1 deletion helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
appVersion: "1.0"
version: 1.0.0
version: 1.0.1
name: enterprise-locations-packages
description: Official Gatling Enterprise Helm chart for Private Locations & Packages
home: https://gatling.io
Expand Down
3 changes: 3 additions & 0 deletions helm-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ helm show values gatling/enterprise-locations-packages > values.yaml
> [!TIP]
> When connecting to the cluster using HTTPS, if a custom truststore and/or keystore is needed, `KUBERNETES_TRUSTSTORE_FILE`, `KUBERNETES_TRUSTSTORE_PASSPHRASE` and/or `KUBERNETES_KEYSTORE_FILE`, `KUBERNETES_KEYSTORE_PASSPHRASE` environment variables should be set.
> [!TIP]
> The control plane and location configurations allow for the setup of a forward proxy. To enable this, uncomment `enterpriseCloud.url` values in the configuration file for the control plane and/or location. Ensure the forward proxy is configured to rewrite the Host header to `api.gatling.io` to ensure proper functionality.
5. Install the Gatling Enterprise Helm Chart. Optional: To install specific chart version, include the `--versions` flag:
```sh
helm install gatling-hybrid gatling/enterprise-locations-packages --namespace gatling --values <yaml-file/url> or --set key1=val1,key2=val2
Expand Down
21 changes: 17 additions & 4 deletions helm-chart/templates/_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
control-plane {
token = "{{ .Values.controlPlane.token }}"
description = "{{ .Values.controlPlane.description }}"
extra_content = {{ toJson .extra_content }}
{{- if .Values.controlPlane.enterpriseCloud }}
enterprise-cloud = {
{{- if .Values.controlPlane.enterpriseCloud.url }}
url = "{{ .Values.controlPlane.enterpriseCloud.url }}"
{{- end }}
}
{{- end }}
locations = [
{{- range .Values.privateLocations }}
{
Expand All @@ -17,7 +23,14 @@ control-plane {
java-home = "{{ .javaHome }}"
{{- end }}
jvm-options = {{ toJson .jvmOptions }}
{{- with .job }}
{{- if .enterpriseCloud }}
enterprise-cloud = {
{{- if .enterpriseCloud.url }}
url = "{{ .enterpriseCloud.url }}"
{{- end }}
}
{{- end }}
{{- with .job }}
job = {
"apiVersion": "batch/v1",
"kind": "Job",
Expand All @@ -30,8 +43,8 @@ control-plane {
"ttlSecondsAfterFinished": {{ .spec.ttlSecondsAfterFinished }}
}
}
{{- end }}
debug.keep-load-generator-alive = {{ toJson .keepLoadGeneratorAlive }}
{{- end }}
debug.keep-load-generator-alive = {{ toJson (default false .keepLoadGeneratorAlive) }}
}
{{- end }}
]
Expand Down
7 changes: 5 additions & 2 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ controlPlane:
cpu: "1"
# Security context for the pod or container
securityContext: {}
#extra_content: {} # Extra content (currently commented out)
#enterpriseCloud:
#url: "http://private-control-plane-forward-proxy/gatling" # Set up a forward proxy for the control plane

privateLocations:
- id: "prl_kubernetes" # Unique identifier for the private location
Expand All @@ -62,8 +63,10 @@ privateLocations:
#image: "gatlingcorp/classic-openjdk:latest" # Custom image name
#systemProperties: {} # System properties for the JVM
#javaHome: "/usr/lib/jvm/zulu" # Java home path
#jvmOptions: ["-Xmx4G", "-Xms512M"] # JVM options
#jvmOptions: ["-Xmx4G", "-Xms512M"] # JVM options
#keepLoadGeneratorAlive: false # Whether to keep the load generator alive (for debugging)
#enterpriseCloud:
#url: "http://location-forward-proxy/gatling" # Set up a forward proxy for your location configuration

# Working at the template spec level, not the job spec level.
# For a detailed structure, refer to this example JSON job definition:
Expand Down

0 comments on commit b1ec981

Please sign in to comment.