diff --git a/files/gitlab-config-template/gitlab.rb.template b/files/gitlab-config-template/gitlab.rb.template index 63a6c1ceb91cffa62025b3fa11afe02cebdabbfd_ZmlsZXMvZ2l0bGFiLWNvbmZpZy10ZW1wbGF0ZS9naXRsYWIucmIudGVtcGxhdGU=..683d846bcd3e8674611773ca1e25dd6c38ba8c3b_ZmlsZXMvZ2l0bGFiLWNvbmZpZy10ZW1wbGF0ZS9naXRsYWIucmIudGVtcGxhdGU= 100644 --- a/files/gitlab-config-template/gitlab.rb.template +++ b/files/gitlab-config-template/gitlab.rb.template @@ -1735,5 +1735,5 @@ ##! Settings used by the GitLab application # gitlab_rails['gitlab_kas_enabled'] = true -# gitlab_rails['gitlab_kas_external_url'] = ws://gitlab.example.com/-/kubernetes-agent +# gitlab_rails['gitlab_kas_external_url'] = ws://gitlab.example.com/-/kubernetes-agent/ # gitlab_rails['gitlab_kas_internal_url'] = grpc://localhost:8153 @@ -1739,5 +1739,5 @@ # gitlab_rails['gitlab_kas_internal_url'] = grpc://localhost:8153 -# gitlab_rails['gitlab_kas_external_k8s_proxy_url'] = ws://gitlab.example.com/-/kubernetes-agent +# gitlab_rails['gitlab_kas_external_k8s_proxy_url'] = https://gitlab.example.com/-/kubernetes-agent/ ##! Enable GitLab KAS # gitlab_kas['enable'] = true diff --git a/files/gitlab-cookbooks/gitlab-kas/libraries/gitlab_kas.rb b/files/gitlab-cookbooks/gitlab-kas/libraries/gitlab_kas.rb index 63a6c1ceb91cffa62025b3fa11afe02cebdabbfd_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIta2FzL2xpYnJhcmllcy9naXRsYWJfa2FzLnJi..683d846bcd3e8674611773ca1e25dd6c38ba8c3b_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIta2FzL2xpYnJhcmllcy9naXRsYWJfa2FzLnJi 100644 --- a/files/gitlab-cookbooks/gitlab-kas/libraries/gitlab_kas.rb +++ b/files/gitlab-cookbooks/gitlab-kas/libraries/gitlab_kas.rb @@ -48,7 +48,7 @@ return unless Gitlab['external_url'] - # For now, the default external URL is on the subpath /-/kubernetes-agent + # For now, the default external URL is on the subpath /-/kubernetes-agent/ # so whether to use TLS is determined from the primary external_url. # See https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/5784 gitlab_uri = URI(Gitlab['external_url']) @@ -63,7 +63,7 @@ raise "external_url scheme should be 'http' or 'https', got '#{gitlab_uri.scheme}" end - Gitlab['gitlab_rails'][key] = "#{scheme}://#{gitlab_uri.host}#{port}/#{gitlab_uri.path}-/kubernetes-agent" + Gitlab['gitlab_rails'][key] = "#{scheme}://#{gitlab_uri.host}#{port}/#{gitlab_uri.path}-/kubernetes-agent/" end def parse_gitlab_kas_internal_url @@ -93,5 +93,5 @@ gitlab_external_url = Gitlab['external_url'] return unless gitlab_external_url - # For now, the default external proxy URL is on the subpath /-/kubernetes-agent/proxy + # For now, the default external proxy URL is on the subpath /-/kubernetes-agent/k8s-proxy/ # See https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/5784 @@ -97,5 +97,5 @@ # See https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/5784 - Gitlab['gitlab_rails'][key] = "#{gitlab_external_url}/-/kubernetes-agent/k8s-proxy" + Gitlab['gitlab_rails'][key] = "#{gitlab_external_url}/-/kubernetes-agent/k8s-proxy/" end def parse_secrets diff --git a/spec/chef/recipes/gitlab-kas_spec.rb b/spec/chef/recipes/gitlab-kas_spec.rb index 63a6c1ceb91cffa62025b3fa11afe02cebdabbfd_c3BlYy9jaGVmL3JlY2lwZXMvZ2l0bGFiLWthc19zcGVjLnJi..683d846bcd3e8674611773ca1e25dd6c38ba8c3b_c3BlYy9jaGVmL3JlY2lwZXMvZ2l0bGFiLWthc19zcGVjLnJi 100644 --- a/spec/chef/recipes/gitlab-kas_spec.rb +++ b/spec/chef/recipes/gitlab-kas_spec.rb @@ -141,5 +141,5 @@ it 'renders gitlab_kas enabled with default URLs in config/gitlab.yml' do expect(gitlab_yml[:production][:gitlab_kas]).to include( enabled: true, - external_url: 'wss://gitlab.example.com/-/kubernetes-agent', + external_url: 'wss://gitlab.example.com/-/kubernetes-agent/', internal_url: 'grpc://localhost:8153', @@ -145,5 +145,5 @@ internal_url: 'grpc://localhost:8153', - external_k8s_proxy_url: 'https://gitlab.example.com/-/kubernetes-agent/k8s-proxy' + external_k8s_proxy_url: 'https://gitlab.example.com/-/kubernetes-agent/k8s-proxy/' ) end end @@ -160,7 +160,7 @@ it 'has exernal URL with scheme `ws` instead of `wss`' do expect(gitlab_yml[:production][:gitlab_kas]).to include( - external_url: 'ws://gitlab.example.com/-/kubernetes-agent' + external_url: 'ws://gitlab.example.com/-/kubernetes-agent/' ) end end @@ -180,5 +180,5 @@ it 'derives the external URLs from the top level external URL, and the internal URL from the listen address' do expect(gitlab_yml[:production][:gitlab_kas]).to include( enabled: true, - external_url: 'wss://gitlab.example.com/-/kubernetes-agent', + external_url: 'wss://gitlab.example.com/-/kubernetes-agent/', internal_url: 'grpc://custom-api-address:9999', @@ -184,5 +184,5 @@ internal_url: 'grpc://custom-api-address:9999', - external_k8s_proxy_url: 'https://gitlab.example.com/-/kubernetes-agent/k8s-proxy' + external_k8s_proxy_url: 'https://gitlab.example.com/-/kubernetes-agent/k8s-proxy/' ) end end