
该Docker镜像基于Elasticsearch Curator 5.6.0版本构建,用于管理Elasticsearch索引。通过环境变量配置Elasticsearch凭证,支持执行索引生命周期管理操作,如删除旧索引、关闭指定索引等,适用于需要定期维护Elasticsearch索引的场景。
ConfigMap配置
用于存储Curator的配置文件和操作策略,示例如下:
yamlapiVersion: v1 kind: ConfigMap metadata: name: curator-config namespace: logz labels: k8s-app: curator data: curator.yml.sample: |- client: hosts: - "https://{{ELASTIC_URL}}" port: url_prefix: use_ssl: False certificate: client_cert: client_key: ssl_no_validate: False http_auth: "{{ELASTIC_USER}}:{{ELASTIC_PASSWORD}}" timeout: 30 master_only: False logging: loglevel: INFO logfile: logformat: default blacklist: ['elasticsearch', 'urllib3'] curator-actions.yml: |- # 删除60天以上的索引,关闭30天以上的索引 actions: 1: action: delete_indices description: >- 删除60天以上的索引(匹配'^index_pattern-01-|^index_pattern-02-'模式) options: ignore_empty_list: True disable_action: False continue_if_exception: False filters: - filtertype: pattern kind: regex value: '^index_pattern-01-|^index_pattern-02-' - filtertype: age source: name direction: older timestring: '%Y.%m.%d' unit: days unit_count: 60 2: action: close description: >- 关闭30天以上的索引(匹配'^index_pattern-01-|^index_pattern-02-'模式) options: delete_aliases: False ignore_empty_list: True continue_if_exception: False disable_action: False filters: - filtertype: pattern kind: regex value: '^index_pattern-01-|^index_pattern-02-' - filtertype: age source: name direction: older timestring: '%Y.%m.%d' unit: days unit_count: 30
CronJob部署示例
在Kubernetes中部署为CronJob,定期执行索引管理任务:
yamlapiVersion: batch/v1beta1 # API服务器版本 >= 1.8.0时使用batch/v1beta1 kind: CronJob metadata: name: curator labels: app: curator spec: schedule: "5 1 15 * *" # 每月15日1:05(通常为UTC时间)执行 successfulJobsHistoryLimit: 1 failedJobsHistoryLimit: 3 concurrencyPolicy: Forbid startingDeadlineSeconds: 120 jobTemplate: spec: template: spec: securityContext: runAsUser: 1000 fsGroup: 1000 containers: - image: docker.io/juanmatias/elasticsearch-curator:5.6.0 securityContext: runAsUser: 1000 imagePullPolicy: Always name: curator command: ["/bin/sh","-c","'/curator/bootup.sh'"] volumeMounts: - mountPath: /curator/config name: curator-config env: - name: CLOUD_ID valueFrom: secretKeyRef: name: elasticsearch-credentials-secret key: cloudid - name: ELASTIC_URL valueFrom: secretKeyRef: name: elasticsearch-credentials-secret key: url - name: ELASTIC_USER valueFrom: secretKeyRef: name: elasticsearch-credentials-secret key: user - name: ELASTIC_PASSWORD valueFrom: secretKeyRef: name: elasticsearch-credentials-secret key: password restartPolicy: OnFailure volumes: - name: curator-config configMap: name: curator-config
CLOUD_ID:Elasticsearch Cloud ID(从Kubernetes Secret获取)ELASTIC_URL:Elasticsearch服务URL(从Kubernetes Secret获取)ELASTIC_USER:Elasticsearch访问用户名(从Kubernetes Secret获取)ELASTIC_PASSWORD:Elasticsearch访问密码(从Kubernetes Secret获取)默认调度时间为每月15日1:05(UTC时间),可通过修改CronJob的schedule字段调整执行频率。





探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务