Install ECK using the Helm chart
Starting from ECK 1.3.0, a Helm chart is available to install ECK. It is available from the Elastic Helm repository and can be added to your Helm repository list by running the following command:
从 ECK 1.3.0 开始,可以使用 Helm 来安装 ECK。它可以从 Elastic Helm 仓库获得,并且可以通过运行以下命令添加到 Helm 仓库列表中:
helm repo add elastic https://helm.elastic.co helm repo update
The minimum supported version of Helm is 3.2.0.
Helm 的最小支持版本是3.2.0。
一、Cluster-wide(global)installation
This is the default mode of installation and is equivalent to installing ECK using the stand-alone YAML manifests(https://www.cnblogs.com/zuoyang/p/17366871.html).
这是默认的安装模式,相当于使用独立的 YAML 清单安装 ECK。
helm install elastic-operator elastic/eck-operator -n elastic-system --create-namespace
二、Restricted installation
This mode avoids installing any cluster-scoped resources and restricts the operator to manage only a set of pre-defined namespaces.
此模式避免安装任何集群范围的资源,并限制操作员只能管理一组预定义的命名空间。
Since CRDs are global resources, they still need to be installed by an administrator. This can be achieved by:
由于 CRD 是全球资源,因此仍需由管理员安装:
helm install elastic-operator-crds elastic/eck-operator-crds
The operator can be installed by any user who has full access to the set of namespaces they wish to manage. The following example installs the operator to elastic-system
namespace and configures it to manage only namespace-a
and namespace-b
:
任何用户只要能够完全访问他们希望管理的命名空间集,就可以安装该运算符。下面的示例将运算符安装到弹性系统命名空间,并将其配置为仅管理命名空间 -a 和命名空间 -b:
helm install elastic-operator elastic/eck-operator -n elastic-system --create-namespace \ --set=installCRDs=false \ --set=managedNamespaces='{namespace-a, namespace-b}' \ --set=createClusterScopedResources=false \ --set=webhook.enabled=false \ --set=config.validateStorageClass=false
The eck-operator
chart contains several pre-defined profiles to help you install the operator in different configurations. These profiles can be found in the root of the chart directory, prefixed with profile-
. For example, the restricted configuration illustrated in the previous code extract is defined in the profile-restricted.yaml
file, and can be used as follows:
Eck 操作符图表包含几个预定义的配置文件,以帮助您以不同的配置安装操作符。这些配置文件可以在图表目录的根目录中找到,前缀为 profile-。例如,在前面的代码提取中说明的受限制配置在概要文件限制中定义。Yaml 文件,可用于以下方面:
helm install elastic-operator elastic/eck-operator -n elastic-system --create-namespace \ --values="${CHART_DIR}/profile-restricted.yaml" \ --set=managedNamespaces='{namespace-a, namespace-b}'
You can find the profile files in the Helm cache directory or from the ECK source repository.
您可以在 Helm 缓存目录或 ECK 源存储库中找到配置文件。
三、View available configuration options
You can view all configurable values by running the following:
helm show values elastic/eck-operator
You can migrate an existing operator installation to Helm by adding the meta.helm.sh/release-name
, meta.helm.sh/release-namespace
annotations and the app.kubernetes.io/managed-by
label to all the resources you want to be adopted by Helm. You must do this for the Elastic Custom Resource Definitions (CRD) because deleting them would trigger the deletion of all deployed Elastic applications as well. All other resources are optional and can be deleted.
你可以通过添加 meta.Helm.sh/release-name、 meta.Helm.sh/release-namespace 注释和 app.kubernetes.io/managed-by 标签将现有的操作员安装迁移到 Helm。您必须为弹性自定义资源定义(CRD)这样做,因为删除它们也会触发所有已部署的弹性应用程序的删除。所有其他资源都是可选的,可以删除。
A shell script is available in the ECK source repository to demonstrate how to migrate from version 1.7.1 to Helm. You can modify it to suit your own environment.
ECK 源代码库中提供了一个 shell 脚本来演示如何从版本1.7.1迁移到 Helm。您可以修改它以适应您自己的环境。
For example, an ECK 1.2.1 installation deployed using the quickstart guide can be migrated to Helm as follows:
例如,使用 Quick start 指南部署的 ECK 1.2.1安装可以迁移到 Helm,如下所示:
-
Annotate and label all the ECK CRDs with the appropriate Helm annotations and labels. CRDs need to be preserved to retain any existing Elastic applications deployed using the operator.
使用适当的 Helm 注释和标签对所有 ECK CRD 进行注释和标签。需要保留 CRD,以保留使用操作符部署的任何现有 Elastic 应用程序。
for CRD in $(kubectl get crds --no-headers -o custom-columns=NAME:.metadata.name | grep k8s.elastic.co); do kubectl annotate crd "$CRD" meta.helm.sh/release-name="$RELEASE_NAME" kubectl annotate crd "$CRD" meta.helm.sh/release-namespace="$RELEASE_NAMESPACE" kubectl label crd "$CRD" app.kubernetes.io/managed-by=Helm done
-
Uninstall the current ECK operator. You can do this by taking the
operator.yaml
file you used to install the operator and runningkubectl delete -f operator.yaml
. Alternatively, you could delete each resource individually.卸载当前 ECK 操作员。为此,可以使用用于安装操作符的 operator.yaml 文件并运行 kubectl delete-f operator.yaml。或者,您可以单独删除每个资源。
kubectl delete -n elastic-system \ serviceaccount/elastic-operator \ secret/elastic-webhook-server-cert \ clusterrole.rbac.authorization.k8s.io/elastic-operator \ clusterrole.rbac.authorization.k8s.io/elastic-operator-view \ clusterrole.rbac.authorization.k8s.io/elastic-operator-edit \ clusterrolebinding.rbac.authorization.k8s.io/elastic-operator \ service/elastic-webhook-server \ configmap/elastic-operator \ statefulset.apps/elastic-operator \ validatingwebhookconfiguration.admissionregistration.k8s.io/elastic-webhook.k8s.elastic.co
If you have previously customized the operator configuration in this ConfigMap, you will have to repeat the configuration once the operator has been reinstalled in the next step.
如果您以前已经在这个 ConfigMap 中定制了操作符配置,那么在下一步中重新安装操作符之后,您必须重复这个配置。
- Install the ECK operator using the Helm chart as described in Install ECK using the Helm chart.
- 使用 Helm 图表安装 ECK 操作员,如使用 Helm 图表安装 ECK 中所述。
标签:elastic,namespace,精讲,helm,ECK,Helm,Elasticsearch,operator From: https://www.cnblogs.com/zuoyang/p/17366962.html