OpenShift: Installation

Enterprise

Bacula Enterprise Only

This solution is only available for Bacula Enterprise. For subscription inquiries, please reach out to sales@baculasystems.com.

To use the OpenShift Plugin in a pod in the OpenShift cluster, please build an image with the OpenShift Plugin installed.

This is an example of a Dockerfile that can be used to create a bacula-fd image:

FROM registry.access.redhat.com/ubi9/ubi
LABEL maintainer="Bacula Systems"
LABEL version="18.0.9"
LABEL name="Bacula Enterprise Edition OpenShift"
LABEL vendor="BACULA SYSTEMS SA"
LABEL summary="This image allows a system administrator to backup their OpenShift pods and resources from their Bacula Director."
LABEL description="This image contains a Bacula File Daemon and the OpenShift plugin which allows connection between OpenShift resources and the Bacula Director."
RUN dnf -y update-minimal --security --setopt=tsflags=nodocs
RUN dnf install hostname lzo -y
RUN useradd -m bacula
RUN dnf clean all
COPY ./baculaPackages/ /root/bacula/
RUN dnf install -y /root/bacula/bacula-enterprise-client-* /root/bacula/bacula-enterprise-libs-* /root/bacula/bacula-enterprise-openshift-plugin-* /root/bacula/bacula-enterprise-kubernetes-tools-*
RUN rm -rf /root/bacula
RUN rm -f /opt/bacula/etc/bacula-fd.conf
RUN chown -R bacula:bacula /opt/bacula
#  expose port
EXPOSE 9102
USER bacula
# Start the service
CMD ["/opt/bacula/bin/bacula-fd", "-f"]

It is required to have bacula-enterprise-client, bacula-enterprise-libs, bacula-enterprise-openshift-plugin and bacula-enterprise-kubernetes-tools rpm packages available in the baculaPackages directory under the directory where the Dockerfile is located. The packages can be downloaded from the customer download area.

The “version” label should be modified according to the OpenShift Plugin version used to deploy the bacula-fd image.

Make sure to push the bacula-fd image to your local registry after building it.

Create the following bacula-fd.yaml pod configuration file to be used for deployment:

apiVersion: v1
kind: Pod
metadata:
  name: bacula-fd
  labels:
    app: bacula-fd
spec:
  containers:
  - name: web
    image: registry.domain.com/<project>/bacula-fd:18.0.9
    env:
      - name: MASTER
        value: "true"
    volumeMounts:
    - name: bacula-conf
      mountPath: /opt/bacula/etc/bacula-fd.conf
      subPath: bacula-fd.conf
  volumes:
    - name: bacula-conf
      configMap:
        name: bacula-configmap

Replace “registry.domain.com/<project>/bacula-fd:18.0.9” with the correct image name that has been pushed to your local registry.

Once you have the pod configuration file, use the following procedure to deploy it:

Login to the OpenShift cluster using an account/service account with enough permissions to deploy the pod:

oc login -u kubeadmin -p <password> <cluster URI>

Create a bacula-fd.conf file that will be used to create the configmap resource for the Bacula File Daemon pod. The bacula-fd.conf file must be in your OpenShift cluster file system. For example:

Director {
    Name = "bacula-dir"
    Password = "bacula-dir-fd-password"
}
FileDaemon {
    Name = "openshift-fd"
    Description = "OpenShift Plugin File Daemon"
    PidDirectory = "/opt/bacula/working"
    PluginDirectory = "/opt/bacula/plugins"
    WorkingDirectory = "/opt/bacula/working"
}
Messages {
    Name = "Standard"
    Director  = "bacula-dir" = All,!Skipped,!Restored
}

Please modify the above example with the Director name and password to be used in your Bacula Enterprise environment.

Then create the configmap resource:

oc create configmap <configmapname> --from-file=/path/to/bacula-fd.conf --from-file=/path/to/cluster/kubeconfig

And create the bacula-fd pod:

oc apply -f ./bacula-fd.yaml

Read more:

Go back to: OpenShift Plugin.