Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init containers should tolerate restarts #3294

Closed
barkbay opened this issue Jun 18, 2020 · 0 comments · Fixed by #3295
Closed

Init containers should tolerate restarts #3294

barkbay opened this issue Jun 18, 2020 · 0 comments · Fixed by #3295
Assignees
Labels
>bug Something isn't working v1.2.0

Comments

@barkbay
Copy link
Contributor

barkbay commented Jun 18, 2020

It may happen that an init container is restarted even if the Pod is already running.

See the following issues:

The main issue comes from the init containers that initialize the keystores. For example the Elasticsearch keystore can only be created once, any additional run expect an input from stdin:

echo 'Initializing keystore.'
+ /usr/share/elasticsearch/bin/elasticsearch-keystore create
Initializing keystore.
Exception in thread "main" java.lang.IllegalStateException: unable to read from standard input; is standard input open and a tty attached?
        at org.elasticsearch.cli.Terminal$SystemTerminal.readText(Terminal.java:212)

Another issue is when we use the --force flag, as we do for the APM Server for example: we should not execute blindly --force since this is (re)creating a temporary empty keystore while the APM Server is running.

I think we can solve this problem by using a "flag" on the filesystem. If we want to do some "fine grain recovery" in order to recover from various, more complicated, situations then we need to dig into any keystore specific behaviour, maybe deal with some implementation details, and keep in mind that the keystore might be in used when the init container is running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working v1.2.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant