origin icon indicating copy to clipboard operation
origin copied to clipboard

Determine image to use for Persistent Volume Recycling

Open markturansky opened this issue 11 years ago • 4 comments

The scrubber pod needs to use an approved and supported OpenShift image, not busybox.

The current implementation is this:

            Containers: []api.Container{
                {
                    Name:  "scrubber",
                    Image: "busybox",
                    // delete the contents of the volume, but not the directory itself
                    Command: []string{"/bin/sh"},
                    // the scrubber:
                    //      1. validates the /scrub directory exists
                    //      2. creates a text file in the directory to be scrubbed
                    //      3. performs rm -rf on the directory
                    //      4. tests to see if the directory is empty
                    // the pod fails if the error code is returned
                    Args: []string{"-c", "test -e /scrub && echo $(date) > /scrub/trash.txt && rm -rf /scrub/* && test -z \"$(ls -A /scrub)\" || exit 1"},
                    VolumeMounts: []api.VolumeMount{
                        {
                            Name:      "vol",
                            MountPath: "/scrub",
                        },
                    },
                },
            },

@smarterclayton

markturansky avatar Jun 12 '15 17:06 markturansky

@sosiouxme you were discussing this in the bluejeans chat

markturansky avatar Jun 12 '15 17:06 markturansky

Thanks, Mark. Yeah, the pattern to follow would presumably be whatever we did for the kubernetes "pause" image which became "origin-pod" in Origin, overridden by the --images specification given to the node/master config.

sosiouxme avatar Jun 12 '15 17:06 sosiouxme

Put the core code in openshift/origin and then we'll use one of the existing images (with an existing component name) to handle this.

smarterclayton avatar Jun 15 '15 02:06 smarterclayton

As a bash script or something.

smarterclayton avatar Jun 15 '15 02:06 smarterclayton