Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,31 @@ spec:
volumeMounts:
- name: init-script-volume
mountPath: /scripts
ports:
- containerPort: 9000
readinessProbe:
exec:
command:
- sh
- -c
- "nc -z localhost 9000 || exit 1"
initialDelaySeconds: 5
periodSeconds: 10
failureThreshold: 10
- name: nginx
image: nginx:alpine
volumeMounts:
- name: nginx-conf-volume
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
ports:
- containerPort: 8080
volumes:
- name: init-script-volume
configMap:
name: polygon-proxy-init-script
defaultMode: 0777
defaultMode: 0744
- name: nginx-conf-volume
configMap:
name: polygon-proxy-nginx-conf
defaultMode: 0644
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ data:
init.sh: |
#!/bin/sh

gcloud config set core/project goboolean-450909

apk add --no-cache curl

gsutil ls gs://goboolean-450909-load-test
gsutil cp gs://goboolean-450909-load-test/output.txt /data/output.txt

curl -Ls https://github.com/vi/websocat/releases/latest/download/websocat.x86_64-unknown-linux-musl -o /usr/local/bin/websocat
chmod +x /usr/local/bin/websocat

cat /data/output.txt | websocat -E -b ws-l:0.0.0.0:8080 reuse-raw:stdio:
gcloud config set core/project goboolean-450909
gsutil cp gs://goboolean-450909-load-test/output.txt /data/output.txt

RUST_LOG=error cat /data/output.txt | websocat -s 9000
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ resources:
- ../../base
- service-account.yaml
- init-script.yaml

- nginx-conf.yaml
patchesStrategicMerge:
- deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: polygon-proxy-nginx-conf
namespace: fetch-system
data:
nginx.conf: |
events {
worker_connections 4;
}
stream {
server {
listen 8080;
proxy_pass 127.0.0.1:9000;
proxy_download_rate 256;
}
}