跳到主要内容
版本:3.12.0

自定义安装配置

本文将介绍如何在安装 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.imagevesoft/nebula-operator:v1.8.0NebulaGraph Operator 的镜像,版本为1.8.0。
image.nebulaOperator.imagePullPolicyIfNotPresent镜像拉取策略。
imagePullSecrets[]镜像拉取密钥,例如imagePullSecrets[0].name="vesoft"
kubernetesClusterDomaincluster.local集群域名。
controllerManager.createtrue是否启用 controller-manager。
controllerManager.replicas2controller-manager 副本数。
controllerManager.env[]配置环境变量。
controllerManager.extraInitContainers[]配置初始化容器。
controllerManager.sidecarContainers{}配置 sidecar 容器。
controllerManager.extraVolumes[]配置存储卷。
controllerManager.extraVolumeMounts[]配置存储卷挂载路径。
controllerManager.securityContext{}配置访问和控制 NebulaGraph Operator 的操作。
admissionWebhook.createfalse是否启用 Admission Webhook。默认关闭,如需开启,需设置为true并且需要安装 cert-manager。详情参见开启准入控制
admissionWebhook.webhookBindPort9443Webhook 服务器监听和接受传入请求的端口,默认 9443。
scheduler.createtrue是否启用 Scheduler。
scheduler.schedulerNamenebula-schedulerNebulaGraph Operator 自定义的调度器名称。
scheduler.replicas2nebula-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