skills/kubeblocks-addon-elasticsearch/SKILL.md
Deploy and manage Elasticsearch clusters on KubeBlocks for full-text search, log analytics, and observability. Use when the user mentions Elasticsearch, ELK stack, search engine, log analytics, Kibana, full-text search, or explicitly wants to create an Elasticsearch cluster. Provides single-node (dev/test) and multi-node cluster creation with connection methods. No backup/restore support in KubeBlocks currently. For generic cluster creation across all engines, see kubeblocks-create-cluster. For Day-2 operations (scaling, volume expansion, etc.), use the corresponding operation skill.
npx skillsauth add apecloud/kubeblocks-skills kubeblocks-addon-elasticsearchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Deploy Elasticsearch clusters on Kubernetes using KubeBlocks. Elasticsearch is a distributed, RESTful search engine for full-text search, log analytics, and observability. Supports single-node (dev/test) and multi-node topologies.
Official docs: https://kubeblocks.io/docs/preview/kubeblocks-for-elasticsearch/01-overview Quickstart: https://kubeblocks.io/docs/preview/kubeblocks-for-elasticsearch/02-quickstart Operations: https://kubeblocks.io/docs/preview/kubeblocks-for-elasticsearch/04-operations/
Note: Backup and restore are not supported for Elasticsearch in KubeBlocks currently.
# Check if elasticsearch addon is installed
helm list -n kb-system | grep elasticsearch
# Install if missing
helm install kb-addon-elasticsearch kubeblocks/elasticsearch --namespace kb-system --version 1.0.0
| Topology | Value | Components | Use Case | |---|---|---|---| | Single-node | (default) | elasticsearch | Dev/test, one node handles all roles | | Multi-node | (default) | elasticsearch | Production, replicas > 1 |
Elasticsearch uses a single topology; the component name is elasticsearch. For single-node mode, set replicas: 1 and configure mode: "single-node" in configs. For production, use replicas: 3 or more.
| Major | serviceVersion Examples |
|---|---|
| 6.x | 6.8.23 |
| 7.x | 7.10.2, 7.10.1, 7.8.1, 7.7.1 |
| 8.x | 8.15.5, 8.8.2, 8.1.3 |
List available versions: kubectl get cmpv elasticsearch
- [ ] Step 1: Ensure addon is installed
- [ ] Step 2: Create namespace
- [ ] Step 3: Create cluster (single-node or multi-node)
- [ ] Step 4: Wait for cluster to be ready
- [ ] Step 5: Connect and verify
helm list -n kb-system | grep elasticsearch
If not found:
helm install kb-addon-elasticsearch kubeblocks/elasticsearch --namespace kb-system --version 1.0.0
kubectl create namespace demo --dry-run=client -o yaml | kubectl apply -f -
One node handles all roles (master, data, ingest). Suitable for development:
apiVersion: apps.kubeblocks.io/v1
kind: Cluster
metadata:
name: es-singlenode
namespace: demo
spec:
clusterDef: elasticsearch
terminationPolicy: Delete
componentSpecs:
- name: elasticsearch
serviceVersion: "8.8.2"
replicas: 1
configs:
- name: es-cm
variables:
mode: "single-node"
resources:
limits: {cpu: "1", memory: "2Gi"}
requests: {cpu: "1", memory: "2Gi"}
volumeClaimTemplates:
- name: data
spec:
accessModes: [ReadWriteOnce]
resources: {requests: {storage: 20Gi}}
Multiple replicas for high availability and shard distribution:
apiVersion: apps.kubeblocks.io/v1
kind: Cluster
metadata:
name: es-cluster
namespace: demo
spec:
clusterDef: elasticsearch
terminationPolicy: Delete
componentSpecs:
- name: elasticsearch
serviceVersion: "8.8.2"
replicas: 3
resources:
limits: {cpu: "1", memory: "2Gi"}
requests: {cpu: "1", memory: "2Gi"}
volumeClaimTemplates:
- name: data
spec:
accessModes: [ReadWriteOnce]
resources: {requests: {storage: 20Gi}}
Key points:
mode: "single-node" for multi-node clustersPer safety-patterns, always dry-run before apply:
kubectl apply -f cluster.yaml --dry-run=server
If dry-run succeeds:
kubectl apply -f cluster.yaml
kubectl -n demo get cluster <cluster-name> -w
Success condition: STATUS shows Running. Typical duration: 1–5 min. If not Running after 10 min, investigate:
kubectl describe cluster <cluster-name> -n demo
kubectl get events -n demo --sort-by='.lastTimestamp' | grep <cluster-name>
Check pods:
kubectl -n demo get pods -l app.kubernetes.io/instance=<cluster-name>
kubectl -n demo port-forward svc/<cluster-name>-elasticsearch-http 9200:9200
curl -s http://localhost:9200/_cluster/health?pretty
Expected: "status" : "green" or "yellow" (yellow is acceptable for single-node).
curl -s http://localhost:9200
Cluster stuck in Creating:
kubectl -n demo describe cluster <cluster-name>
kubectl -n demo get events --sort-by='.lastTimestamp'
Pod not starting:
kubectl -n demo logs <elasticsearch-pod>
kubectl -n demo describe pod <elasticsearch-pod>
Out of memory:
resources.limits.memory and resources.requests.memorySingle-node cluster in yellow:
Note: Backup and restore are not supported for Elasticsearch in KubeBlocks currently.
| Operation | Skill | External Docs | |---|---|---| | Stop / Start / Restart | cluster-lifecycle | Docs | | Scale CPU / Memory | vertical-scaling | Docs | | Add / Remove replicas | horizontal-scaling | Docs | | Expand storage | volume-expansion | Docs | | Expose externally | expose-service | Docs |
Follow safety-patterns.md for dry-run before apply, status confirmation after watch, and pre-deletion checklist.
devops
Expand persistent volume storage for KubeBlocks database clusters via OpsRequest. Requires the StorageClass to support volume expansion (allowVolumeExpansion=true). Use when the user needs more disk space, wants to increase storage, expand volumes, or resize PVCs. NOT for changing CPU/memory (see vertical-scaling) or adding more replicas (see horizontal-scaling). Note that volume shrinking is not supported by Kubernetes.
data-ai
Scale CPU and memory resources for KubeBlocks database clusters via OpsRequest (vertical scaling). Supports in-place updates when the feature gate is enabled. Use when the user wants to change, increase, decrease, resize, or adjust CPU or memory resources of a database cluster. NOT for adding/removing replicas or shards (see horizontal-scaling) or expanding disk storage (see volume-expansion).
data-ai
Upgrade the KubeBlocks operator itself via Helm. Covers update operator, upgrade to v1.0, update kubeblocks version, and CRD updates. Use when the user wants to upgrade KubeBlocks, update the operator, or upgrade to a new KubeBlocks release. NOT for upgrading database engine versions (see minor-version-upgrade).
development
Diagnostic guide for KubeBlocks-managed database clusters. Use when the user reports troubleshoot, debug, diagnose, not working, error, failed, stuck, CrashLoopBackOff, cluster exception, or similar problems with their database cluster. This skill guides the agent through diagnostic steps — it does NOT perform actions.