Skip to content

Commit d169a30

Browse files
committed
update
1 parent ae7230f commit d169a30

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3281
-1541
lines changed

apis/workloads/v1/instance_types.go

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2020
package v1
2121

2222
import (
23+
kbappsv1 "github.com/apecloud/kubeblocks/apis/apps/v1"
2324
corev1 "k8s.io/api/core/v1"
25+
rbacv1 "k8s.io/api/rbac/v1"
2426
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
25-
26-
kbappsv1 "github.com/apecloud/kubeblocks/apis/apps/v1"
2727
)
2828

2929
// +genclient
30-
//+kubebuilder:object:root=true
31-
//+kubebuilder:subresource:status
30+
// +kubebuilder:object:root=true
31+
// +kubebuilder:subresource:status
3232
// +kubebuilder:resource:categories={kubeblocks},shortName=inst
3333
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
3434

@@ -113,7 +113,7 @@ type InstanceSpec struct {
113113
// A list of roles defined in the system. Instanceset obtains role through pods' role label `kubeblocks.io/role`.
114114
//
115115
// +optional
116-
Roles []kbappsv1.ReplicaRole `json:"roles,omitempty"`
116+
Roles []ReplicaRole `json:"roles,omitempty"`
117117

118118
// Provides actions to do membership dynamic reconfiguration.
119119
//
@@ -125,10 +125,10 @@ type InstanceSpec struct {
125125
// +optional
126126
TemplateVars map[string]string `json:"templateVars,omitempty"`
127127

128-
// Indicates that the InstanceSet is paused, meaning the reconciliation of this InstanceSet object will be paused.
128+
// Assistant objects that are necessary to run the instance.
129129
//
130130
// +optional
131-
Paused bool `json:"paused,omitempty"`
131+
AssistantObjects []InstanceAssistantObject `json:"assistantObjects,omitempty"`
132132
}
133133

134134
// InstanceStatus2 defines the observed state of Instance
@@ -160,3 +160,12 @@ type InstanceStatus2 struct {
160160
// +optional
161161
Conditions []metav1.Condition `json:"conditions,omitempty"`
162162
}
163+
164+
type InstanceAssistantObject struct {
165+
ConfigMap *corev1.ConfigMap `json:"configMap,omitempty"`
166+
Secret *corev1.Secret `json:"secret,omitempty"`
167+
Service *corev1.Service `json:"service,omitempty"`
168+
ServiceAccount *corev1.ServiceAccount `json:"serviceAccount,omitempty"`
169+
Role *rbacv1.Role `json:"clusterRole,omitempty"`
170+
RoleBinding *rbacv1.RoleBinding `json:"roleBinding,omitempty"`
171+
}

apis/workloads/v1/instanceset_types.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,30 @@ type InstanceSetSpec struct {
257257
// +kubebuilder:default=false
258258
// +optional
259259
DisableDefaultHeadlessService bool `json:"disableDefaultHeadlessService,omitempty"`
260+
261+
// Assistant objects that are necessary to run the instance.
262+
//
263+
// - ConfigMap:
264+
// - config & script templates
265+
// - env
266+
// - kbagent task parameters
267+
// - Secret:
268+
// - account
269+
// - TLS
270+
// - RBAC:
271+
// - sa
272+
// - role
273+
// - rolebinding
274+
// - Service # TODO: ???
275+
//
276+
// +optional
277+
AssistantObjects []corev1.ObjectReference `json:"assistantObjects,omitempty"`
278+
279+
// Specifies whether to clone the assistant objects.
280+
//
281+
// +kubebuilder:default=false
282+
// +optional
283+
CloneAssistantObjects bool `json:"cloneAssistantObjects,omitempty"`
260284
}
261285

262286
// InstanceSetStatus defines the observed state of InstanceSet

apis/workloads/v1/zz_generated.deepcopy.go

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)