Using Kubernetes Init ContainersΒΆ

A common use-case is to have certain files or drivers accessible on the filesystem of Driverless AI or H2O-3 pod.

The recommended approach is to use regular Kubernetes init containers. These containers are executed before the main container is executed and can be used copy or download files to the filesystem.

There are 2 filesystem locations that can be used:
  • The /dai-data folder for Driverless AI only. The directory contents are preserved across restarts.

  • The /ephemeral folder for Driverless AI and H2O-3. the directory contents are NOT preserved across restarts.

IMPORTANT: Files copied to any other location will not be available on Driverless AI or H2O-3 filesystem.

The following is example of init containers specification in Steam profile for copying a drivers folder from the filesystem of the init container to the persisted filesystem of Driverless AI container.

initContainers:
- name: my-init
  image: myorg/dai-drivers
  command: ["/bin/sh", "-c", "cp -r /drivers /dai-data"]
  volumeMounts:
  - mountPath: /dai-data
    name: data
  - mountPath: /ephemeral
    name: ephemeral

The following is example of Dockerfile used to make container above:

FROM busybox
RUN wget https://archive.apache.org/dist/hadoop/common/hadoop-2.10.1/hadoop-2.10.1.tar.gz
RUN tar -xvzf hadoop-2.10.1.tar.gz
RUN mv hadoop-2.10.1 drivers