Skip to content

Commit 611ed6b

Browse files
Robert MarshallTaka Nishida
andcommitted
Merge branch 'support-setting-env-var' into 'master'
Support TLS for kas->kas communication for KAS See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7453 Merged-by: Robert Marshall <[email protected]> Approved-by: Timo Furrer <[email protected]> Approved-by: João Alexandre Cunha <[email protected]> Approved-by: Robert Marshall <[email protected]> Co-authored-by: Taka Nishida <[email protected]>
2 parents 7a0be5f + b55ca1f commit 611ed6b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

files/gitlab-config-template/gitlab.rb.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,6 +2165,9 @@ external_url 'GENERATED_EXTERNAL_URL'
21652165
# # 'OWN_PRIVATE_API_CIDR' => '2001:db8:8a2e:370::7334/64', # IPv6 example
21662166
# # 'OWN_PRIVATE_API_PORT' => '8155', # if not set, port from private_api_listen_address is used
21672167
# # 'OWN_PRIVATE_API_SCHEME' => 'grpc', # use grpcs when using TLS on private API endpoint
2168+
# # OWN_PRIVATE_API_HOST is used to verify the TLS cert hostname.
2169+
# # Set KAS' host name if you want to use TLS for KAS->KAS communication.
2170+
# # 'OWN_PRIVATE_API_HOST' => '<server-name-from-cert>',
21682171
# }
21692172

21702173
##! Error Reporting and Logging with Sentry

spec/chef/cookbooks/gitlab-kas/recipes/gitlab-kas_spec.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@
117117
sentry_dsn: 'https://my_key:[email protected]/test_project',
118118
sentry_environment: 'production',
119119
log_level: 'debug',
120+
env: {
121+
'OWN_PRIVATE_API_HOST' => 'fake-host.example.com'
122+
}
120123
}
121124
)
122125
end
@@ -157,6 +160,10 @@
157160
expect(chef_run).to render_file("/var/opt/gitlab/gitlab-kas/authentication_secret_file").with_content(api_secret_key)
158161
expect(chef_run).to render_file("/var/opt/gitlab/gitlab-kas/private_api_authentication_secret_file").with_content(private_api_secret_key)
159162
end
163+
164+
it 'sets OWN_PRIVATE_API_HOST' do
165+
expect(chef_run).to render_file('/opt/gitlab/etc/gitlab-kas/env/OWN_PRIVATE_API_HOST').with_content('fake-host.example.com')
166+
end
160167
end
161168

162169
describe 'gitlab.yml configuration' do
@@ -186,7 +193,7 @@
186193
)
187194
end
188195

189-
it 'has exernal URL with scheme `ws` instead of `wss`' do
196+
it 'has external URL with scheme `ws` instead of `wss`' do
190197
expect(gitlab_yml[:production][:gitlab_kas]).to include(
191198
external_url: 'ws://gitlab.example.com/-/kubernetes-agent/'
192199
)

0 commit comments

Comments
 (0)