From 20c49f3609c6e48427ee87d7f44387491a6e8caf Mon Sep 17 00:00:00 2001 From: smiletan Date: Thu, 24 Apr 2025 14:28:16 +0800 Subject: [PATCH] helm operator add ddc --- Makefile | 4 -- helm-charts/doris-operator/Chart.yaml | 4 +- helm-charts/doris-operator/README.md | 49 ++++++++------- .../doris-operator/templates/_helpers.tpl | 13 ++-- .../doris-operator/templates/deployment.yaml | 4 +- .../mutatingWebhookConfiguration.yaml | 63 ------------------- .../validatingWebhookConfiguration.yaml | 63 ------------------- .../templates/webhook-secret.yaml | 25 -------- .../templates/webhook-service.yaml | 36 ----------- helm-charts/doris-operator/values.yaml | 28 +++++---- 10 files changed, 53 insertions(+), 236 deletions(-) delete mode 100644 helm-charts/doris-operator/templates/mutatingWebhookConfiguration.yaml delete mode 100644 helm-charts/doris-operator/templates/validatingWebhookConfiguration.yaml delete mode 100644 helm-charts/doris-operator/templates/webhook-secret.yaml delete mode 100644 helm-charts/doris-operator/templates/webhook-service.yaml diff --git a/Makefile b/Makefile index 12d5c008..d813d3fd 100644 --- a/Makefile +++ b/Makefile @@ -73,15 +73,11 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust $(CONTROLLER_GEN) rbac:roleName=manager-doris crd:generateEmbeddedObjectMeta=true webhook paths="./api/doris/..." output:crd:artifacts:config=config/crd/bases $(CONTROLLER_GEN) rbac:roleName=manager-doris crd:generateEmbeddedObjectMeta=true webhook paths="./api/doris/..." output:crd:artifacts:config=helm-charts/doris-operator/crds $(CONTROLLER_GEN) rbac:roleName=manager-doris crd:generateEmbeddedObjectMeta=true webhook paths="./api/disaggregated/..." output:crd:artifacts:config=config/crd/bases - #cat config/crd/bases/apps.foundationdb.org_foundationdbclusters.yaml > config/crd/bases/crds.yaml - #cat config/crd/bases/apps.foundationdb.org_foundationdbbackups.yaml >> config/crd/bases/crds.yaml - #cat config/crd/bases/apps.foundationdb.org_foundationdbrestores.yaml >> config/crd/bases/crds.yaml cp config/crd/bases/doris.selectdb.com_dorisclusters.yaml config/crd/bases/doris.apache.com_dorisclusters.yaml mv helm-charts/doris-operator/crds/doris.selectdb.com_dorisclusters.yaml helm-charts/doris-operator/crds/doris.apache.com_dorisclusters.yaml cat config/crd/bases/doris.selectdb.com_dorisclusters.yaml > config/crd/bases/crds.yaml cat config/crd/bases/disaggregated.cluster.doris.com_dorisdisaggregatedclusters.yaml >> config/crd/bases/crds.yaml - .PHONY: generate generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./api/doris/..." diff --git a/helm-charts/doris-operator/Chart.yaml b/helm-charts/doris-operator/Chart.yaml index 501e49fc..9da11edf 100644 --- a/helm-charts/doris-operator/Chart.yaml +++ b/helm-charts/doris-operator/Chart.yaml @@ -18,9 +18,7 @@ apiVersion: v2 name: doris-operator description: > - Kubernetes operator for creating, configuring and managing Doris clusters (dcr) and Doris disaggregated clusters - (ddc). It can deploy and manage all components for Doris clusters: meta service, fe, be, cn, compute group, and - broker. + Doris Operator for creating, configuring and managing Doris clusters (dcr) and Doris disaggregated clusters (ddc). icon: https://charts.selectdb.com/images/doris.jpg diff --git a/helm-charts/doris-operator/README.md b/helm-charts/doris-operator/README.md index 43565cfe..ba5a4232 100644 --- a/helm-charts/doris-operator/README.md +++ b/helm-charts/doris-operator/README.md @@ -1,6 +1,13 @@ # Deploy Doris-Operator by Helm-Chart -[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/doris)](https://artifacthub.io/packages/search?repo=doris) +[![Doris repo](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/doris)](https://github.com/apache/doris) +[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg?color=f5deb3)](https://www.apache.org/licenses/LICENSE-2.0.html) +[![Operator Release](https://img.shields.io/github/v/release/apache/doris-operator?color=00FFFF)](https://github.com/apache/doris-operator/releases) +[![Tags](https://img.shields.io/github/v/tag/apache/doris-operator?label=latest%20tag&color=00FF7F)](https://github.com/apache/doris-operator/tags) +[![docker pull](https://img.shields.io/docker/pulls/apache/doris?color=1E90FF&logo=docker)](https://img.shields.io/docker/pulls/apache/doris) +[![issues](https://img.shields.io/github/issues-search?query=repo%3Aapache%2Fdoris-operator%20is%3Aopen&color=AFEEEE&label=issues)](https://github.com/apache/doris-operator/issues) +[![Go Version](https://img.shields.io/github/go-mod/go-version/apache/doris-operator?color=00FFFF)](https://img.shields.io/github/go-mod/go-version/apache/doris-operator) +[![docs](https://img.shields.io/website?url=https%3A%2F%2Fdoris.apache.org%2Fdocs%2Finstall%2Fdeploy-on-kubernetes%2Finstall-config-cluster&label=docs&color=7FFF00)](https://doris.apache.org/docs/install/deploy-on-kubernetes/install-config-cluster) Doris-Operator is plugins of Kubernetes controller for providing doris to user. Doris-Operator be build with [Kubebuilder](https://github.com/kubernetes-sigs/kubebuilder). This helm-chart deploy [doris-operator](https://github.com/selectdb/doris-operator) on Kubernetes. ## Install doris-operator @@ -9,44 +16,44 @@ Doris-Operator is plugins of Kubernetes controller for providing doris to user. This helm chart have resources about RBAC , deployment ...etc for doris-operator running. -1. Add the selectdb repository +1. Add the selectdb repository ```Bash - $ helm repo add selectdb https://charts.selectdb.com + helm repo add selectdb https://charts.selectdb.com ``` -2. Update the Helm Chart Repo to the latest version +2. Update the Helm Chart Repo to the latest version ```Bash $ helm repo update selectdb ``` -3. Check the Helm Chart Repo is the latest version +3. Check the Helm Chart Repo is the latest version ```Bash - $ helm search repo selectdb + helm search repo selectdb NAME CHART VERSION APP VERSION DESCRIPTION selectdb/doris-operator 1.3.1 1.3.1 Doris-operator for doris creat ... selectdb/doris 1.3.1 2.0.3 Apache Doris is an easy-to-use ... ``` ### Install the doris-operator -- Install doris-operator with default config in a namespace named `doris` - ```Bash - $ helm install operator selectdb/doris-operator - ``` -- The repo defines the basic function for running doris-operator, Please use next command to deploy doris-operator, when you have completed customization of [`values.yaml`](./values.yaml) - ```Bash - $ helm install -f values.yaml operator selectdb/doris-operator - ``` +- Install doris-operator in `doris` namespace using the default config: + ```Bash + helm install operator selectdb/doris-operator --create-namespace -n doris + ``` +- Custom the values.yaml, use the follow command to deploy: + ```Bash + helm install -f values.yaml operator selectdb/doris-operator --create-namespace -n doris + ``` ### Validate installation Status Check the deployment status of Pods through the kubectl get pods command. Observe that the Pod of doris-operator is in the Running state and all containers in the Pod are ready, that means, the deployment is successful. - ```Bash - $ kubectl get pod --namespace doris - NAME READY STATUS RESTARTS AGE - doris-operator-866bd449bb-zl5mr 1/1 Running 0 18m - ``` +```Bash +kubectl get pod --namespace doris +NAME READY STATUS RESTARTS AGE +doris-operator-866bd449bb-zl5mr 1/1 Running 0 18m +``` ## Uninstall doris-operator -Please confirm that Doris is not running in Kubernetes, use next command to uninstall `doris-operator`. +Please confirm that Doris is not used in Kubernetes, and the data in doris is not valued, use the follow command to uninstall. ```Bash -$ helm uninstall operator +helm -n doris uninstall operator ``` diff --git a/helm-charts/doris-operator/templates/_helpers.tpl b/helm-charts/doris-operator/templates/_helpers.tpl index edf03397..38ca5e1f 100644 --- a/helm-charts/doris-operator/templates/_helpers.tpl +++ b/helm-charts/doris-operator/templates/_helpers.tpl @@ -36,7 +36,7 @@ {{/* doris operator pod default resource. */}} -{{- define "operator.default.resource" }} +{{- define "operator.default.resources" }} requests: cpu: 2 memory: 4Gi @@ -46,16 +46,15 @@ doris operator pod default resource. {{- end }} {{/* -doris operator webhook open. +cancle webhook set, webhook is deprecated. */}} {{- define "webhook.enable" -}} -{{ default "false" .Values.dorisOperator.enableWebhook }} -{{- end -}} - +{{- print "false" }} +{{- end }} {{/* -doris operator webhook service name. +doris operator service name. */}} -{{- define "webhook.serviceName" }} +{{- define "operator.serviceName" }} {{- print "doris-operator-service" }} {{- end }} diff --git a/helm-charts/doris-operator/templates/deployment.yaml b/helm-charts/doris-operator/templates/deployment.yaml index 33566d38..faf9fee7 100644 --- a/helm-charts/doris-operator/templates/deployment.yaml +++ b/helm-charts/doris-operator/templates/deployment.yaml @@ -105,7 +105,7 @@ spec: fieldRef: fieldPath: metadata.name - name: SERVICE_NAME - value: {{ template "webhook.serviceName" . }} + value: {{ template "operator.serviceName" . }} livenessProbe: httpGet: path: /healthz @@ -121,7 +121,7 @@ spec: # TODO(user): Configure the resources accordingly based on the project requirements. # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ resources: - {{- include "operator.default.resource" . | indent 8 }} + {{- include "operator.default.resources" . | indent 8 }} volumeMounts: - mountPath: /tmp/k8s-webhook-server/serving-certs name: cert diff --git a/helm-charts/doris-operator/templates/mutatingWebhookConfiguration.yaml b/helm-charts/doris-operator/templates/mutatingWebhookConfiguration.yaml deleted file mode 100644 index bd023d5e..00000000 --- a/helm-charts/doris-operator/templates/mutatingWebhookConfiguration.yaml +++ /dev/null @@ -1,63 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: admissionregistration.k8s.io/v1 -kind: MutatingWebhookConfiguration -metadata: - creationTimestamp: null - name: doris-operator-mutate-webhook -webhooks: - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: {{ template "webhook.serviceName" . }} - namespace: {{ template "operator.namespace" . }} - path: /mutate-doris-selectdb-com-v1-doriscluster - failurePolicy: Ignore - name: mdoriscluster.kb.io - rules: - - apiGroups: - - doris.selectdb.com - apiVersions: - - v1 - operations: - - CREATE - - UPDATE - resources: - - dorisclusters - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: {{ template "webhook.serviceName" . }} - namespace: {{ template "operator.namespace" . }} - path: /mutate-disaggregated-cluster-doris-com-v1-dorisdisaggregatedcluster - failurePolicy: Ignore - name: mdorisdisaggregatedcluster.kb.io - rules: - - apiGroups: - - disaggregated.cluster.doris.com - apiVersions: - - v1 - operations: - - CREATE - - UPDATE - resources: - - dorisdisaggregatedclusters - sideEffects: None diff --git a/helm-charts/doris-operator/templates/validatingWebhookConfiguration.yaml b/helm-charts/doris-operator/templates/validatingWebhookConfiguration.yaml deleted file mode 100644 index 6fa75d89..00000000 --- a/helm-charts/doris-operator/templates/validatingWebhookConfiguration.yaml +++ /dev/null @@ -1,63 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: admissionregistration.k8s.io/v1 -kind: ValidatingWebhookConfiguration -metadata: - creationTimestamp: null - name: doris-operator-validate-webhook -webhooks: - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: {{ template "webhook.serviceName" . }} - namespace: {{ template "operator.namespace" . }} - path: /validate-doris-selectdb-com-v1-doriscluster - failurePolicy: Ignore - name: vdoriscluster.kb.io - rules: - - apiGroups: - - doris.selectdb.com - apiVersions: - - v1 - operations: - - CREATE - - UPDATE - resources: - - dorisclusters - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: {{ template "webhook.serviceName" . }} - namespace: {{ template "operator.namespace" . }} - path: /validate-disaggregated-cluster-doris-com-v1-dorisdisaggregatedcluster - failurePolicy: Ignore - name: vdorisdisaggregatedcluster.kb.io - rules: - - apiGroups: - - disaggregated.cluster.doris.com - apiVersions: - - v1 - operations: - - CREATE - - UPDATE - resources: - - dorisdisaggregatedclusters - sideEffects: None diff --git a/helm-charts/doris-operator/templates/webhook-secret.yaml b/helm-charts/doris-operator/templates/webhook-secret.yaml deleted file mode 100644 index 83e9b4ac..00000000 --- a/helm-charts/doris-operator/templates/webhook-secret.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: v1 -kind: Secret -metadata: - name: doris-operator-secret-cert - namespace: {{ template "operator.namespace" . }} - labels: - control-plane: {{ template "kube-doris.name" . }}-operator - app.kubernetes.io/instance: {{ template "kube-doris.name" . }}-operator \ No newline at end of file diff --git a/helm-charts/doris-operator/templates/webhook-service.yaml b/helm-charts/doris-operator/templates/webhook-service.yaml deleted file mode 100644 index b787513a..00000000 --- a/helm-charts/doris-operator/templates/webhook-service.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apiVersion: v1 -kind: Service -metadata: - labels: - app.kubernetes.io/created-by: {{ template "kube-doris.name" . }}-operator - app.kubernetes.io/part-of: {{ template "kube-doris.name" . }}-operator - name: {{ template "webhook.serviceName" . }} - namespace: {{ template "operator.namespace" . }} -spec: - ports: - - name: https - port: 443 - targetPort: 9443 - selector: - control-plane: doris-operator - app.kubernetes.io/name: deployment - app.kubernetes.io/instance: {{ template "kube-doris.name" . }}-operator - app.kubernetes.io/created-by: {{ template "kube-doris.name" . }}-operator - app.kubernetes.io/part-of: {{ template "kube-doris.name" . }}-operator \ No newline at end of file diff --git a/helm-charts/doris-operator/values.yaml b/helm-charts/doris-operator/values.yaml index 17f1ff46..7d09c1aa 100644 --- a/helm-charts/doris-operator/values.yaml +++ b/helm-charts/doris-operator/values.yaml @@ -15,27 +15,32 @@ # specific language governing permissions and limitations # under the License. -# Default values for operator. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. dorisOperator: - # the namespace of dorisoperator, if not set, the release namespace will be used. + # the namespace of doris operator deployed, is not provided be set in values.yaml, please use the helm command specify, example "helm install -n doris" image: repository: apache/doris tag: operator-latest - imagePullPolicy: "" - # ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this deployment. - # If specified, these secrets will be passed to individual puller implementations for them to use. - # imagePullSecret: "my-registry-key" - # Map of nodeSelectors to match when scheduling pods on nodes + imagePullSecret: "" + # ImagePullSecret specify the secret that record the credentials, if the repository of image is private. example as follows: + # imagePullSecret: "my-registry-key" + imagePullPolicy: "Always" + # imagePullPolicy nodeSelector: {} + # specify a class nodes to have the operator pod. # kubernetes.io/arch: amd64 # kubernetes.io/os: linux # app.kubernetes.node.name: "k8s-node1" - - # node affinity for operator pod scheduling. + resources: {} + # resources used to specify compute resources, default is 2c 4Gi, the resource follow k8s requests and limits config.(https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) + # requests: + # memory: "4Gi" + # cpu: 4 + # limits: + # memory: "4Gi" + # cpu: 4 nodeAffinity: {} + # node affinity for operator pod scheduling. # requiredDuringSchedulingIgnoredDuringExecution: # nodeSelectorTerms: # - matchFields: @@ -43,4 +48,3 @@ dorisOperator: # operator: In # values: # - target-host-name - enableWebhook: false