[WIP] THREESCALE-11020 Redis TLS certs and keys for porta and backend #1035
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.
Jira: https://issues.redhat.com/browse/THREESCALE-11020
Add a way for the user to provide Redis TLS certs and keys for porta and backend
This PR enables Porta and Apisonator to load TLS configuration details for connecting to Redis. It introduces environment variables to specify the locations of the certificate files and indicate whether TLS mode is enabled.
For additional information, please refer to the Jira ticket and the documentation files included as part of this PR.
Validation
1. Install Redis Server for Test
2. Certificates preparing
3. Update Redis Server with new server certificate
Update
redis-tls-secret
secret, using new created:Restart redis pod
4. Install 3scale
You may prepare the secrets in whichever way is most convenient for you.
Update Client Certificates in
system-redis
andbackedn-redis
secrets via UI. The following tables are for matching data field names with the certificate files created before:Secret: system-redis
Please note:
rediss
indicates a secure connection and port6380
is used for secure Redis connections. For example:4.2. Create s3-credentials secret
4.3. Run Install and Downloads commands
Please make sure you are in
3scale-operator
directory, and run following commands:4.4. Create APIManager CR and Run Operator
5 Check results and Troubleshooting
5.1 Expecting results
If you see Redis related errors, please see next section for Troubleshooting
5.2. Troubleshooting
If you encounter issues with the Redis server, one approach is to test the connection using the
throwaway-redis
pod, which includesredis-cli
. This simplifies the process of checking TLS connections to Redis.5.2.1 Using the throwaway-redis Pod
In this example, we assume that the throwaway-redis pod is not yet present in the 3scale-test project. Since we used the export PREFLIGHT_CHECKS_BYPASS=true environment variable earlier, the pod needs to be created; follow the steps below:
throwaway-redis
pod:You can also check the Redis connection without TLS to verify basic connectivity. Run the following:
If the connection is successful, you should see:
PONG
If the non-TLS connection works, but the TLS connection does not, consider updating the server certificates. To do this:
- Update the Redis testing server's secret:
redis-tls-secret
.- Recreate the Redis testing server pod:
redis-5dc466fc8b-vxpbh 1/1 Running 0 4s
throwaway-redis
pod:After updating the server certificates and recreating the Redis pod, attempt the TLS connection again from the throwaway-redis pod. This time it looks good:
sh-5.1$ redis-cli -h 172.30.56.166 --tls -p 6380 --cert redis-client.crt --key redis-client.key --cacert ca.crt ping
The expected response should now be:
5.2.2 More things to check and useful commands
6 Documentation, Notes