Skip to main content

Custom Patches

You can use custom patches to use the full power of Kubernetes patches to modify your sandboxed workloads. Any valid patch can be used and it will be applied on top of the baseline workload to derive the forked workload.

Using a different update strategy for forked Deployments

By default, forked Deployments are created with an Recreate update strategy to enable fast updates to the sandboxes. Below is an example custom patch that sets the forked workload to use the RollingUpdate update strategy.

name: rolling-update-sandbox
spec:
description: Sandbox with Deployment overriding default Recreate strategy
cluster: ...
forks:
- forkOf:
kind: Deployment
name: route
namespace: hotrod
customizations:
images:
- image: ...
patch:
type: strategic
value: |
spec:
strategy:
type: RollingUpdate

Specifying a custom ImagePullSecret for the forked Deployment

The following example shows how you can specify a custom registry just for the sandboxed (forked) Deployment using a strategic merge patch.

name: custom-registry-sandbox
spec:
description: sandbox with custom imagepullsecret
cluster: ...
forks:
- forkOf:
kind: Deployment
name: route
namespace: hotrod
customizations:
- image: ...
patch:
type: strategic
value: |
spec:
template:
spec:
imagePullSecrets:
- name: regcred