Loading...
Loading...
Veeam Kasten makes use of the ‘Transforms’ feature to migrate applications between different clusters, between different storage backends, and many other use cases. Transforms enable modifications to Kubernetes resources on restore. The ability to move an application across clusters is an extremely powerful feature that enables a variety of use cases including Disaster Recovery (DR), Test/Dev with realistic data sets, and performance testing in isolated environments. Transforms are loosely modeled on JSON patch and support regex to modify resources with a pattern. The Veeam Kasten for Kubernetes documentation provides a simple example of Transformation. This article provides an example to showcase the use of regex and transforms for modifying ingress/route hostnames.
Transforming the Routes/Ingresses Hostnames During Restores ‘Transformation replace’ operations can be used to replace the hostname in the routes/ingresses. However, if multiple ingress/route hostnames follow a particular pattern, regex can be used to match the text and replace them. Example Scenario There are 4 ingresses with the hostnames as shown below: # kubectl get ingress -n mysql NAME CLASS HOSTS ADDRESS PORTS AGE apigateway <none> prd-apigateway.apps.example.com 80, 443 4h58m backend <none> cn-backend.apps.example.com 80 4h57m frontend <none> cn-frontend.apps.example.com 80 4h56m pgdb <none> prd-pgdb.apps.example.com 80 4h56m While restoring these ingresses to another cluster, there is a requirement to change the prefixes [prd-] and [cn-] from the ingress hostnames to [dr-]. The restored ingresses/routes are expected to have the following hostnames. dr-apigateway.apps.example.com dr-pgdb.apps.example.com dr-backend.apps.example.com dr-frontend.apps.example.com Multiple transformation operations can be used to achieve this, which isn’t efficient! Veeam Kasten for Kubernetes has inbuilt support for matching patterns using regex for transformation. Following regex expression and the JSONpath expression can be used to achieve the desired transformation outcome. JSONPath for ingresses: /spec/rules/0/host JSONPath for routes: /spec/host Regex: (prd|cn)(.*)(\.apps\.example\.com) Value: dr${2}${3} The above expression matches the pattern as shown in the image below
Click on a version to see all relevant bugs
Veeam Integration
Learn more about where this data comes from
BugZero Plan
Streamline upgrades with automated vendor bug scrubs
BugZero Prevent
Wish you caught this bug sooner? Get proactive today.