Skip to content

Commit

Permalink
feat(main): add bootstrap address (#51)
Browse files Browse the repository at this point in the history
Signed-off-by: cuisongliu <[email protected]>
  • Loading branch information
cuisongliu authored Oct 16, 2024
1 parent 700d231 commit b5e8c80
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
9 changes: 6 additions & 3 deletions api/v1beta1/automq_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,17 @@ type AutoMQStatus struct {
// +kubebuilder:validation:Minimum=0
// +kubebuilder:default=0
ControllerReplicas int32 `json:"controllerReplicas"`
// ControllerAddress is the address of the controller
// +optional
ControllerAddresses []string `json:"controllerAddresses,omitempty"`
// BrokerReplicas is the number of broker replicas for the AutoMQ
// +optional
// +kubebuilder:validation:Minimum=0
// +kubebuilder:default=0
BrokerReplicas int32 `json:"brokerReplicas"`
// ControllerAddress is the address of the controller
// +optional
ControllerAddresses []string `json:"controllerAddresses,omitempty"`
// BootstrapInternalAddress is the address of the bootstrap
// +optional
BootstrapInternalAddress string `json:"bootstrapInternalAddress,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/infra.cuisongliu.github.com_automqs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,9 @@ spec:
status:
description: AutoMQStatus defines the observed state of AutoMQ
properties:
bootstrapInternalAddress:
description: BootstrapInternalAddress is the address of the bootstrap
type: string
brokerReplicas:
default: 0
description: BrokerReplicas is the number of broker replicas for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,9 @@ spec:
status:
description: AutoMQStatus defines the observed state of AutoMQ
properties:
bootstrapInternalAddress:
description: BootstrapInternalAddress is the address of the bootstrap
type: string
brokerReplicas:
default: 0
description: BrokerReplicas is the number of broker replicas for the
Expand Down
1 change: 1 addition & 0 deletions internal/controller/automq_controller_b.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,5 +493,6 @@ func (r *AutoMQReconciler) syncKafkaBootstrapService(ctx context.Context, obj *i
Reason: "BootstrapServiceReconciling",
Message: fmt.Sprintf("Bootstrap service for the custom resource (%s) has been created", obj.Name),
})
obj.Status.BootstrapInternalAddress = fmt.Sprintf("%s.%s.svc:%d", getAutoMQName(brokerRole+"-bootstrap", nil), obj.Namespace, 9092)
return true
}

0 comments on commit b5e8c80

Please sign in to comment.