OpenDistro#
To install an OpenDistro cluster, you will need to configure TLS and secrets so that Lagoon can talk to it securely. You're going to have to create a handful of JSON files - put these in the same directory as the values files you've been creating throughout this installation process.
Install OpenDistro Helm, according to https://opendistro.github.io/for-elasticsearch-docs/docs/install/helm/
Create Keys and Certificates#
-
Generate certificates
Note:
CFSSL is CloudFlare's PKI/TLS swiss army knife. It is both a command line tool and an HTTP API server for signing, verifying, and bundling TLS certificates. It requires Go 1.12+ to build.
- Install CFSSL: https://github.com/cloudflare/cfssl
- Generate CA. You'll need the following file:
-
Run the following two commands:
You'll get
ca-key.pem
, andca.pem
. This is your CA key and self-signed certificate. -
Next, we'll generate the node peering certificate. You'll need the following two files:
-
Run the following two commands:
Generate certificate keyscfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=peer node.json | cfssljson -bare node rm node.csr
You'll get
node.pem
andnode-key.pem
. This is the peer certificate that will be used by nodes in the ES cluster. -
Next, we'll convert the key to the format supported by Java with the following command:
-
Now we'll generate the admin certificate. You'll need the following file:
-
Run the following two commands:
Generate admin certificate keyscfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=client admin.json | cfssljson -bare admin rm admin.csr
You'll get
admin.pem
andadmin-key.pem
. This is the certificate that will be used to perform admin commands on the opendistro-security plugin. -
Next, we'll convert the key to the format supported by Java with the following command:
Installing OpenDistro#
Now that we have our keys and certificates, we can continue with the installation.
-
Generate hashed passwords.
- The
elasticsearch-secrets-values.yaml
needs two hashed passwords. Create them with this command (run it twice, enter a random password, store both the plaintext and hashed passwords).
- The
-
Create secrets:
- You'll need to create
elasticsearch-secrets-values.yaml
. See this gist as an example: https://gist.github.com/Schnitzel/43f483dfe0b23ca0dddd939b12bb4b0b
- You'll need to create
-
Install secrets with the following commands:
-
You'll need to create
elasticsearch-values.yaml
. See this gist as an example: (fill all <\> with values) https://gist.github.com/Schnitzel/1e386654b6abf75bf4d66a544db4aa6a -
Install Elasticsearch:
-
Configure security inside Elasticsearch with the following:
Configure securitykubectl exec -n elasticsearch -it elasticsearch-opendistro-es-master-0 -- bash chmod +x /usr/share/elasticsearch/plugins/opendistro_security/tools/securityadmin.sh /usr/share/elasticsearch/plugins/opendistro_security/tools/securityadmin.sh -nhnv -cacert /usr/share/elasticsearch/config/admin-root-ca.pem -cert /usr/share/elasticsearch/config/admin-crt.pem -key /usr/share/elasticsearch/config/admin-key.pem -cd /usr/share/elasticsearch/plugins/opendistro_security/securityconfig/
-
Update
lagoon-core-values.yaml
with: -
Rollout Lagoon Core:
-
Sync all Lagoon Groups with Opendistro Elasticsearch