I've got Postgres 11.5-alpine running in kubernetes in a leader-follower setup that has been working well using streaming replication for some time.
I've decided to cover my bases by writing the WAL archive to a shared network drive (Azure blob via blobfuse csi driver). The driver is working fine, things are being written to the blob and can be read - great!
Now I've gone to set up my archive_command in the kubernetes yaml using the args key. Inside the args I have the following:
"-c", "archive_mode=on", "-c", "archive_command=/bin/true/"
This works fine and /bin/true is called - deployment works and pods are humming along well. Good stuff!
Now I go to put in the actual WAL archive copy command like so:
"-c", "archive_mode=on", "-c", "archive_command=cp %p /var/walarchive/%f"
And I get the following back from my deployed pod, in the log:
postgres: invalid argument: "\%p" Try "postgres --help" for more information.
I've tried escaping the %p, tried with single quotes either side of the entire command. All result in the same error message.
I suspect that there is something going a little bit wrong with the arg being passed into the containers entrypoint and this is going to be a stupid simple fix. At least I'm hoping so.
Has anyone ran into this issue before?