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

Kibana plugins directory in custom image is no longer accessible since ECK 2.16.0 #8388

Open
albundy83 opened this issue Jan 2, 2025 · 2 comments · May be fixed by #8389
Open

Kibana plugins directory in custom image is no longer accessible since ECK 2.16.0 #8388

albundy83 opened this issue Jan 2, 2025 · 2 comments · May be fixed by #8389
Labels
>bug Something isn't working

Comments

@albundy83
Copy link

Hello,

with the new way to secure kibana (#7787), it seems that a new volume is always mounted /usr/share/kibana/plugins, cf commit https://github.com/elastic/cloud-on-k8s/pull/8086/files#diff-643daccc0cb377f39f56e15ac9dbcc083c7fe318a2e030ee931c7b96fd2baa81

But if you read the documentation, you should install plugins during image build: https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-kibana-plugins.html

But due to the mounted volume /usr/share/kibana/plugins, plugins are not available, they are "under" the mounted volume and not accessible.

Is it possible to disable the mount of /usr/share/kibana/plugins ?
I use the current latest operator version 2.16.0 version.

@botelastic botelastic bot added the triage label Jan 2, 2025
@pebrc pebrc added the >bug Something isn't working label Jan 2, 2025
@botelastic botelastic bot removed the triage label Jan 2, 2025
@pebrc
Copy link
Collaborator

pebrc commented Jan 3, 2025

Unfortunately currently the only way to disable the plugin volume mount is by disabling the default security context via set-default-security-context=false via the ECK operator configuration https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-operator-config.html This has the side-effect of also disabling the security context for Elasticsearch.

The problem we have is that Kibana writes into the plugins directory which makes it incompatible with readOnlyRootFilesystem: true in the security context.

You could potentially reinstate the security context manually through the podTemplate but leave in the case of Kibana readOnlyRootFilesystem: false

One option we could add to ECK would be an init container with a script that copies the content of /usr/share/kibana/plugins into the emptyDir volume that will shadow this directory. It is a pretty heavy weight approach that comes with its own set of drawbacks:

It would allows us however to keep the security context as is and still support plugin installation via custom container images.

@barkbay barkbay changed the title Kibana plugins ? Kibana plugins directory in custom image is no longer accessible since ECK 2.16.0 Jan 3, 2025
@albundy83
Copy link
Author

albundy83 commented Jan 3, 2025

Hello,

To fix my issue, of course, I have added an initContainer in my Kibana on the same way that described here for elastic:

spec:
  podTemplate:
    spec:
      initContainers:
        - name: install-plugins
          command:
            - sh
            - -c
            - |
              /usr/share/kibana/bin/kibana-plugin install <my-plugin> || { echo "Plugin install failed with return code $?"; exit 1; }
              /usr/share/kibana/bin/kibana --optimize

Maybe with just more flexibility, we could have an option to mount or not the /usr/share/kibana/plugins volume ?

@naemono naemono linked a pull request Jan 8, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants