From 3de926ceecc0f8eec16503fabe201cc424fc6201 Mon Sep 17 00:00:00 2001 From: Pudong Zheng Date: Wed, 3 Aug 2022 05:56:59 +0000 Subject: [PATCH] integration with ide-proxy --- components/ide-proxy/conf/Caddyfile | 18 ++++++++++++++++-- components/ide-proxy/debug.sh | 4 ++++ .../templates/configmap/vhost.ide-proxy.tpl | 4 ++-- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100755 components/ide-proxy/debug.sh diff --git a/components/ide-proxy/conf/Caddyfile b/components/ide-proxy/conf/Caddyfile index 0016a0b9afcb77..c5898b5e326741 100644 --- a/components/ide-proxy/conf/Caddyfile +++ b/components/ide-proxy/conf/Caddyfile @@ -1,6 +1,12 @@ { auto_https off admin off + servers { + protocol { + # gprc service required this, see detail https://github.com/gitpod-io/gitpod/pull/11542#discussion_r937947826 + allow_h2c + } + } } (compression) { @@ -63,7 +69,7 @@ } @static_path { - path /* + path /code/* /image/* } handle @static_path { @@ -77,8 +83,16 @@ } } + @metrics_web { + path /metrics-api/* + } + + handle @metrics_web { + reverse_proxy ide-metrics.{$KUBE_NAMESPACE}.{$KUBE_DOMAIN}:3000 + } + handle { - respond "404 - Not Found" 404 + reverse_proxy h2c://ide-metrics.{$KUBE_NAMESPACE}.{$KUBE_DOMAIN}:3000 } } diff --git a/components/ide-proxy/debug.sh b/components/ide-proxy/debug.sh new file mode 100755 index 00000000000000..0253cdcdfb5b77 --- /dev/null +++ b/components/ide-proxy/debug.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +set -Eeuo pipefail +source /workspace/gitpod/scripts/ws-deploy.sh deployment ide-proxy false diff --git a/install/installer/pkg/components/proxy/templates/configmap/vhost.ide-proxy.tpl b/install/installer/pkg/components/proxy/templates/configmap/vhost.ide-proxy.tpl index 721ac57a7ad045..5acb56bc268e80 100644 --- a/install/installer/pkg/components/proxy/templates/configmap/vhost.ide-proxy.tpl +++ b/install/installer/pkg/components/proxy/templates/configmap/vhost.ide-proxy.tpl @@ -4,6 +4,6 @@ https://ide.{{.Domain}} { import ssl_configuration reverse_proxy { - to {{.ReverseProxy}} + to h2c://{{.ReverseProxy}} } -} \ No newline at end of file +}