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
Customizing Kubernetes Labels on Sandbox Pods
For customizing Kubernetes Labels on sandbox pods, you must first allow that label to be present on the sandbox pods by adding them to the allow-list from settings > preserved labels in the Signadot Dashboard.
It is important to avoid specifying labels on sandbox pods that match the selectors of baseline Kubernetes services, as this can cause sandbox pods to be included in unintended service routing.
name: custom-label-sandbox
spec:
description: sandboxed pod with custom label
cluster: ...
forks:
- forkOf:
kind: Deployment
name: route
namespace: hotrod
customizations:
- image: ...
patch:
type: strategic
value: |
spec:
template:
metadata:
labels:
test-label: "true"
Customizing Kubernetes Annotations on Sandbox Pods
The following example shows how you can customize the Kubernetes annotations for a sandboxed workload pod using a strategic merge patch. Unlike labels, there are no restrictions on this operation.
name: custom-annotation-sandbox
spec:
description: sandboxed pod with custom annotation
cluster: ...
forks:
- forkOf:
kind: Deployment
name: route
namespace: hotrod
customizations:
- image: ...
patch:
type: strategic
value: |
spec:
template:
metadata:
annotations:
test-annotation: "true"