跳转至

自定义安装配置

本文将介绍如何在安装 NebulaGraph Operator 时自定义默认配置项。

配置项

在执行helm install [NAME] [CHART] [flags]命令安装 Chart 时,可指定 Chart 配置。更多信息,请参考安装前自定义 Chart

用户可以在 nebula-operator chart 配置文件中查看相关的配置选项。

或者执行命令helm show values nebula-operator/nebula-operator查看可配置的选项,返回结果如下。

[root@master ~]$ helm show values nebula-operator/nebula-operator   
image:
  nebulaOperator:
    image: vesoft/nebula-operator:v1.8.0
    imagePullPolicy: Always

imagePullSecrets: [ ]
kubernetesClusterDomain: ""

controllerManager:
  create: true
  replicas: 2
  env: [ ]
  resources:
    limits:
      cpu: 200m
      memory: 200Mi
    requests:
      cpu: 100m
      memory: 100Mi
  verbosity: 0
  ## Additional InitContainers to initialize the pod
  # Example:
  #  extraInitContainers:
  #  - name: init-auth-sidecar
  #    command:
  #    - /bin/sh
  #    - -c
  #    args:
  #    - cp -R /certs/* /credentials/
  #    imagePullPolicy: Always
  #    image: reg.vesoft-inc.com/nebula-certs:latest
  #    volumeMounts:
  #    - name: credentials
  #      mountPath: /credentials
  extraInitContainers: []

  # sidecarContainers - add more containers to controller-manager
  # Key/Value where Key is the sidecar `- name: <Key>`
  # Example:
  #   sidecarContainers:
  #      webserver:
  #        image: nginx
  # OR for adding netshoot to controller manager
  #  sidecarContainers:
  #    netshoot:
  #      args:
  #      - -c
  #      - while true; do ping localhost; sleep 60;done
  #      command:
  #      - /bin/bash
  #      image: nicolaka/netshoot
  #      imagePullPolicy: Always
  #      name: netshoot
  #      resources: {}
  sidecarContainers: {}

  ## Additional controller-manager Volumes
  extraVolumes: []

  ## Additional controller-manager Volume mounts
  extraVolumeMounts: []

  securityContext: {}
  #  runAsNonRoot: true

admissionWebhook:
  create: false
  # The TCP port the Webhook server binds to. (default 9443)
  webhookBindPort: 9443

scheduler:
  create: true
  schedulerName: nebula-scheduler
  replicas: 2
  env: [ ]
  resources:
    limits:
      cpu: 200m
      memory: 200Mi
    requests:
      cpu: 100m
      memory: 100Mi
  verbosity: 0
  plugins:
    enabled: ["NodeZone"]
    disabled: [] # only in-tree plugins need to be defined here
...

部分参数描述如下:

参数 默认值 描述
image.nebulaOperator.image vesoft/nebula-operator:v1.8.0 NebulaGraph Operator 的镜像,版本为1.8.0。
image.nebulaOperator.imagePullPolicy IfNotPresent 镜像拉取策略。
imagePullSecrets [] 镜像拉取密钥,例如imagePullSecrets[0].name="vesoft"
kubernetesClusterDomain cluster.local 集群域名。
controllerManager.create true 是否启用 controller-manager。
controllerManager.replicas 2 controller-manager 副本数。
controllerManager.env [] 配置环境变量。
controllerManager.extraInitContainers [] 配置初始化容器。
controllerManager.sidecarContainers {} 配置 sidecar 容器。
controllerManager.extraVolumes [] 配置存储卷。
controllerManager.extraVolumeMounts [] 配置存储卷挂载路径。
controllerManager.securityContext {} 配置访问和控制 NebulaGraph Operator 的操作。
admissionWebhook.create false 是否启用 Admission Webhook。默认关闭,如需开启,需设置为true并且需要安装 cert-manager。详情参见开启准入控制
admissionWebhook.webhookBindPort 9443 Webhook 服务器监听和接受传入请求的端口,默认 9443。
scheduler.create true 是否启用 Scheduler。
scheduler.schedulerName nebula-scheduler NebulaGraph Operator 自定义的调度器名称。
scheduler.replicas 2 nebula-scheduler 副本数。

示例

以下示例为在安装 NebulaGraph Operator 时,指定 NebulaGraph Operator 的 AdmissionWebhook 机制为开启状态(默认关闭 AdmissionWebhook):

helm install nebula-operator nebula-operator/nebula-operator --namespace=<nebula-operator-system> --set admissionWebhook.create=true

验证是否开启 AdmissionWebhook:

helm get values nebula-operator -n <nebula-operator-system>

示例输出:

USER-SUPPLIED VALUES:
admissionWebhook:
  create: true

关于helm install命令更多信息, 参见 Helm Install


最后更新: September 6, 2024