
redpandadata/redpanda-operatorRedpanda Operator 是 Redpanda 官方提供的 Kubernetes Operator,用于在 Kubernetes 集群中自动化管理 Redpanda 集群的全生命周期。该 Operator 基于 kubebuilder 框架构建,通过 Kubernetes CustomResourceDefinition (CRD) 提供声明式 API,简化 Redpanda 集群的部署、配置、扩展和维护流程。
bash# 添加 Redpanda Helm 仓库 helm repo add redpanda [***] helm repo update # 安装 Operator(指定命名空间) helm install redpanda-operator redpanda/redpanda-operator \ --namespace redpanda-operator \ --create-namespace
bash# 应用 CRD kubectl apply -f [***] # 部署 Operator 控制器 kubectl apply -f [***] -n redpanda-operator
创建 Redpanda 自定义资源(CR)定义集群配置,示例 redpanda-cluster.yaml:
yamlapiVersion: redpanda.vectorized.io/v1alpha1 kind: Redpanda metadata: name: redpanda-cluster namespace: redpanda spec: clusterSpec: replicas: 3 # 3节点集群 resources: requests: cpu: 2 memory: 4Gi limits: cpu: 4 memory: 8Gi storage: persistentVolumeClaim: spec: accessModes: ["ReadWriteOnce"] resources: requests: storage: 100Gi # 每个节点100Gi存储 configuration: kafkaApi: - port: 9092 # Kafka API端口 adminApi: - port: 9644 # 管理API端口
应用 CR 创建集群:
bashkubectl apply -f redpanda-cluster.yaml -n redpanda
Redpanda CR 的主要配置参数如下(详细参数见 官方文档):
| 参数路径 | 描述 | 默认值 |
|---|---|---|
spec.clusterSpec.replicas | 集群副本数(broker节点数量) | 1 |
spec.clusterSpec.resources | CPU/内存资源请求与限制 | 无 |
spec.clusterSpec.storage | 存储配置(支持PVC) | 无 |
spec.clusterSpec.image | Redpanda 镜像版本 | 最新稳定版 |
spec.clusterSpec.configuration | 服务配置(API端口、TLS、日志等) | 内置默认配置 |
部署 Operator 时可通过环境变量调整行为,常用变量:
| 环境变量名 | 描述 | 默认值 |
|---|---|---|
WATCH_NAMESPACE | 监控命名空间(为空则监控所有命名空间) | 部署所在命名空间 |
LOG_LEVEL | 日志级别(debug/info/warn/error) | info |
OPERATOR_NAME | Operator 标识名称 | redpanda-operator |


manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务