This is the multi-page printable view of this section. Click here to print.
Plugins
- 1: Custom image
- 1.1: Introduction
- 1.2: Configuration
- 1.3: Samples
- 2: Kubernetes object transformation
- 2.1: Introduction
- 2.2: Configuration
- 3: Run synchronization
- 3.1: Introduction
- 3.2: Configuration
- 3.3: API Reference
1 - Custom image
1.1 - Introduction
The custom-image plugins enables the deployment of a custom image to be executed as Task. This is extremely useful to run custom logic and software in the resiliency patterns.
The Pod is deployed in the Kubernetes namespace where the Task has been created.
1.2 - Configuration
Task
Configuration
| Name | Description | Type | Required |
|---|---|---|---|
| image | Container image to be deployed | string | yes |
| command | The command to be executed when the container starts | []string | yes |
1.3 - Samples
This is a list of samples of what can be perfomed as Task with the custom-image plugin.
Bash command
Run a bash command:
apiVersion: automation.astronetes.io/v1alpha1
kind: Task
metadata:
name: hello-world
spec:
plugin: custom-image
config:
image: busybox
command:
- echo
- "hello world"
Kubectl command
Execute a kubectl command:
apiVersion: automation.astronetes.io/v1alpha1
kind: Task
metadata:
name: kubectl
spec:
plugin: custom-image
config:
image: bitnami/kubectl:1.27
command:
- kubectl
- cluster-info
clusterRole: cluster-admin
2 - Kubernetes object transformation
2.1 - Introduction
The custom-image plugins enables the deployment of a custom image to be executed as Task. This is extremely useful to run custom logic and software in the resiliency patterns.
2.2 - Configuration
Task
Configuration
| Name | Description | Type | Required |
|---|---|---|---|
| image | Container image to be deployed | string | yes |
| command | The command to be executed when the container starts | []string | yes |
3 - Run synchronization
3.1 - Introduction
This plugins allows the creation of new Synchronization objects on demands, using a custom template.
Use cases
Disaster Recovery
Create a Synchronization process to restore data after a disaster occurs
Computing offloading
Explaind the platform offloading the applications in another cloud provider.
3.2 - Configuration
Introduction
The Task can be configured with some specific parameters using the .spec.config attribute.
Required
Plugin
The .spec.plugin reference to the plugin to be used by the Task. This value must be set to run-synchronization.
Example:
apiVersion: automation.astronetes.io/v1alpha1
kind: Task
metadata:
name: example
spec:
plugin: run-synchronization
...
Synchronization spec
Configure the synchronization spec according to the plugin to be used by the synchronization.
Example:
apiVersion: automation.astronetes.io/v1alpha1
kind: Task
metadata:
name: set-replica-to-1
spec:
plugin: run-synchronization
config:
template:
spec:
plugin: kubernetes-to-kubernetes
config:
sourceName: ...
destinationName: ...
...
Optional
Synchronization annotations
The annotations for the Synchronization object can be configured using the .spec.config.template.metadata.annotations field.
Example:
apiVersion: automation.astronetes.io/v1alpha1
kind: Task
metadata:
name: set-replica-to-1
spec:
plugin: run-synchronization
config:
template:
metadata:
annotations:
env: dev
spec:
plugin: kuberentes-to-kubernetes
config:
sourceName: ...
destinationName: ...
...
Synchronization labels
The labels for the Synchronization object can be configured using the .spec.config.template.metadata.labels field.
Example:
apiVersion: automation.astronetes.io/v1alpha1
kind: Task
metadata:
name: set-replica-to-1
spec:
plugin: run-synchronization
config:
template:
metadata:
labels:
env: dev
spec:
plugin: kuberentes-to-kubernetes
config:
sourceName: ...
destinationName: ...
...
3.3 - API Reference
Config
| Field | Description | Type | Required |
|---|---|---|---|
template | Template | false |
Template
| Field | Description | Type | Required |
|---|---|---|---|
spec | SynchronizationSpec | false |
SynchronizationSpec
SynchronizationSpec defines the desired state of Synchronization
| Field | Description | Type | Required |
|---|---|---|---|
restartPolicy | Restart policy | RestartPolicy | false |
plugin | Synchronization plugin | SynchronizationPlugin | false |
config | Synchronization config | JSON | false |
SynchronizationPlugin
| Field | Description | Type | Required |
|---|