Copy the manager script in two locations to satisfy the operator
We have bumped into an error when the initdb
job pod starts:
Error: failed to start container "initdb": Error response from daemon: OCI runtime create failed: container_linux.go:377: starting container process caused: exec: "/controller/manager": stat /controller/manager: no such file or directory: unknown
This is due to the fact that the pod bootstrap-controller
initContainer
copies the /manager
binary into the /controller
shared volume, but in our case,
this "binary" is only a script running exec /srv/app/manager
, which itself
is not present in the postgres image (used by the main container).
Init Containers:
bootstrap-controller:
Image: docker-registry.wikimedia.org/repos/data-engineering/postgresql-kubernetes/cloudnative-pg:9b4b94f8748f97c0f3551c72a2b45ed59940ddb8-operator@sha256:3451babc37ff283007b0f0397ba6925d4f44a55e18b62f4dd2352e2e3df690e3
...
Command:
/manager
bootstrap
/controller/manager
--log-level=info
...
Mounts:
/controller from scratch-data (rw)
...
Containers:
initdb:
Image: docker-registry.wikimedia.org/repos/data-engineering/postgresql-kubernetes/postgresql:15
...
Command:
/controller/manager
instance
init
...
Mounts:
/controller from scratch-data (rw)
The copying happens here
The /manager
command abspath is hardcoded here
Bug: T364797