Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

[elasticsearch] add example for microk8s #433

Merged
merged 1 commit into from
Jan 6, 2020
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions elasticsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,18 @@ cd examples/kubernetes-kind
make
```

#### MicroK8S

It is also possible to run this chart using [MicroK8S](https://microk8s.io):

```
microk8s.enable dns
microk8s.enable helm
microk8s.enable storage
cd examples/microk8s
make
```

## Clustering and Node Discovery

This chart facilitates Elasticsearch node discovery and services by creating two `Service` definitions in Kubernetes, one with the name `$clusterName-$nodeGroup` and another named `$clusterName-$nodeGroup-headless`.
Expand Down
12 changes: 12 additions & 0 deletions elasticsearch/examples/microk8s/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
default: test

RELEASE := helm-es-microk8s

install:
helm upgrade --wait --timeout=900 --install --values values.yaml $(RELEASE) ../../

test: install
helm test $(RELEASE)

purge:
helm del --purge $(RELEASE)
16 changes: 16 additions & 0 deletions elasticsearch/examples/microk8s/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# MicroK8S

An example of configuration for deploying Elasticsearch chart on [MicroK8S][].

Note that this configuration should be used for test only and isn't recommended
for production.

## Requirements

The following MicroK8S [addons][] need to be enabled:
- `dns`
- `helm`
- `storage`

[MicroK8S]: https://microk8s.io
[Addons]: https://microk8s.io/docs/addons
32 changes: 32 additions & 0 deletions elasticsearch/examples/microk8s/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
# Disable privileged init Container creation.
sysctlInitContainer:
enabled: false

# Restrict the use of the memory-mapping when sysctlInitContainer is disabled.
esConfig:
elasticsearch.yml: |
node.store.allow_mmap: false

# Permit co-located instances for solitary minikube virtual machines.
antiAffinity: "soft"

# Shrink default JVM heap.
esJavaOpts: "-Xmx128m -Xms128m"

# Allocate smaller chunks of memory per pod.
resources:
requests:
cpu: "100m"
memory: "512M"
limits:
cpu: "1000m"
memory: "512M"

# Request smaller persistent volumes.
volumeClaimTemplate:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "microk8s-hostpath"
resources:
requests:
storage: 100M