Kubernetes Resource Model Executor
A command can interact with the Kubernetes Resource Model (KRM) to interact with pods, services, jobs, or any custom resource.
KRM Executor Configuration Properties describes the properties of this definition.
Property | Description |
---|---|
action | The action perfomed on the resource. Valid values are create , patch , or delete . |
yamlTemplate | (Optional) The YAML to use for the specified action. |
Create
The Create action creates a new KRM using the definition from the yamlTemplate
. This is the same as using the kubectl create
command.
Before the resource exists, it cannot be selected by the resource selector, so the resource selector is left blank, as shown in the following example:
executor:
executeKRM:
action: create
yamlTemplate: |
apiVersion: v1
kind: Pod
metadata:
labels:
app: busybox
createdBy: admin-service
name: busybox
spec:
containers:
- command:
- sleep
- "100000"
image: busybox
imagePullPolicy: Always
name: busybox
Patch
The Patch action updates the values of an existing resource, the only resource selected by the resource selector. This is the same as using the kubectl patch
command.
The values to patch are defined in the yamlTemplate
property, as shown in the following example:
executor:
executeKRM:
action: patch
yamlTemplate: |
metadata:
annotations:
patchedBy: admin-service
Delete
The Delete action deletes the resource identified in the Resource Selector. The yamlTemplate
value is not used. This is the same as using the kubectl
delete
command.