The next version of Pebble will require admin access to get the plan, so that it's safer to include sensitive data (particularly in environment variables).
That means that this code that runs pebble plan, as the mongodb user I think, will no longer work (it will error out with an access denied response).
You could add a Pebble identity for the the user that runs the command that gives it admin access, but I think that would be the wrong approach, since it shouldn't need to have full access to Pebble (which is basically unlimited access to the container). Instead, it would be better to pass the content to the service another way, like in a file.