Elasticsearch Kubernetes
This is an Elasticsearch docker image meant to be used with PetSets.
This image is using Fabric8's great work around the kubernetes plugin for elasticsearch and their image as parent.
Docker base image
- This image is based on this JRE image.
Env variables
- CLUSTER_NAME : Elasticsearch Cluster name (default : KUBERNETES_NAMESPACE)
- NODE_TYPE : Define the node type (default : MASTER_CLIENT_DATA)
- MASTER : Node type will be set as Master
- CLIENT : Node type will be set as Client
- DATA : Node type will be set as Data
- MASTER_CLIENT_DATA : Node type will be set as Master, Client and Data
- DISCOVERY_SERVICE : Set the discovery service name for Kubernetes Plugin (default : elasticsearch-discovery)
- KUBERNETES_NAMESPACE : Kubernetes namespace of the Pod (default : default)
Immutable Elasticsearch Configs
- ES_HEAP_SIZE : 512Mi
- NETWORK_HOST : _site_
- Node Name : By default will be the hostname which is the Pod name in our case
Installed Plugins
Plugin name | Version | Purpose |
---|---|---|
kopf | v2.1.2 | ES UI |
elasticsearch-cloud-kubernetes | 2.4.1 | Kubernetes Discovery service |
Changes for PetSet
- Handle downscales so that no data loss occurs (using lifecycle hooks) thanks to the work of @simonswine at @jetstack elasticsearch-pet
Example of usage with Pod lifecycle
apiVersion: apps/v1alpha1
kind: PetSet
metadata:
name: "es-data"
labels:
type: data
spec:
...
spec:
serviceAccountName: "elasticsearch"
containers:
- name: elasticsearch
...
lifecycle:
preStop:
exec:
command: ["/bin/bash","/pre-stop-hook.sh"]
...