Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile_doris_debug
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ WORKDIR /workspace
COPY . .

RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o doris-debug cmd/doris-debug/main.go
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o dorisctl cmd/dorisctl/main.go

FROM ubuntu:22.04

WORKDIR /

COPY --from=builder /workspace/doris-debug .

COPY --from=builder /workspace/dorisctl .

2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ endif
.PHONY: build
build: manifests generate fmt vet helm ## Build manager binary.
go build -ldflags=$(LDFLAGS) -o bin/dorisoperator cmd/operator/main.go
go build -ldflags=$(LDFLAGS) -o bin/dorisctrl cmd/dorisctl/main.go
go build -o bin/doris-debug cmd/doris-debug/main.go

.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
Expand Down
2 changes: 1 addition & 1 deletion api/disaggregated/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ type FeSpec struct {

// ComputeGroup describe the specification that a group of compute node.
type ComputeGroup struct {
//the unique identifier of compute group, first register in fe will use UniqueId as cluster name.
//the unique identifier of compute group, first register in fe will use UniqueId as compute group name.
UniqueId string `json:"uniqueId"`

// EnableWorkloadGroup is a switch that determines whether the doris cluster enables the workload group.
Expand Down
20 changes: 20 additions & 0 deletions api/disaggregated/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions cmd/dorisctl/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// 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.
package main

import (
"fmt"
"github.com/apache/doris-operator/cmd/dorisctl/root_command"
"os"
)

func main() {

cmd, err := root_command.NewDorisctlCommand(os.Stdout)
if err != nil {
fmt.Println("new dorisctl failed," + err.Error())
os.Exit(1)
}
if err := cmd.Execute(); err != nil {
fmt.Println("command execute failed, " + err.Error())
os.Exit(1)
}
}
54 changes: 54 additions & 0 deletions cmd/dorisctl/root_command/cmd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// 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.
package root_command

import (
"github.com/apache/doris-operator/pkg/common/cmd/get"
"github.com/apache/doris-operator/pkg/common/cmd/templates"
cmdutil "github.com/apache/doris-operator/pkg/common/cmd/util"
"github.com/spf13/cobra"
"io"
)

func NewDorisctlCommand(out io.Writer) (*cobra.Command, error) {
cmds := &cobra.Command{
Use: "dorisctl",
Short: "dorisctl controls the doris cluster manager",
Long: templates.LongDesc(`
dorisctl controls the doris cluster manager.
`),
}

var dc cmdutil.DorisConfig

flags := cmds.PersistentFlags()
flags.StringVar(&dc.FeHost, "fe-host", "", "The fe access address.")
flags.StringVar(&dc.User, "user", "", "The name of user to access doris.")
flags.StringVar(&dc.Password, "password", "", "The password of login in doris.")
flags.IntVar(&dc.QueryPort, "query-port", 9030, "The FE mysql protocol listen port")
groups := templates.CommandGroups{
{
Message: "Basic Commands (Beginner):",
Commands: []*cobra.Command{
get.NewCmdGet("dorisctl", &dc, out),
},
},
}

groups.Add(cmds)
return cmds, nil
}
39 changes: 35 additions & 4 deletions config/crd/bases/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10386,6 +10386,14 @@ spec:
type: string
type: object
type: object
enableWorkloadGroup:
description: |-
EnableWorkloadGroup is a switch that determines whether the doris cluster enables the workload group.
Default value is 'false'.
Enabling it means that the container must be started in privileged mode.
Please confirm whether the host machine and k8s cluster allow it.
Doris workloadgroup reference document: https://doris.apache.org/docs/admin-manual/resource-admin/workload-group
type: boolean
envVars:
description: EnvVars is a slice of environment variables that
are added to the pods, the default is empty.
Expand Down Expand Up @@ -11310,7 +11318,7 @@ spec:
type: object
type: object
service:
description: export metaservice for accessing from outside k8s.
description: export service for accessing from outside k8s.
properties:
annotations:
additionalProperties:
Expand Down Expand Up @@ -11433,7 +11441,7 @@ spec:
type: array
uniqueId:
description: the unique identifier of compute group, first register
in fe will use UniqueId as cluster name.
in fe will use UniqueId as compute group name.
type: string
required:
- uniqueId
Expand Down Expand Up @@ -13546,7 +13554,7 @@ spec:
type: object
type: object
service:
description: export metaservice for accessing from outside k8s.
description: export service for accessing from outside k8s.
properties:
annotations:
additionalProperties:
Expand Down Expand Up @@ -13659,6 +13667,25 @@ spec:
type: object
type: array
type: object
kerberosInfo:
description: KerberosInfo contains a series of access key files, Provides
access to kerberos.
properties:
keytabPath:
description: |-
KeytabPath is the path where the Secret is finally stored inside the pod. default '/etc/keytab/'.
It is not recommended to modify it unless necessary.
This path is the path filled in when configuring "hadoop.kerberos.keytab".
type: string
keytabSecretName:
description: "SecretName is the name of sercet within '*.keytab'
files,\nrefer to the following command to create a Secret :\n\t'kubectl
create secret generic {secret-name} --from-file=. '"
type: string
krb5ConfigMap:
description: Krb5ConfigMap is the name of configmap within 'krb5.conf'
type: string
type: object
metaService:
description: MetaService describe the metaservice that cluster want
to storage metadata.
Expand Down Expand Up @@ -15775,7 +15802,7 @@ spec:
type: object
type: object
service:
description: export metaservice for accessing from outside k8s.
description: export service for accessing from outside k8s.
properties:
annotations:
additionalProperties:
Expand Down Expand Up @@ -15982,6 +16009,10 @@ spec:
description: Phase represent the stage of reconciling.
type: string
type: object
observedGeneration:
description: is the most recent generation observed for DorisDisaggregatedCluster
format: int64
type: integer
type: object
type: object
served: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,14 @@ spec:
type: string
type: object
type: object
enableWorkloadGroup:
description: |-
EnableWorkloadGroup is a switch that determines whether the doris cluster enables the workload group.
Default value is 'false'.
Enabling it means that the container must be started in privileged mode.
Please confirm whether the host machine and k8s cluster allow it.
Doris workloadgroup reference document: https://doris.apache.org/docs/admin-manual/resource-admin/workload-group
type: boolean
envVars:
description: EnvVars is a slice of environment variables that
are added to the pods, the default is empty.
Expand Down Expand Up @@ -2183,7 +2191,7 @@ spec:
type: object
type: object
service:
description: export metaservice for accessing from outside k8s.
description: export service for accessing from outside k8s.
properties:
annotations:
additionalProperties:
Expand Down Expand Up @@ -2306,7 +2314,7 @@ spec:
type: array
uniqueId:
description: the unique identifier of compute group, first register
in fe will use UniqueId as cluster name.
in fe will use UniqueId as compute group name.
type: string
required:
- uniqueId
Expand Down Expand Up @@ -4419,7 +4427,7 @@ spec:
type: object
type: object
service:
description: export metaservice for accessing from outside k8s.
description: export service for accessing from outside k8s.
properties:
annotations:
additionalProperties:
Expand Down Expand Up @@ -4532,6 +4540,25 @@ spec:
type: object
type: array
type: object
kerberosInfo:
description: KerberosInfo contains a series of access key files, Provides
access to kerberos.
properties:
keytabPath:
description: |-
KeytabPath is the path where the Secret is finally stored inside the pod. default '/etc/keytab/'.
It is not recommended to modify it unless necessary.
This path is the path filled in when configuring "hadoop.kerberos.keytab".
type: string
keytabSecretName:
description: "SecretName is the name of sercet within '*.keytab'
files,\nrefer to the following command to create a Secret :\n\t'kubectl
create secret generic {secret-name} --from-file=. '"
type: string
krb5ConfigMap:
description: Krb5ConfigMap is the name of configmap within 'krb5.conf'
type: string
type: object
metaService:
description: MetaService describe the metaservice that cluster want
to storage metadata.
Expand Down Expand Up @@ -6648,7 +6675,7 @@ spec:
type: object
type: object
service:
description: export metaservice for accessing from outside k8s.
description: export service for accessing from outside k8s.
properties:
annotations:
additionalProperties:
Expand Down Expand Up @@ -6855,6 +6882,10 @@ spec:
description: Phase represent the stage of reconciling.
type: string
type: object
observedGeneration:
description: is the most recent generation observed for DorisDisaggregatedCluster
format: int64
type: integer
type: object
type: object
served: true
Expand Down
7 changes: 7 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ toolchain go1.23.6
require (
github.com/DATA-DOG/go-sqlmock v1.5.2
github.com/FoundationDB/fdb-kubernetes-operator v1.36.0
github.com/MakeNowJust/heredoc v1.0.0
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/go-sql-driver/mysql v1.8.1
github.com/jmoiron/sqlx v1.4.0
github.com/magiconair/properties v1.8.7
github.com/onsi/ginkgo/v2 v2.21.0
github.com/onsi/gomega v1.35.1
github.com/russross/blackfriday/v2 v2.1.0
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.16.0
github.com/tidwall/gjson v1.18.0
k8s.io/api v0.32.0
k8s.io/apimachinery v0.32.0
k8s.io/client-go v0.32.0
Expand Down Expand Up @@ -48,6 +52,7 @@ require (
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
Expand All @@ -66,6 +71,8 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
Expand Down
Loading