-
Notifications
You must be signed in to change notification settings - Fork 716
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
Garbage collection of plugins container causes crashed pod #3530
Comments
Relates #3294. |
Could we not just do this in the plugin docs: instead of spec:
nodeSets:
- name: default
count: 3
podTemplate:
spec:
initContainers:
- name: install-plugins
command:
- sh
- -c
- |
bin/elasticsearch-plugin install --batch repository-gcs
check for existance spec:
nodeSets:
- name: default
count: 3
podTemplate:
spec:
initContainers:
- name: install-plugins
command:
- sh
- -c
- |
/bin/test -d /usr/share/elasticsearch/plugins/repository-gcs || bin/elasticsearch-plugin install --batch repository-gcs
the question is, how to do it efficently for multiple plugins. |
I think the solution should be part of |
I didn't see anything open already so I opened a feature request in the ES repo elastic/elasticsearch#61385 |
Closing this as the most popular plugins are bundled now. And #5145 should make things easier. |
Kubernetes garbage collects containers after a period of time. If the init container is garbage collected, this can cause the pod to lose the tracking information about its status.
Kubernetes documentation explains why this occurs:
This leads to an edge case of the following:
This is tracked as an issue with Kubernetes: kubernetes/kubernetes#62362
However, this is easily triggered when running Elasticsearch with an
install-plugins
container. It is important to make sure there are some plugins installed.On a node which has the Elasticsearch pod, identify how long ago the init container ran. Then run the following command:
Replace 3h with a value less than the age of the
install-plugins
container.This will cause the Elasticsearch pod to restart the
install-plugins
container and attempt to install the plugins again. However, since theelasticsearch
container is still running, these plugins are already installed on theemptyDir
volume. The volume is not empty as expected and plugins fail to install since they already exist.Recommend to always check if the plugins are installed first before attempting to install due to this case.
The text was updated successfully, but these errors were encountered: