创建 Helm 部署 values.yaml 文件

您将创建一个包含 Neo4j 独立实例所有配置的 Helm 部署 YAML 文件。

重要配置参数

neo4j.name

从 Neo4j 5.0.0 开始,独立服务器和集群服务器没有区别。这意味着可以通过添加更多服务器将独立服务器升级为集群。因此,neo4j.name 参数(其值将集群中的服务器链接在一起)是强制性的,如果未指定该参数,安装将失败。neo4j.name 在命名空间内必须是唯一的。

neo4j.resources

Neo4j 实例的大小由 neo4j.resources.cpuneo4j.resources.memory 参数的值定义。最小值为 0.5 CPU 和 2GB 内存。如果提供的值无效或小于最小值,Helm 将抛出错误,例如

Error: template: neo4jtemplates/_helpers.tpl:157:11: executing "neo4j.resources.evaluateCPU" at <fail (printf "Provided cpu value %s is less than minimum. \n %s" (.Values.neo4j.resources.cpu) (include "neo4j.resources.invalidCPUMessage" .))>: error calling fail: Provided cpu value 0.25 is less than minimum.
 cpu value cannot be less than 0.5 or 500m

有关更多信息,请参阅 配置资源分配

neo4j.password

neo4j 用户的密码。
如果您未提供密码,Neo4j Helm 图表将自动为您生成一个密码。(请记下它。)

您不能使用 neo4j 作为初始密码,因为这是默认密码。

neo4j.editionneo4j.acceptLicenseAgreement

默认情况下,独立 Helm 图表安装 Neo4j 社区版。
如果您要安装 Neo4j 企业版,请设置配置参数 edition: "enterprise" 并通过将 neo4j.acceptLicenseAgreement 设置为 "yes"(如果您有有效许可证)或 "eval"(如果您要接受 Neo4j 评估许可证)来确认许可证合规性。
有关如何获取 Neo4j 企业版的有效许可证的更多信息,请参阅 https://neo4j.ac.cn/licensing/ 和链接:https://neo4j.ac.cn/terms/licensing/,或使用表格 联系 Neo4j

volumes.data

volumes.data 参数将 Neo4j 的 data 卷挂载映射到该实例的持久卷。有关更多信息,请参见 卷挂载和持久卷

有关所有 Neo4j Helm 图表配置选项的详细信息,请参见 配置 Neo4j Helm 部署

创建 values.yaml 文件

根据您的 Kubernetes 环境选择标签,并使用提供的示例为您的独立实例创建 YAML 文件。

本指南假设 YAML 文件名为 my-neo4j.values.yaml

neo4j:
  name: my-standalone
  resources:
    cpu: "0.5"
    memory: "2Gi"

  # Uncomment to set the initial password
  #password: "my-initial-password"

  # Uncomment to use enterprise edition
  #edition: "enterprise"
  #acceptLicenseAgreement: "yes"

volumes:
  data:
    mode: "dynamic"
    dynamic:
      # In GKE;
      # * premium-rwo provisions SSD disks (recommended)
      # * standard-rwo provisions balanced SSD-backed disks
      # * standard provisions HDD disks
      storageClassName: premium-rwo
neo4j:
  name: my-standalone
  resources:
    cpu: "0.5"
    memory: "2Gi"

  # Uncomment to set the initial password
  #password: "my-initial-password"

  # Uncomment to use enterprise edition
  #edition: "enterprise"
  #acceptLicenseAgreement: "yes"

volumes:
  data:
    mode: "dynamic"
    dynamic:
     # gp2 is a general-purpose SSD volume
     storageClassName: gp2
neo4j:
  name: my-standalone
  resources:
    cpu: "0.5"
    memory: "2Gi"

  # Uncomment to set the initial password
  #password: "my-initial-password"

  # Uncomment to use enterprise edition
  #edition: "enterprise"
  #acceptLicenseAgreement: "yes"

volumes:
  data:
    mode: "dynamic"
    dynamic:
      # * managed-csi-premium provisions premium SSD disks (recommended)
      # * managed-csi provisions standard SSD-backed disks
      storageClassName: managed-csi-premium
neo4j:
  name: my-standalone
  resources:
    cpu: "0.5"
    memory: "2Gi"

  # Uncomment to set the initial password
  #password: "my-initial-password"

  # Uncomment to use enterprise edition
  #edition: "enterprise"
  #acceptLicenseAgreement: "yes"

volumes:
  data:
    mode: defaultStorageClass
    defaultStorageClass:
      requests:
        storage: 2Gi