Welcome to Elastic Cloud on Kubernetes "quickstart". Elastic Cloud on Kubernetes
or ECK uses the operator pattern to extend the native Kubernetes API to
provide an Elasticsearch and Kibana-first experience that mimics the
Kubernetes native experience. Installing ECK installs/configures the custom
resource definitions that extend the Kubernetes API to work with Elasticsearch
and Kibana deployments. This gives an experience customized for Elastic
best practices which uses the Kubernetes native tooling. I'm deploying a standard
GKE cluster...
... and I'm setting the number of nodes and the number of CPUs.
I want to have at least seven and a half gigs of RAM available per node.
I'm applying the YAML file that installs and configures the custom resource definitions and
creates the operator. When the operator starts I check the logs. When I see the
message starting the web hook server, this lets me know that the operator is
ready to accept the specifications for the Elasticsearch cluster and the
Kibana deployment, so let's give it an Elasticsearch cluster specification. As
you can see, it's only about 13 lines. This specification causes an
Elasticsearch cluster to be deployed named "quickstart". It's going to use version 7.1.0
of Elasticsearch and it'll be a single node cluster. That node is
master eligible and it's a data and ingest node. That's all I have to do.
Behind the scenes, the cluster is being set up in a best practice method. It'll
have a TLS certificate created and applied. It'll have a strong password
assigned to the Elastic user and then we'll be started. So I'm watching the pod
go through the "init" process and initializing and running. As usual, in the
ready column I have two fields: one for how many pods there are one for how many are ready.
When I have a 1/1 I know that that pod's up. We've also got another test.
I can do a "kubectl get elasticsearch"
and it will tell me the state of the cluster. In this case, it's green. The
Kibana YAML that will apply is a little bit shorter than the
Elasticsearch. Again, "kind" is "Kibana", the name of the deployment is "quickstart".
We're using version 7.1.0. We'll have a single Kibana instance. The next two
lines are the important ones. So "elasticsearchRef:
name: quickstart"
So this causes the operator to associate this Kibana instance with the
Elasticsearch cluster named "quickstart". So it's going to take the TLS
certificate that was generated for the Elasticsearch cluster and apply it to
Kibana. It will also use the username and password that is associated with that
Elasticsearch cluster for the Kibana instance so that the communication is
authenticated and secured. Then we can watch the Kibana pod go through
initialization and check it with "kubectl get kibana". I want to show you how
to connect to Kibana and take a look at the cluster. And we'll
set up monitoring and then we'll scale the Elasticsearch cluster. So as I said,
there's a non-default password assigned so we have to get the password out of
the secret, so I've done that and I've echoed the output to standard out and
I'll grab that and then I will set up port forwarding and pop up Kibana. I am
forwarding port 5601 and I'll open a browser to "http://localhost:5601" and
log in. So I pasted in the password and I'm going to turn on monitoring and
we'll use monitoring to watch the Elasticsearch cluster scale. Now I'm
going to add some sample data and take a look at that data so you can look and
interact with the data just as if it was data from your own web servers. These are
web logs. I'm going to pop back to monitoring and you can see that I've got
a basic license applied and the status of my cluster is green.
And I've got one node that's also green. So let's take a look at the YAML
necessary to scale the cluster up. If you remember this is exactly the same as the
YAML that I used to deploy the Elasticsearch single node cluster
earlier, all I did was change node count from 1 to 3. I could also add anti-affinity
rules here so that Elasticsearch nodes get assigned to individual Kubernetes
nodes and you can add in additional configuration that is Elasticsearch-specific.
And you can see that the Elasticsearch pods are spinning up. Let's
take a look back at monitoring and you can see the cluster turn from single
node to 3 nodes and the status turned yellow. The status is yellow because the
shards are being assigned across the 3 Elasticsearch nodes and once there are 0
unassigned shards, the cluster will turn green again. Thanks very much. There's
more information in the notes down below. There's a link to the documentation
where the "quickstart" is so you can follow these steps yourself and there's
a link to the GitHub repository so you can read all of the details.