Kanister Pod Override¶
In some cases, there can be a requirement to override Kanister
jobs pods specifications with custom values, such as
serviceAccountName. This can serve a
use-case when the pods need to be scheduled on a particular node, or use a
ServiceAccount which provides limited access. Changing these values
manually for Kanister Job pods will not be feasible.
To handle specifying the custom pod override for all Kanister Pods,
a ConfigMap named
pod-spec-override must be created in the
namespace so that K10 applies the configuration to all Kanister Job Pods.
For example, the following ConfigMap defines a Pod Specification, which
tolerations to node taints, and a
apiVersion: v1 data: override: | kind: Pod spec: nodeSelector: disktype: ssd tolerations: - effect: NoSchedule key: app operator: Equal value: mysql serviceAccountName: abcd kind: ConfigMap metadata: name: pod-spec-override namespace: kasten-io ...
This ConfigMap now would be merged with all Kanister job Pod specifications. The Kanister restore job Pods would look like:
apiVersion: v1 kind: Pod metadata: name: restore-data-* namespace: mysql spec: nodeSelector: disktype: ssd serviceAccount: abcd serviceAccountName: abcd tolerations: - effect: NoSchedule key: app operator: Equal value: mysql ...