[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Fwd: Full-fledged pod spec in a DeploymentConfig lifecycle hook ? (OKD 3.11)

Hi folks,

I'm trying to implement database migrations (schema change) using a `mid` hook lifecycle in a DeploymentConfig.
The app uses a templated config file, generated by an initContainer and then injected by means of an emptyDir volume into the applicative container
The same image should be used to perform the migrations, but the hook spec does not allow to reproduce the same system (aka, generate config file then inject it)
(The app is Django, so the migration is just a matter of `manage.py migrate`)

I tried to use the `volumes` part of the hook spec, which, as far as I understand, should copy my volumes from my previously running pod to my hook pod, but if fails with an error message like this in the deployer pod logs

container_linux.go:247: starting container process caused "process_linux.go:364: container init caused \"rootfs_linux.go:54: mounting \\\"/var/lib/origin/openshift.local.volumes/pods/4a362392-4be2-11ea-8a3c-fa163e3048b1/volume-subpaths/config/lifecycle/0\\\" to rootfs \\\"/var/lib/docker/overlay2/2b276679cfe7d485be092f4cc469107586b8f9147fe1cae531ba660788c97a11/merged\\\" at \\\"/var/lib/docker/overlay2/2b276679cfe7d485be092f4cc469107586b8f9147fe1cae531ba660788c97a11/merged/opt/app-root/src/formidable/settings.py\\\" caused \\\"not a directory\\\"\""

I guess the error is related to the fact that my mount use a subPath in the applicative container, but that does not really help me.

Does anyone
1) know why the hook does not allow a full PodSpec (or starting a Job, for example) ?
2) know a better way to do what I'm trying to accomplish (scale to 0 a deployment, launch an arbitrary Pod/Job, deploy the new version) ?

I'm using https://docs.okd.io/latest/rest_api/apis-apps.openshift.io/v1.DeploymentConfig.html as my main doc.

Thanks in advance for any response.


Max Gautier

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]