Advanced Bacula Backup Proxy Pod Deployment
CommunityEnterpriseWarning
This is an advanced topic related to Kubernetes clusters. It is strongly advised against attempting to modify or configure the Bacula Kubernetes Plugin unless you have a deep understanding of the process.
You can customize the service parameters used to deploy Bacula backup Pods dedicated to Persistent Volume Claim data backup. The plugin uses the following Pod service deployment YAML template to execute the proxy operation pod in the cluster.
apiVersion: v1
kind: Pod
metadata:
name: {pod_name}
namespace: {namespace}
labels:
app: baculabackup
spec:
hostname: {pod_name}
{node_name}
containers:
- name: {pod_name}
{security_context}
resources:
limits:
cpu: "1"
memory: "64Mi"
requests:
cpu: "100m"
memory: "16Mi"
image: {image}
env:
- name: PLUGIN_DEBUG
value: "{plugin_debug}"
- name: PLUGIN_MODE
value: "{mode}"
- name: PLUGIN_COMPRESSION_IN_CONTAINER
value: "{compression_in_container}"
- name: PLUGIN_HOST
value: "{host}"
- name: PLUGIN_PORT
value: "{port}"
- name: PLUGIN_TOKEN
value: "{token}"
- name: PLUGIN_JOB
value: "{job}"
imagePullPolicy: {image_pull_policy}
{volume_attachments}
{image_pull_secrets}
restartPolicy: Never
{volumes}
The template above contains predefined placeholders that are replaced with the corresponding values during Pod execution preparation. To customize proxy Pod deployment, you can tune the template variables or modify the template body. The list below describes all supported variables and their requirements.
- pod_name
This is the predefined Pod name used by the plugin. This variable is required and cannot be customized.
- namespace
This is a Namespace name for which the PVC Data backup is performed. This variable is required and cannot be customized.
- node_name
This is a placeholder for Cluster node name parameter (
nodeName: ...) used to mount an existing Volume Claim for backup or restore, if required for the selected PVC. In most cases, this variable is required and cannot be customized.- security_context
In some environments, a specific security context is required to run as the root user. This context corresponds to the
security_context=...Kubernetes Plugin parameter. This variable is optional.- image
This is a Pod Container image name to execute. You can customize or omit this variable as long as you provide a Container image name required by the cluster.
- plugin_debug
This is the debug level that should be set in the container. This corresponds to the
debug=...Kubernetes Plugin parameter. This variable is optional.- mode
This is an operation mode for the Proxy Pod. Supported values are:
backupandrestore. This variable is required and cannot be customized.- compression_in_container
This is the algorithm to compress data used when the pvc is in block mode. This corresponds to the
compression_in_container=...Kubernetes Plugin parameter. This variable is optional.- host
This is an endpoint address which corresponds to the
pluginhost=...Kubernetes Plugin parameter. This variable is required. You can customize or omit this variable as long as you provide a value for the PLUGIN_HOST Container environment.- port
This is an endpoint address which corresponds to the
pluginport=...Kubernetes Plugin parameter. This variable is required. You can customize or omit this variable as long as you provide a value for the PLUGIN_PORT Container environment.- token
This is an authorization token (randomly generated). This variable is required and cannot be customized.
- job
This is the job name. This variable is required and cannot be customized.
- image_pull_policy
This is the policy to pull image from authenticated registry. This corresponds to the
imagepullpolicy=...Kubernetes Plugin parameter. This variable is optional.- volume_attachments
This is the pvc attachment to the Pod. This variable is required and cannot be customized.
- image_pull_secrets
This is the name of the Kubernetes Secret used to pull image from authenticated registry. This corresponds to the
imagepullsecret=...Kubernetes Plugin parameter. This variable is optional.- volumes
This is the name of the PVC for backup or restore operations. This variable is required and cannot be customized.
You can create the required file:
/opt/bacula/scripts/bacula-backup.yaml or point to a custom one
using the $DEFAULTPODYAML environment variable.
See also
Previous articles:
Next articles:
Go back to: Installation.