How to connect Spinnaker with the external “Azure Cache For Redis”
Redis can be used as Spinnaker’s persistent storage source, but it is unsupported and not recommended for production use-cases because it mixes fungible, short-lived cache entries with the Pipeline and Application data that deploy all of your infrastructures. This means you will have to be extra careful when clearing your Spinnaker Redis cache. |
Spinnaker stores its pipeline cache (execution history) in REDIS used as storage. The default configuration deploys a pod in the Kubernetes cluster. If the pods get restarted, all of the histories get lost.
The Redis installed by Spinnaker (either locally, or in Kubernetes) isn’t configured to be production-ready. One of the easiest ways to improve Spinnaker’s reliability at scale is to use an external Redis.
Steps for Configuring Spinnaker to use the External Redis:
- Creating a Redis Cache instance in Azure.
- Configure Spinnaker to Connect with External Redis.
-
Create a Redis Cache instance in Azure:
- Login to your Azure console, and navigate to Azure Cache for Redis service.
- Create a new Redis Cache Instance.
- Enter the details for the new Redis cache instance (Name, Resource Group, DNS Name, Cache type, TLS Port Mode, Redis Version).
Note:
|
- Note down the Redis instance details once the creation is completed.
- Get Hostname and Port from the Properties option
- Get Primary Access Key from the Access Keys option.
Basic Redis Connectivity Testing:
Now that our Redis is instance up and running we can check the connection from the local desktop.
For connecting to the Redis from local desktop use the below URL:
-
Configure Spinnaker to Connect with External Redis:
In order to configure Spinnaker to use the external Redis we need to update the Spinnaker with the below configuration:
- Update Spinnaker Gate configuration (This is needed if Redis is SSL Enabled).
- Update Redis Override URL.
- Apply the changes through Halyard.
-
Update Spinnaker Gate Configuration
Add the below configuration in the gate-local.yml file hosted in the location ~/.hal/default/profiles/gate-local.yml of the halyard pod.
redis:
configuration:
secure: true
-
Update Redis Override URL
Add the Redis Override URL with the new Redis URL in the redis.yml file present in the location ~/.hal/default/service-settings/ of the halyard pod.
overrideBaseUrl: rediss://:<Yout-Primary AccessKey>@<Your-Redis-URL>:6380
skipLifeCycleManagement: true
-
Apply the Changes through Halyard:
Once the above configurations are completed, run the below command to apply these changes to Spinnaker.
hal deploy apply
-
Test the Configurations:
- Once the deployment is completed, browse to the spinnaker URL and create your application.
- Create new pipelines in the application and execute them multiple times to record the cache.
- Check the cache in the Redis after pipeline executions and the pipeline execution history is shown which is getting stored at your Redis instance.
- To double confirm that the new Redis Cache is storing the data, open the console of the cache instance and type keys *. You should be able to see multiple keys of the spinnaker stored in the Redis.
Conclusion:
After applying the above configuration changes to your Spinnaker deployment, your Spinnaker instance is able to connect with the external Redis deployed in Azure and store all the Spinnaker pipeline execution history in the Redis Cache.
If you want to know more about the Spinnaker or request a demonstration, please book a meeting with us.
OpsMx is a leading provider of Continuous Delivery solutions that help enterprises safely deliver software at scale and without any human intervention. We help engineering teams take the risk and manual effort out of releasing innovations at the speed of modern business. For additional information, contact us at OpsMx Support.