Elasticsearch DB Operator - A Kubernetes Operator for Elasticsearch database
3.7K
Elasticsearch DB Operator is a Kubernetes operator built with Kubebuilder, that operates Elasticsearch database (i.e. indices and settings).
You need kubectl to deploy Elasticsearch DB Operator with it.
git clone https://github.com/kaitoy/elasticsearch-db-operator.gitcd elasticsearch-db-operatorkubectl apply -f config/crds/elasticsearchdb_v1beta1_index.yamlkubectl apply -f config/crds/elasticsearchdb_v1beta1_template.yamlkubectl apply -f elasticsearch-db-operator.yamlWrite an index manifest.
e.g.)
apiVersion: elasticsearchdb.kaitoy.github.com/v1beta1
kind: Index
metadata:
labels:
controller-tools.k8s.io: "1.0"
name: index-sample
url:
elasticsearchEndpoint: http://elasticsearch:9200
index: user
spec:
settings:
index:
number_of_shards: 5
number_of_replicas: 1
mappings:
_doc:
_source:
enabled: true
properties:
age:
type: integer
name:
properties:
first:
type: keyword
boost: 2.5
last:
type: keyword
Apply the manifest to create the index.
Delete the manifest to delete the index.
Write a template manifest.
e.g.)
apiVersion: elasticsearchdb.kaitoy.github.com/v1beta1
kind: Template
metadata:
labels:
controller-tools.k8s.io: "1.0"
name: template-sample
url:
elasticsearchEndpoint: http://elasticsearch:9200
template: user_template
spec:
index_patterns:
- user-*
settings:
index:
number_of_shards: 5
number_of_replicas: 1
order: 10
version: 3
mappings:
_doc:
_source:
enabled: true
properties:
age:
type: integer
name:
properties:
first:
type: keyword
boost: 2.5
last:
type: keyword
Apply the manifest to create the template.
Delete the manifest to delete the template.
You need Docker to build Elasticsearch DB Operator container image, and kustomize to generate a Kubernetes manifest file.
git clone https://github.com/kaitoy/elasticsearch-db-operator.gitcd elasticsearch-db-operatordocker build .kustomize build config/default > elasticsearch-db-operator.yamlContent type
Image
Digest
Size
40.9 MB
Last updated
over 7 years ago
docker pull kaitoy/elasticsearch-db-operator