-
Notifications
You must be signed in to change notification settings - Fork 11
/
jitsi_types.go
218 lines (190 loc) · 5.89 KB
/
jitsi_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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
/*
Copyright 2021.
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 v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// 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.
type JVBStrategyType string
const (
JVBStrategyStatic JVBStrategyType = "static"
JVBStrategyDaemon JVBStrategyType = "daemonset"
JVBStrategyAutoScaled JVBStrategyType = "autoscaled"
)
type JVBStrategy struct {
//+kubebuilder:validation:Enum=static;daemonset;autoscaled
Type JVBStrategyType `json:"type,omitempty"`
//+optional
Replicas *int32 `json:"replicas,omitempty"`
//+optional
MaxReplicas int32 `json:"maxReplicas,omitempty"`
}
type JVBPorts struct {
//+optional
UDP *int32 `json:"udp,omitempty"`
//+optional
TCP *int32 `json:"tcp,omitempty"`
}
type JVB struct {
*ContainerRuntime `json:",inline"`
AffinitySettings `json:",inline"`
//+optional
Strategy JVBStrategy `json:"strategy,omitempty"`
//+optional
Ports JVBPorts `json:"ports,omitempty"`
//+optional
GracefulShutdown bool `json:"gracefulShutdown,omitempty"`
}
type Prosody struct {
*ContainerRuntime `json:",inline"`
AffinitySettings `json:",inline"`
//+optional
CustomProsodyConfig *corev1.LocalObjectReference `json:"customProsodyConfigCM,omitempty"`
}
type ContainerRuntime struct {
//+optional
Image string `json:"image,omitempty"`
//+optional
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
//+optional
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
}
type AffinitySettings struct {
//+optional
Affinity corev1.Affinity `json:"affinity,omitempty"`
//+optional
DisableDefaultAffinity bool `json:"disableDefaultAffinity,omitempty"`
}
type Jicofo struct {
*ContainerRuntime `json:",inline"`
AffinitySettings `json:",inline"`
}
type BucketSettings struct {
//+required
Host string `json:"host"`
//+required
Name string `json:"name"`
//+required
Secret *corev1.LocalObjectReference `json:"secret"`
}
type Jibri struct {
*ContainerRuntime `json:",inline"`
AffinitySettings `json:",inline"`
//+optional
Enabled bool `json:"enabled,omitempty"`
//+optional
Replicas *int32 `json:"replicas,omitempty"`
//+optional
ServiceAccountName string `json:"serviceAccountName,omitempty"`
//+optional
Bucket *BucketSettings `json:"bucket,omitempty"`
}
type Web struct {
*ContainerRuntime `json:",inline"`
AffinitySettings `json:",inline"`
//+optional
Replicas *int32 `json:"replicas,omitempty"`
//+optional
CustomConfig *corev1.LocalObjectReference `json:"customConfigCM,omitempty"`
//+optional
CustomInterfaceConfig *corev1.LocalObjectReference `json:"customInterfaceConfigCM,omitempty"`
//+optional
CustomTitleConfig *corev1.LocalObjectReference `json:"customTitleConfigCM,omitempty"`
//+optional
CustomBodyConfig *corev1.LocalObjectReference `json:"customBodyConfigCM,omitempty"`
//+optional
CustomCloseConfig *corev1.LocalObjectReference `json:"customCloseConfigCM,omitempty"`
}
type Image struct {
Registry string `json:"registry,omitempty"`
Tag string `json:"tag,omitempty"`
PullPolicy corev1.PullPolicy `json:"pullPolicy,omitempty"`
}
type Ingress struct {
//+optional
Enabled bool `json:"enabled,omitempty"`
//+optional
TLS bool `json:"tls,omitempty"`
//+optional
Annotations map[string]string `json:"annotations,omitempty"`
}
type TURN struct {
Host string `json:"host"`
//+optional
Secret *corev1.SecretKeySelector `json:"secret"`
//+optional
Port int `json:"port,omitempty"`
//+optional
TLS bool `json:"tls,omitempty"`
}
// JitsiSpec defines the desired state of Jitsi
type JitsiSpec struct {
//+optional
JVB JVB `json:"jvb,omitempty"`
//+optional
Prosody Prosody `json:"prosody,omitempty"`
//+optional
Jicofo Jicofo `json:"jicofo,omitempty"`
//+optional
Jibri Jibri `json:"jibri,omitempty"`
//+optional
Web Web `json:"web,omitempty"`
//+optional
Domain string `json:"domain"`
//+optional
Region string `json:"region,omitempty"`
//+optional
Timezone string `json:"timezone,omitempty"`
//+optional
Image Image `json:"image,omitempty"`
//+optional
Variables map[string]string `json:"variables,omitempty"`
//+optional
Ingress Ingress `json:"ingress,omitempty"`
//+optional
TURN *TURN `json:"turn,omitempty"`
//+optional
Metrics bool `json:"metrics,omitempty"`
//+optional
Suspend bool `json:"suspend,omitempty"`
//+optional
DisableGracefulUpgrade bool `json:"disableGracefulUpgrade,omitempty"`
}
// JitsiStatus defines the observed state of Jitsi
type JitsiStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
LastAppliedRevision string `json:"lastAppliedRevision,omitempty"`
LastAttemptedRevision string `json:"lastAttemptedRevision,omitempty"`
}
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// Jitsi is the Schema for the jitsis API
type Jitsi struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec JitsiSpec `json:"spec,omitempty"`
Status JitsiStatus `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// JitsiList contains a list of Jitsi
type JitsiList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Jitsi `json:"items"`
}
func init() {
SchemeBuilder.Register(&Jitsi{}, &JitsiList{})
}