-
Notifications
You must be signed in to change notification settings - Fork 34
feat: part 1 of TLS configs: external TLS #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
fkywong
wants to merge
11
commits into
Altinity:main
Choose a base branch
from
fkywong:fwong/tls-config
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0bd9b72
add tls test fixtures
fkywong 759803a
update python ver in test README
fkywong a7ec45b
refactor support for OrbStack as k8s cluster option
fkywong 0d410c5
add tls smoke tests
fkywong 18592d8
new k8s method get_file_contents_from_pod
fkywong f9c84bd
add tls file content validation to smoke tests
fkywong 4b01f10
fix indiscriminate quoting of clickhouse.settings values
fkywong 4322f7d
expose secure ports
fkywong c71d935
refactor smokes to gracefully clean up dangling namespaces
fkywong 5a5a667
reuse component in tls smoke logic
fkywong db74055
expand tls smoke test verification
fkywong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| --- | ||
| # Single-node deployment with TLS and load-balancer service | ||
| # Tests: Basic deployment with TLS using inline cert + secret refs, no keeper, minimal config | ||
| # Expected pods: 1 ClickHouse | ||
| clickhouse: | ||
| replicasCount: 1 | ||
| shardsCount: 1 | ||
|
|
||
| defaultUser: | ||
| password: "TestTLSPassword123" | ||
| allowExternalAccess: true | ||
|
|
||
| persistence: | ||
| enabled: true | ||
| size: 2Gi | ||
| accessMode: ReadWriteOnce | ||
|
|
||
| service: | ||
| type: ClusterIP | ||
|
|
||
| lbService: | ||
| enabled: true | ||
|
|
||
| settings: | ||
| https_port: 8444 | ||
|
|
||
| configurationFiles: | ||
| # To regenerate the public certificate: | ||
| # cd tests/fixtures/tls/ # this directory | ||
| # openssl req -x509 -key test-server.key -days 10950 \ | ||
| # -out server.crt -config public-cert.cnf -extensions v3_req | ||
| # | ||
| # Update inlineFileContent with the new certificate content for | ||
| # the public certificate to be used in the TLS test fixture. | ||
| # | ||
| # To verify the public certificate: | ||
| # openssl x509 -in server.crt -text -noout | ||
| # | ||
| # To verify that the private key & public certificate moduli match: | ||
| # openssl x509 -noout -modulus -in server.crt | openssl md5 | ||
| # openssl rsa -noout -modulus -in test-server.key | openssl md5 | ||
| config.d/foo.crt: | | ||
| -----BEGIN CERTIFICATE----- | ||
| MIIDQjCCAiqgAwIBAgIUXWU1ixzpK9OTqFfA+ZhK/EOtLIYwDQYJKoZIhvcNAQEL | ||
| BQAwHjEcMBoGA1UEAwwTKi5zdmMuY2x1c3Rlci5sb2NhbDAgFw0yNjAyMTQwMTIz | ||
| NTNaGA8yMDU2MDIwNzAxMjM1M1owHjEcMBoGA1UEAwwTKi5zdmMuY2x1c3Rlci5s | ||
| b2NhbDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAIvGupZ9FR3DLC1R | ||
| /+7hbUySKYSIYOnfZQBnfkMVyLBDdp1WX9aspJLEaazO0rU4l0YjqnLsnckuBxmr | ||
| OOzzeNA+8ExBkPEANR/mROMIcwXhrdFO3sWH2amVncHFUxspwgDhbZJ0zfVNtQo0 | ||
| Q/JthTWGqYW+4HbDnzOWWkUo23oZcClyELTbhQitxgrsOUyDIcR2ZNae3yueVAoK | ||
| F12fH4Sms75FLvwwlUuWU3F1lJKr/U7nPxBdl6CY/sPXITov2LcmwlQLebCchjVB | ||
| 3kEvPKJRBPmW0Dyrr9IRyyExU3qfYdzsJdZOHY/qOB0Dw42qXolkf2L5m6GtW3EF | ||
| hnqM5SsCAwEAAaN2MHQwCwYDVR0PBAQDAgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMB | ||
| MDEGA1UdEQQqMCiCFSouKi5zdmMuY2x1c3Rlci5sb2NhbIIJbG9jYWxob3N0hwR/ | ||
| AAABMB0GA1UdDgQWBBQzPiDb07CH5dKWb5xYa1PoGtz45jANBgkqhkiG9w0BAQsF | ||
| AAOCAQEActxS3ySYtlVmykOlaqTaTj8wyZjQ+gFBQ9APEuKwT4+F2HcuIRWWxJIT | ||
| Pt+CigSMG0XGFQi/+ZRfksXSmfcmErMgDUEr7jsxwvqn6esbAvHX02Vk82oAGkKu | ||
| t3JVxRAz9Dsl1Hm0W+IAGO336QFwd7iTo367TKSz+jcyHRfnftEZnxtbIvqAkR7V | ||
| 8z1NRYhRR5ZeLpwjiqwdAU4AgXKQifQWeWjPeJJr+4pEvy2ivpzhhalX7/tB1TuP | ||
| 4hpQdRi/c+0h5pDtrBpW61gUb0xVWySIkMifLLXfLNjynLKBJmWG91M34fTK1O8+ | ||
| LYd+XhJEhXtFt8+3kktghDcehcuK7g== | ||
| -----END CERTIFICATE----- | ||
|
|
||
| bar.key: | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: clickhouse-certs | ||
| key: server.key | ||
|
|
||
| dhparam.pem: | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: clickhouse-certs | ||
| key: dhparam.pem | ||
|
|
||
| config.d/openssl.xml: | | ||
| <clickhouse> | ||
| <openSSL> | ||
| <server> | ||
| <certificateFile>/etc/clickhouse-server/config.d/foo.crt</certificateFile> | ||
| <privateKeyFile>/etc/clickhouse-server/secrets.d/bar.key/clickhouse-certs/server.key</privateKeyFile> | ||
| <dhParamsFile>/etc/clickhouse-server/secrets.d/dhparam.pem/clickhouse-certs/dhparam.pem</dhParamsFile> | ||
| <verificationMode>relaxed</verificationMode> | ||
| <loadDefaultCAFile>true</loadDefaultCAFile> | ||
| <cacheSessions>true</cacheSessions> | ||
| <disableProtocols>sslv2,sslv3</disableProtocols> | ||
| <preferServerCiphers>true</preferServerCiphers> | ||
| </server> | ||
| </openSSL> | ||
| </clickhouse> | ||
|
|
||
| keeper: | ||
| enabled: false | ||
|
|
||
| operator: | ||
| enabled: true | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| -----BEGIN DH PARAMETERS----- | ||
| MIICDAKCAgEA7QR588LscfM+0JHrq22Xc13COYt5l2p+SqWKAijcdN6n7TWpaSVQ | ||
| 3N1Lj+EFt2sXZ3NpNtfv8YAMZRdbAd1oe+kquGuugtxmUUUGUXiXqeIS6Gp7bGAj | ||
| 5WWobY7WtkD/HsGrvI6kxhTk3nXIEYolUHMJGb0yVLcvYR73j5F6K3ONfd107T49 | ||
| /8PoVOr3ZcoBymfQK/a/mNVADKPPQ/ALAHjpIZEkQlCEj9Jw4Osaro0BEySoKJhK | ||
| 5lIybQ5TJO023r9rpbKNxILaRy5esq4Vir3tlPb9eKumte6X4HFvTU36aTp5ZX/m | ||
| Ef25jhGRxnkH/N/WDEHXZPOToqyNJzdlmhvZjLj+Ru2SknS+pAZ9ZbbovzG1qPhW | ||
| BxFwotZLmTaD1+Xhm374HEY8PGeMytnrRq5W5oMpzY9PbDL+MhwxwChvWMpfPmbE | ||
| YN+InQjWNrw+C/VGLwyiOsQRhKnsCJSNckDv4cDOKuaIajhInnjGrQn7c51X2qT/ | ||
| 8ScJ18FLrokEw/n+61xo4TFq7L9RSddiWbaTLvXrX6ZJvE/G0APA7eDeSN/p83TV | ||
| /pYgtiHOsgaSQ8qMFAIa03hdzfw/XqA8DTu5gf6JbV9BcPJ/381Kv3oC53I7XjQP | ||
| ZfpINvFBEs1Ss4fULqnQ3V65DktpS2HhC2gDVlw+084dSy6cnXX7pv8CAQICAgFF | ||
| -----END DH PARAMETERS----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| [req] | ||
| distinguished_name = req_distinguished_name | ||
| req_extensions = v3_req | ||
| prompt = no | ||
|
|
||
| [req_distinguished_name] | ||
| CN = *.svc.cluster.local | ||
|
|
||
| [v3_req] | ||
| keyUsage = digitalSignature, keyEncipherment, dataEncipherment | ||
| extendedKeyUsage = serverAuth | ||
| subjectAltName = @alt_names | ||
|
|
||
| [alt_names] | ||
| # Wildcard pattern covers all Kubernetes service DNS names: | ||
| # - t10-tls-service.t10-tls.svc.cluster.local | ||
| # - t01-tls-clickhouse.t01-tls.svc.cluster.local | ||
| # - chi-<release>-<cluster>-<shard>-<replica>.<namespace>.svc.cluster.local | ||
| # This makes the certificate resilient to test fixture renames. | ||
| DNS.1 = *.*.svc.cluster.local | ||
|
|
||
| # Localhost for local testing | ||
| DNS.2 = localhost | ||
| IP.1 = 127.0.0.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| -----BEGIN CERTIFICATE----- | ||
| MIIDQjCCAiqgAwIBAgIUXWU1ixzpK9OTqFfA+ZhK/EOtLIYwDQYJKoZIhvcNAQEL | ||
| BQAwHjEcMBoGA1UEAwwTKi5zdmMuY2x1c3Rlci5sb2NhbDAgFw0yNjAyMT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DcehcuK7g== | ||
| -----END CERTIFICATE----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| -----BEGIN PRIVATE KEY----- | ||
| MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCLxrqWfRUdwywt | ||
| Uf/u4W1MkimEiGDp32UAZ35DFciwQ3adVl/WrKSSxGmsztK1OJdGI6py7J3JLgcZ | ||
| qzjs83jQPvBMQZDxADUf5kTjCHMF4a3RTt7Fh9mplZ3BxVMbKcIA4W2SdM31TbUK | ||
| NEPybYU1hqmFvuB2w58zllpFKNt6GXApchC024UIrcYK7DlMgyHEdmTWnt8rnlQK | ||
| Chddnx+EprO+RS78MJVLllNxdZSSq/1O5z8QXZegmP7D1yE6L9i3JsJUC3mwnIY1 | ||
| Qd5BLzyiUQT5ltA8q6/SEcshMVN6n2Hc7CXWTh2P6jgdA8ONql6JZH9i+ZuhrVtx | ||
| BYZ6jOUrAgMBAAECggEAA/WLassnjPdD9L4CMixVIeUbTfNlo1o+NyZh+i56HRwG | ||
| wRV66M7CaUcs+HBx9st1Os8J0JregUikz4JSaMvLW+1cdccpqYSS/KX+GjGEEzeS | ||
| 6n8sajXwjBApLsg9vrg5FDijwjvoFY8E62wS50wDiOzujP5HcgsVIwCa6qM/TD8K | ||
| KVFBwLe9mL9yrGlSPCoj0vvt1R5VbEJh7PeYGfjUl30r0lWmP8ZlN6u2Q+aafEdy | ||
| p3gIHPDRRv6vPSiR24tVQgv0FaTnXRAjYtwhNqlXPMhtHnBEtNA1kuGE9IZimPw/ | ||
| 6P3L3SkbGKL5TRZL6wRfrYada6TeFX9ueE45ES2UuQKBgQDBK/2nCvQr6wlF45kb | ||
| cQ7iunAcu5/DAlqQEXsOoef+WNNzIPxHCTH7YW4GhAUUSYyorLWi20tknrKJrITN | ||
| IotSVgItzpfia7HB3EIuSBysMOS81W+R3HYRoigQigT8YwxiRSACf6x1O5J0J/jC | ||
| tq2Galhwz8ILWaJ5SdACv+sBnQKBgQC5POFBz/GaDFooMFXU4kBw5e1YjkNkEQUh | ||
| bFQL9wZBiP2Xv1QiRV+kbrHwlW1p9gUjOogWz05L2z7qPbtdaIV6MPwEgr2xBCt5 | ||
| mkuSWhUDtzQ2pVFsSY75SOg8CE0lHnHSyUEaPhac06qn3KShUcakpm5A684aUjjy | ||
| 1IH0huuLZwKBgAdBvc+uq6mStNB5UmEjiCmgU2Hg8omC5yAOaA8OqgZ2E8t5a8DH | ||
| aadF67o273HpqW0Uv+YUUuq+w3pEjuCd8ZnwPTi3UCFjZlQgECRo9RrK42zsn7pd | ||
| C9pxuwuUA8fveKGgcylk3new+zl93uyBrFcmW5gxVdrTTTU9PqE70HpJAoGAAaDH | ||
| Wgy50uDI6hGCr5xNdLCQpXaaoQaFRQXutyw0od7SW8MSujph3NAcQEEP9R50bRrW | ||
| l1y7E2+Z3fUs8GU6xxgnHuMHR8cBmtAAWgjwple13cUWMh1zZD1/zQdFpk3eMjwS | ||
| lmh1SmuR1GfcCo7tcAUGcwufhBu05G15tux4pYECgYEAkzun1vyNNoC2CrGR3wIO | ||
| SMwDy5JxZLIDAeAkidHsDrGzYzOekHLrHR2r47F4mJPUyiGVNCIz69fiVkcngshr | ||
| sEeYFP5cN6Ip7chEp683xVBbKM+jsQtMmhadaL5tsulqgScPquCap+dPvaq/ogJ1 | ||
| 2jbKCT447cR8wtviH/OnOgY= | ||
| -----END PRIVATE KEY----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| requests==2.32.3 | ||
| testflows==2.4.13 | ||
| testflows.texts==2.0.211217.1011222 | ||
| PyYAML==6.0.1 | ||
| PyYAML==6.0.1 | ||
| cryptography==46.0.5 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tangential optimization to not wrap every
clickhouse.settings.*value in quotes. Instead, if the value is fully numeric, it won't quote the value, allowing the type to remain as a number.This allows the generated spec to look similar to the documented example: