diff --git a/fetch-system.polygon-proxy/kustomize/overlays/dev/deployment.yaml b/fetch-system.polygon-proxy/kustomize/overlays/dev/deployment.yaml index f6dde8f..48c5ed6 100644 --- a/fetch-system.polygon-proxy/kustomize/overlays/dev/deployment.yaml +++ b/fetch-system.polygon-proxy/kustomize/overlays/dev/deployment.yaml @@ -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 diff --git a/fetch-system.polygon-proxy/kustomize/overlays/dev/init-script.yaml b/fetch-system.polygon-proxy/kustomize/overlays/dev/init-script.yaml index 47104bb..5d38eae 100644 --- a/fetch-system.polygon-proxy/kustomize/overlays/dev/init-script.yaml +++ b/fetch-system.polygon-proxy/kustomize/overlays/dev/init-script.yaml @@ -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 diff --git a/fetch-system.polygon-proxy/kustomize/overlays/dev/kustomization.yaml b/fetch-system.polygon-proxy/kustomize/overlays/dev/kustomization.yaml index 3e03600..2daac0e 100644 --- a/fetch-system.polygon-proxy/kustomize/overlays/dev/kustomization.yaml +++ b/fetch-system.polygon-proxy/kustomize/overlays/dev/kustomization.yaml @@ -4,6 +4,6 @@ resources: - ../../base - service-account.yaml - init-script.yaml - + - nginx-conf.yaml patchesStrategicMerge: - deployment.yaml diff --git a/fetch-system.polygon-proxy/kustomize/overlays/dev/nginx-conf.yaml b/fetch-system.polygon-proxy/kustomize/overlays/dev/nginx-conf.yaml new file mode 100644 index 0000000..c4c51a3 --- /dev/null +++ b/fetch-system.polygon-proxy/kustomize/overlays/dev/nginx-conf.yaml @@ -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; + } + }