Starting Elasticsearch and Kibana on Kubernetes with analysis-icu Installation

kubernetes
2021-02-16 15:53 (4 years ago) ytyng

You can achieve this by writing the installation script in the args section of deployment.yml.

apiVersion: apps/v1
kind: Deployment
metadata:
namespace: torico
name: elasticsearch
spec:
selector:
matchLabels:
app: elasticsearch

strategy:
type: Recreate
template:
metadata:
labels:
app: elasticsearch
spec:
containers:
- image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
name: elasticsearch
env:
- name: discovery.type
value: single-node
- name: cluster.name
value: docker-cluster
- name: bootstrap.memory_lock
value: "true"
- name: ES_JAVA_OPTS
value: "-Xms512m -Xmx512m"
ports:
- containerPort: 9200
name: elasticsearch
volumeMounts:
- name: elasticsearch-data
mountPath: /usr/share/elasticsearch/data
command:
- /bin/sh
- -c
args:
# Install analysis-icu and then start ES
- "bin/elasticsearch-plugin install analysis-icu && /tini -s -- /usr/local/bin/docker-entrypoint.sh eswrapper"

# For docker image settings
# Check with docker inspect docker.elastic.co/elasticsearch/elasticsearch:7.8.0
# Entrypoint: /tini -- /usr/local/bin/docker-entrypoint.sh
# Cmd: eswrapper

- image: docker.elastic.co/kibana/kibana:7.8.0
name: kibana
ports:
- containerPort: 5601
name: kibana

volumes:
- name: elasticsearch-data
hostPath:
path: /data/elasticsearch

Currently unrated
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.

Archive

2025
2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011