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 Elasticsearch spec asciidoc #1174

Merged
merged 2 commits into from
Jul 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions docs/elasticsearch-spec.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
[id="{p}-elasticsearch-specification"]
== Elasticsearch Specification

There are a number of settings which need to be considered before going into production related to Elasticsearch but also to Kubernetes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this sentence sounds a bit strange, @alaudazzi what do you think?

Copy link
Contributor Author

@thbkrkr thbkrkr Jul 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it sounds a bit odd. This comes from https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html ...
We agreed with @alaudazzi that she will make a global pass when we have covered all the settings.


Basic settings

- JVM heap size
- Node configuration
- HTTP settings & TLS SANs
- Resource limits
- Pod Template
- Volume claim templates

Advanced settings

- Virtual memory
- Custom HTTP certificate
- Secure settings
- Custom plugins and bundles
- Init containers for plugin downloads
- Pod disruption budget
- Change budget (maxUnavailable, maxSurge)

[id="{p}-node-configuration"]
=== Node configuration

Any setting that can be configured in the `elasticsearch.yml` configuration file can be defined for each topology of nodes in the `spec.nodes[?].config` section.

[source,yaml]
----
spec:
nodes:
- nodeCount: 3
config:
node.master: true
node.data: false
node.ingest: false
node.ml: false
xpack.ml.enabled: true
cluster.remote.connect: false
- nodeCount: 10
config:
node.master: false
node.data: true
node.ingest: true
node.ml: true
cluster.remote.connect: false
----

For more information on Elasticsearch settings, see https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html[Configuring Elasticsearch].

[id="{p}-http-settings-tls-sans"]
=== HTTP settings & TLS SANs

You can change the type of the Kubernetes service used to expose Elasticsearch in https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types[different ways] in the `spec.http.service.spec` section.

[source,yaml]
----
spec:
http:
service:
spec:
type: LoadBalancer
----

You can add an IP or a DNS name in the SAN of the self-signed certificate configured by default to secure the HTTP layer with TLS in the `spec.http.tls.selfSignedCertificate` section.

[source,yaml]
----
spec:
http:
tls:
selfSignedCertificate:
subjectAltNames:
- ip: 1.2.3.4
- dns: hulk.example.com
----

[id="{p}-custom-http-certificate"]
=== Custom HTTP certificate

You can provide your own CA and certificates instead of the self-signed certificate to connect to Elasticsearch via HTTPS using a Kubernetes secret.

You need to reference the name of a secret that contains a TLS private key and a certificate (or a chain), in the `spec.http.tls.certificate` section.

[source,yaml]
----
spec:
http:
tls:
certificate:
secretName: my-cert
----

Example to create a Kubernetes TLS secret with a self-signed certificate:

[source,sh]
----
$ openssl req -x509 -newkey rsa:4096 -keyout tls.key -out tls.crt -days 365 -nodes
$ kubectl create secret tls my-cert --cert tls.crt --key tls.key
----