Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #176] Support manage multi cluster #183

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,9 @@ spec:
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
rocketMqName:
description: RocketMqName is the name of the RocketMQ cluster.
type: string
scalePodName:
description: The name of pod where the metadata from
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7880,6 +7880,9 @@ spec:
nameServers:
description: NameServers defines the name service list e.g. 192.168.1.1:9876;192.168.1.2:9876
type: string
rocketMqName:
description: RocketMqName is the name of the RocketMQ cluster
type: string
required:
- consoleDeployment
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,9 @@ spec:
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
rocketMqName:
description: RocketMqName is the name of the RocketMQ cluster
type: string
securityContext:
description: Pod Security Context
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,9 @@ spec:
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
rocketMqName:
description: RocketMqName is the name of the RocketMQ cluster
type: string
securityContext:
description: Pod Security Context
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ spec:
spec:
description: TopicTransferSpec defines the desired state of TopicTransfer
properties:
rocketMqName:
description: RocketMqName is the name of the RocketMQ cluster
type: string
sourceCluster:
description: The cluster where the transferred topic from
type: string
Expand Down
18 changes: 8 additions & 10 deletions charts/rocketmq-operator/templates/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "rocketmq-operator.fullname" . }}
labels:
{{- include "rocketmq-operator.labels" . | nindent 4 }}
name: rocketmq-operator
subjects:
- kind: ServiceAccount
name: rocketmq-operator
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "rocketmq-operator.fullname" . }}
subjects:
- name: {{ template "rocketmq-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
kind: ServiceAccount
name: rocketmq-operator
apiGroup: rbac.authorization.k8s.io
2 changes: 1 addition & 1 deletion charts/rocketmq-operator/templates/service_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "rocketmq-operator.serviceAccountName" . }}
name: rocketmq-operator
3 changes: 3 additions & 0 deletions deploy/crds/rocketmq.apache.org_brokers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,9 @@ spec:
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
rocketMqName:
description: RocketMqName is the name of the RocketMQ cluster.
type: string
scalePodName:
description: The name of pod where the metadata from
type: string
Expand Down
3 changes: 3 additions & 0 deletions deploy/crds/rocketmq.apache.org_consoles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7880,6 +7880,9 @@ spec:
nameServers:
description: NameServers defines the name service list e.g. 192.168.1.1:9876;192.168.1.2:9876
type: string
rocketMqName:
description: RocketMqName is the name of the RocketMQ cluster
type: string
required:
- consoleDeployment
type: object
Expand Down
3 changes: 3 additions & 0 deletions deploy/crds/rocketmq.apache.org_controllers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,9 @@ spec:
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
rocketMqName:
description: RocketMqName is the name of the RocketMQ cluster
type: string
securityContext:
description: Pod Security Context
properties:
Expand Down
3 changes: 3 additions & 0 deletions deploy/crds/rocketmq.apache.org_nameservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,9 @@ spec:
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
rocketMqName:
description: RocketMqName is the name of the RocketMQ cluster
type: string
securityContext:
description: Pod Security Context
properties:
Expand Down
3 changes: 3 additions & 0 deletions deploy/crds/rocketmq.apache.org_topictransfers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ spec:
spec:
description: TopicTransferSpec defines the desired state of TopicTransfer
properties:
rocketMqName:
description: RocketMqName is the name of the RocketMQ cluster
type: string
sourceCluster:
description: The cluster where the transferred topic from
type: string
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/rocketmq/v1alpha1/broker_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ import (
// BrokerSpec defines the desired state of Broker
// +k8s:openapi-gen=true
type BrokerSpec struct {
// RocketMqName is the name of the RocketMQ cluster.
RocketMqName string `json:"rocketMqName,omitempty"`

// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/rocketmq/v1alpha1/console_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ import (
// ConsoleSpec defines the desired state of Console
// +k8s:openapi-gen=true
type ConsoleSpec struct {
// RocketMqName is the name of the RocketMQ cluster
RocketMqName string `json:"rocketMqName,omitempty"`

// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
Expand Down
7 changes: 7 additions & 0 deletions pkg/apis/rocketmq/v1alpha1/controller_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
ControllerRocketMqNameIndexKey = "spec.rocketMqNameNamespaced"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// ControllerSpec defines the desired state of Controller
// +k8s:openapi-gen=true
type ControllerSpec struct {
// RocketMqName is the name of the RocketMQ cluster
RocketMqName string `json:"rocketMqName,omitempty"`

// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
Expand Down
7 changes: 7 additions & 0 deletions pkg/apis/rocketmq/v1alpha1/nameservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
NameServiceRocketMqNameIndexKey = ".spec.rocketMqNameNamespaced"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// NameServiceSpec defines the desired state of NameService
// +k8s:openapi-gen=true
type NameServiceSpec struct {
// RocketMqName is the name of the RocketMQ cluster
RocketMqName string `json:"rocketMqName,omitempty"`

// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/rocketmq/v1alpha1/topictransfer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ import (
// TopicTransferSpec defines the desired state of TopicTransfer
// +k8s:openapi-gen=true
type TopicTransferSpec struct {
// RocketMqName is the name of the RocketMQ cluster
RocketMqName string `json:"rocketMqName,omitempty"`

// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
Expand Down
3 changes: 3 additions & 0 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ const (
// UpdateBrokerConfig is update broker config command
UpdateBrokerConfig = "updateBrokerConfig"

// ClusterList is the command of cluster list
ClusterList = "clusterList"

// ParamNameServiceAddress is the name of name server list parameter
ParamNameServiceAddress = "namesrvAddr"

Expand Down
Loading