Helm:从图表依赖项安装单个 redis 实例

Helm: install single redis instance from chart dependency

Chart.yaml中我指定了依赖:

dependencies:
  - name: redis
    version: 15.0.3
    repository: https://charts.bitnami.com/bitnami

deployment.yaml中我指定服务:

apiVersion: v1
kind: Service
metadata:
  labels:
      app: redis
  name: redis-svc
spec:
  clusterIP: None
  ports:
  - port: 6355
  selector:
      app: redis

但是我在kubectl get all之后看到的是:

service/redis-svc               ClusterIP   None             <none>        6355/TCP   36s
statefulset.apps/myapp-redis-master     0/1     37s
statefulset.apps/myapp-redis-replicas   0/3     37s

我想要单个 redis 实例作为服务。我做错了什么?

独立redis需要设置参数:

architecture=standalone

例如命令式安装redis:

helm install my-redis-release -n default --set architecture=standalone bitnami/redis

Helm 支持将参数传递给依赖的子图表。您可以通过将此添加到 values.yaml 文件来覆盖 redis 子图表的架构。

redis:
  architecture: standalone