Kibana plugin dev against opendistro

Does anyone have any tips on setting up a dev environment for kibana plugin development against an opendistro-based cluster?

I’ve set up an upstream kibana dev environment and successfully built a test plugin but getting the upstream dev environment to talk to my opendistro cluster is giving me heartburn.

To anyone else trying to accomplish this:

After setting up an upstream kibana dev environment according to the instructions at https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#setting-up-your-development-environment installing the opendistro_security plugins for elasticsearch and kibana will result in a plugin dev environment that can interact with an opendistro cluster for testing opendistro-specific functionality during development.

I am trying to accomplish similar thing but I haven’t yet been successful to do so. I have cloned the kibana repo and checked out v7.2.0 tag and bootstrapped kibana development environment. Then I installed opendistro for elasticsearch and the opendistro plugins. Then I modified tried to run the development server using yarn start --oss. But the following errors occur and the dev server is shutdown.

[17:37:36.978] [fatal][root] { Error: "opendistro_security.multitenancy.enabled", "opendistro_security.multitenancy.tenants.preferred", "opendistro_security.readonly_mode.roles", "opendistro_security.auth.type", "opendistro_security.openid.connect_url", "opendistro_security.openid.client_id", "opendistro_security.openid.client_secret", "opendistro_security.openid.base_redirect_url", and "opendistro_security.openid.scope" settings were not applied. Check for spelling errors and ensure that expected plugins are installed.
        at KbnServer._default (/home/faysal/kibanaDev/kibana/src/legacy/server/config/complete.js:98:17) code: 'InvalidConfig', processExitCode: 64 }

How do I solve this issue?

I used to run a container environment for kibana, elasticsearch and logstash.

below procedure may help you.

  1. apt-get update && apt-get install git
  2. apt-get install build-essential libssl-dev
  3. curl https://raw.githubusercontent.com/creationix/nvm/v0.25.0/install.sh | bash
  4. source ~/.profile

install yarn:

  1. curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
  2. echo “deb https://dl.yarnpkg.com/debian/ stable main” | sudo tee /etc/apt/sources.list.d/yarn.list
  3. sudo apt-get update && sudo apt-get install yarn

download kibana source:

  1. create a directory : /kibana-plugin-build
  2. switch to direcotry /kibana-plugin-build
  3. git clone GitHub - elastic/kibana: Your window into the Elastic Stack
  4. git checkout v7.10.2
  5. chmod -R 777 ./

check node version:

  1. cat .node-version [for 7.10.2 - 10.23.1]
  2. nvm install 10.23.1
  3. nvm use 10.23.1
  4. node -v [ print output v10.23.1]
  5. yarn --version

build all dependancies

  1. yarn kbn bootstrap

download plugin source code from github and put it in plugin folder

  1. goto plugin/plugin_name
  2. yarn kbn bootstrap
  3. yarn plugin_helpers build
    it will create zip file in kibana/builds directory

created zip you can copy inside kibana container using docker cp
install it inside container using
#kibana-plugin install file://path-to-zip-file.zip
restart kibana container