-
Notifications
You must be signed in to change notification settings - Fork 62
/
cassandradatacenter_types.go
106 lines (92 loc) · 4.47 KB
/
cassandradatacenter_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package v1alpha1
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// CassandraDataCenterSpec defines the desired state of CassandraDataCenter
// +k8s:openapi-gen=true
type CassandraDataCenterSpec struct {
Nodes int32 `json:"nodes,omitempty"`
CassandraImage string `json:"cassandraImage,omitempty"`
SidecarImage string `json:"sidecarImage,omitempty"`
InitImage string `json:"initImage,omitempty"`
// +listType
Racks []Rack `json:"racks,omitempty"`
ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty"`
// +listType
ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
UserSecretVolumeSource []*v1.SecretVolumeSource `json:"userSecretVolumeSource,omitempty"`
UserConfigMapVolumeSource *v1.ConfigMapVolumeSource `json:"userConfigMapVolumeSource,omitempty"`
SidecarSecretVolumeSource *v1.SecretVolumeSource `json:"sidecarSecretVolumeSource,omitempty"`
Resources *v1.ResourceRequirements `json:"resources,omitempty"`
SidecarResources *v1.ResourceRequirements `json:"sidecarResources,omitempty"`
DummyVolume *v1.EmptyDirVolumeSource `json:"dummyVolume,omitempty"`
DeletePVCs bool `json:"deletePVCs,omitempty"`
DataVolumeClaimSpec *v1.PersistentVolumeClaimSpec `json:"dataVolumeClaimSpec,omitempty"`
OptimizeKernelParams bool `json:"optimizeKernelParams,omitempty"`
PrometheusSupport bool `json:"prometheusSupport,omitempty"`
OperatorLabels *OperatorLabels `json:"operatorLabels,omitempty"`
OperatorAnnotations *OperatorAnnotations `json:"operatorAnnotations,omitempty"`
// +listType
SidecarEnv []v1.EnvVar `json:"sidecarEnv,omitempty"`
CassandraAuth *CassandraAuth `json:"cassandraAuth,omitempty"`
// +listType
CassandraEnv []v1.EnvVar `json:"cassandraEnv,omitempty"`
ServiceAccountName string `json:"serviceAccountName,omitempty"`
FSGroup int64 `json:"fsGroup,omitempty"`
Restore *Restore `json:"restore,omitempty"`
}
// CassandraDataCenterStatus defines the observed state of CassandraDataCenter
// +k8s:openapi-gen=true
type CassandraDataCenterStatus struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// CassandraDataCenter is the Schema for the cassandradatacenters API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
type CassandraDataCenter struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Cluster string `json:"cluster"`
DataCenter string `json:"datacenter"`
Spec CassandraDataCenterSpec `json:"spec,omitempty"`
Status CassandraDataCenterStatus `json:"status,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// CassandraDataCenterList contains a list of CassandraDataCenter
type CassandraDataCenterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []CassandraDataCenter `json:"items"`
}
func init() {
SchemeBuilder.Register(&CassandraDataCenter{}, &CassandraDataCenterList{})
}
type Rack struct {
Name string `json:"name"`
Labels map[string]string `json:"labels"`
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
Affinity *v1.Affinity `json:"affinity,omitempty"`
}
type OperatorAnnotations struct {
PrometheusService map[string]string `json:"prometheusService,omitempty"`
NodesService map[string]string `json:"nodesService,omitempty"`
SeedNodesService map[string]string `json:"seedNodesService,omitempty"`
StatefulSet map[string]string `json:"statefulSet,omitempty"`
PodTemplate map[string]string `json:"podTemplate,omitempty"`
}
type OperatorLabels struct {
PrometheusService map[string]string `json:"prometheusService,omitempty"`
NodesService map[string]string `json:"nodesService,omitempty"`
SeedNodesService map[string]string `json:"seedNodesService,omitempty"`
StatefulSet map[string]string `json:"statefulSet,omitempty"`
PodTemplate map[string]string `json:"podTemplate,omitempty"`
}
type Restore struct {
BackupName string `json:"backupName"`
}
type CassandraAuth struct {
Authenticator string `json:"authenticator"`
Authorizer string `json:"authorizer"`
RoleManager string `json:"roleManager"`
}