-
Notifications
You must be signed in to change notification settings - Fork 56
/
linstorsatellite_types.go
104 lines (85 loc) · 3.73 KB
/
linstorsatellite_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
/*
Copyright 2022.
Licensed 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 v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// LinstorSatelliteSpec defines the desired state of LinstorSatellite
type LinstorSatelliteSpec struct {
// ClusterRef references the LinstorCluster used to create this LinstorSatellite.
ClusterRef ClusterReference `json:"clusterRef"`
// Repository used to pull workload images.
// +kubebuilder:validation:Optional
Repository string `json:"repository,omitempty"`
// Patches is a list of kustomize patches to apply.
//
// See https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patches/ for how to create patches.
// +kubebuilder:validation:Optional
Patches []Patch `json:"patches,omitempty"`
// StoragePools is a list of storage pools to configure on the node.
// +kubebuilder:validation:Optional
StoragePools []LinstorStoragePool `json:"storagePools,omitempty"`
// Properties is a list of properties to set on the node.
// +kubebuilder:validation:Optional
// +listType=map
// +listMapKey=name
// +patchMergeKey=name
// +patchStrategy=merge
Properties []LinstorNodeProperty `json:"properties,omitempty"`
// InternalTLS configures secure communication for the LINSTOR Satellite.
//
// If set, the control traffic between LINSTOR Controller and Satellite will be encrypted using mTLS.
// The Controller will use the client key from `LinstorCluster.spec.internalTLS` when connecting.
// +kubebuilder:validation:Optional
// + Without "nullable" the k8s API does not accept patches with 'internalTLS: {}', which seems to be a bug.
// +nullable
InternalTLS *TLSConfigWithHandshakeDaemon `json:"internalTLS,omitempty"`
}
// LinstorSatelliteStatus defines the observed state of LinstorSatellite
type LinstorSatelliteStatus struct {
// Current LINSTOR Satellite state
// +kubebuilder:validation:Optional
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
type ClusterReference struct {
// Name of the LinstorCluster resource controlling this satellite.
Name string `json:"name,omitempty"`
// ClientSecretName references the secret used by the operator to validate the https endpoint.
ClientSecretName string `json:"clientSecretName,omitempty"`
// ExternalController references an external controller.
// When set, the Operator uses the external cluster to register satellites.
// +kubebuilder:validation:Optional
ExternalController *LinstorExternalControllerRef `json:"externalController,omitempty"`
}
// LinstorSatellite is the Schema for the linstorsatellites API
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster
type LinstorSatellite struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec LinstorSatelliteSpec `json:"spec,omitempty"`
Status LinstorSatelliteStatus `json:"status,omitempty"`
}
// LinstorSatelliteList contains a list of LinstorSatellite
// +kubebuilder:object:root=true
type LinstorSatelliteList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []LinstorSatellite `json:"items"`
}
func init() {
SchemeBuilder.Register(&LinstorSatellite{}, &LinstorSatelliteList{})
}