@@ -77,9 +77,6 @@ type Config struct {
77
77
78
78
// Plugin specifies which vCluster plugins to enable. Use "plugins" instead. Do not use this option anymore.
79
79
Plugin map [string ]Plugin `json:"plugin,omitempty"`
80
-
81
- // SleepMode holds the native sleep mode configuration for Pro clusters
82
- SleepMode * SleepMode `json:"sleepMode,omitempty"`
83
80
}
84
81
85
82
// Integrations holds config for vCluster integrations with other operators or tools running on the host cluster
@@ -90,19 +87,13 @@ type Integrations struct {
90
87
// KubeVirt reuses a host kubevirt and makes certain CRDs from it available inside the vCluster
91
88
KubeVirt KubeVirt `json:"kubeVirt,omitempty"`
92
89
93
- // ExternalSecrets reuses a host external secret operator and makes certain CRDs from it available inside the vCluster.
94
- // - ExternalSecrets will be synced from the virtual cluster to the host cluster.
95
- // - SecretStores will be synced from the virtual cluster to the host cluster and then bi-directionally.
96
- // - ClusterSecretStores will be synced from the host cluster to the virtual cluster.
90
+ // ExternalSecrets reuses a host external secret operator and makes certain CRDs from it available inside the vCluster
97
91
ExternalSecrets ExternalSecrets `json:"externalSecrets,omitempty"`
98
92
99
93
// CertManager reuses a host cert-manager and makes its CRDs from it available inside the vCluster.
100
94
// - Certificates and Issuers will be synced from the virtual cluster to the host cluster.
101
95
// - ClusterIssuers will be synced from the host cluster to the virtual cluster.
102
96
CertManager CertManager `json:"certManager,omitempty"`
103
-
104
- // Istio syncs DestinationRules, Gateways and VirtualServices from virtual cluster to the host.
105
- Istio Istio `json:"istio,omitempty"`
106
97
}
107
98
108
99
// CertManager reuses a host cert-manager and makes its CRDs from it available inside the vCluster
@@ -137,23 +128,6 @@ type ClusterIssuersSyncConfig struct {
137
128
Selector LabelSelector `json:"selector,omitempty"`
138
129
}
139
130
140
- type Istio struct {
141
- EnableSwitch
142
- Sync IstioSync `json:"sync,omitempty"`
143
- }
144
-
145
- type IstioSync struct {
146
- ToHost IstioSyncToHost `json:"toHost,omitempty"`
147
- }
148
-
149
- type IstioSyncToHost struct {
150
- DestinationRules EnableSwitch `json:"destinationRules,omitempty"`
151
-
152
- Gateways EnableSwitch `json:"gateways,omitempty"`
153
-
154
- VirtualServices EnableSwitch `json:"virtualServices,omitempty"`
155
- }
156
-
157
131
// ExternalSecrets reuses a host external secret operator and makes certain CRDs from it available inside the vCluster
158
132
type ExternalSecrets struct {
159
133
// Enabled defines whether the external secret integration is enabled or not
@@ -165,11 +139,11 @@ type ExternalSecrets struct {
165
139
}
166
140
167
141
type ExternalSecretsSync struct {
168
- // ExternalSecrets defines if external secrets should get synced from the virtual cluster to the host cluster.
142
+ // ExternalSecrets defines whether to sync external secrets or not
169
143
ExternalSecrets EnableSwitch `json:"externalSecrets,omitempty"`
170
- // Stores defines if secret stores should get synced from the virtual cluster to the host cluster and then bi-directionally.
144
+ // Stores defines whether to sync stores or not
171
145
Stores EnableSwitch `json:"stores,omitempty"`
172
- // ClusterStores defines if cluster secrets stores should get synced from the host cluster to the virtual cluster.
146
+ // ClusterStores defines whether to sync cluster stores or not
173
147
ClusterStores ClusterStoresSyncConfig `json:"clusterStores,omitempty"`
174
148
}
175
149
@@ -297,10 +271,8 @@ func (c *Config) BackingStoreType() StoreType {
297
271
switch {
298
272
case c .ControlPlane .BackingStore .Etcd .Embedded .Enabled :
299
273
return StoreTypeEmbeddedEtcd
300
- case c .ControlPlane .BackingStore .Etcd .External .Enabled :
301
- return StoreTypeExternalEtcd
302
274
case c .ControlPlane .BackingStore .Etcd .Deploy .Enabled :
303
- return StoreTypeDeployedEtcd
275
+ return StoreTypeExternalEtcd
304
276
case c .ControlPlane .BackingStore .Database .Embedded .Enabled :
305
277
return StoreTypeEmbeddedDatabase
306
278
case c .ControlPlane .BackingStore .Database .External .Enabled :
@@ -311,7 +283,7 @@ func (c *Config) BackingStoreType() StoreType {
311
283
}
312
284
313
285
func (c * Config ) EmbeddedDatabase () bool {
314
- return ! c .ControlPlane .BackingStore .Database .External .Enabled && ! c .ControlPlane .BackingStore .Etcd .Embedded .Enabled && ! c .ControlPlane .BackingStore .Etcd .Deploy .Enabled && ! c . ControlPlane . BackingStore . Etcd . External . Enabled
286
+ return ! c .ControlPlane .BackingStore .Database .External .Enabled && ! c .ControlPlane .BackingStore .Etcd .Embedded .Enabled && ! c .ControlPlane .BackingStore .Etcd .Deploy .Enabled
315
287
}
316
288
317
289
func (c * Config ) Distro () string {
@@ -345,15 +317,15 @@ func ValidateChanges(oldCfg, newCfg *Config) error {
345
317
346
318
// ValidateStoreAndDistroChanges checks whether migrating from one store to the other is allowed.
347
319
func ValidateStoreAndDistroChanges (currentStoreType , previousStoreType StoreType , currentDistro , previousDistro string ) error {
348
- if currentDistro != previousDistro && ! (previousDistro == "eks" && currentDistro == K8SDistro ) && ! ( previousDistro == K3SDistro && currentDistro == K8SDistro ) {
320
+ if currentDistro != previousDistro && ! (previousDistro == "eks" && currentDistro == K8SDistro ) {
349
321
return fmt .Errorf ("seems like you were using %s as a distro before and now have switched to %s, please make sure to not switch between vCluster distros" , previousDistro , currentDistro )
350
322
}
351
323
352
324
if currentStoreType != previousStoreType {
353
- if currentStoreType != StoreTypeDeployedEtcd && currentStoreType != StoreTypeEmbeddedEtcd {
325
+ if currentStoreType != StoreTypeEmbeddedEtcd {
354
326
return fmt .Errorf ("seems like you were using %s as a store before and now have switched to %s, please make sure to not switch between vCluster stores" , previousStoreType , currentStoreType )
355
327
}
356
- if previousStoreType != StoreTypeExternalEtcd && previousStoreType != StoreTypeDeployedEtcd && previousStoreType != StoreTypeEmbeddedDatabase {
328
+ if previousStoreType != StoreTypeExternalEtcd && previousStoreType != StoreTypeEmbeddedDatabase {
357
329
return fmt .Errorf ("seems like you were using %s as a store before and now have switched to %s, please make sure to not switch between vCluster stores" , previousStoreType , currentStoreType )
358
330
}
359
331
}
@@ -428,41 +400,6 @@ func UnmarshalYAMLStrict(data []byte, i any) error {
428
400
429
401
// ExportKubeConfig describes how vCluster should export the vCluster kubeconfig.
430
402
type ExportKubeConfig struct {
431
- ExportKubeConfigProperties
432
-
433
- // Declare in which host cluster secret vCluster should store the generated virtual cluster kubeconfig.
434
- // If this is not defined, vCluster will create it with `vc-NAME`. If you specify another name,
435
- // vCluster creates the config in this other secret.
436
- //
437
- // Deprecated: Use AdditionalSecrets instead.
438
- Secret ExportKubeConfigSecretReference `json:"secret,omitempty"`
439
-
440
- // AdditionalSecrets specifies the additional host cluster secrets in which vCluster will store the
441
- // generated virtual cluster kubeconfigs.
442
- AdditionalSecrets []ExportKubeConfigAdditionalSecretReference `json:"additionalSecrets,omitempty"`
443
- }
444
-
445
- // GetAdditionalSecrets returns optional additional kubeconfig Secrets.
446
- //
447
- // If the deprecated Secret property is set, GetAdditionalSecrets only returns that secret, and
448
- // AdditionalSecrets is ignored. On the other hand, if the AdditionalSecrets property is set,
449
- // GetAdditionalSecrets returns the secrets config from the AdditionalSecrets, and Secret property
450
- // is ignored.
451
- func (e * ExportKubeConfig ) GetAdditionalSecrets () []ExportKubeConfigAdditionalSecretReference {
452
- if e .Secret .IsSet () {
453
- return []ExportKubeConfigAdditionalSecretReference {
454
- {
455
- ExportKubeConfigProperties : e .ExportKubeConfigProperties ,
456
- Namespace : e .Secret .Namespace ,
457
- Name : e .Secret .Name ,
458
- },
459
- }
460
- }
461
-
462
- return e .AdditionalSecrets
463
- }
464
-
465
- type ExportKubeConfigProperties struct {
466
403
// Context is the name of the context within the generated kubeconfig to use.
467
404
Context string `json:"context,omitempty"`
468
405
@@ -474,6 +411,11 @@ type ExportKubeConfigProperties struct {
474
411
475
412
// ServiceAccount can be used to generate a service account token instead of the default certificates.
476
413
ServiceAccount ExportKubeConfigServiceAccount `json:"serviceAccount,omitempty"`
414
+
415
+ // Declare in which host cluster secret vCluster should store the generated virtual cluster kubeconfig.
416
+ // If this is not defined, vCluster will create it with `vc-NAME`. If you specify another name,
417
+ // vCluster creates the config in this other secret.
418
+ Secret ExportKubeConfigSecretReference `json:"secret,omitempty"`
477
419
}
478
420
479
421
type ExportKubeConfigServiceAccount struct {
@@ -500,24 +442,6 @@ type ExportKubeConfigSecretReference struct {
500
442
Namespace string `json:"namespace,omitempty"`
501
443
}
502
444
503
- // IsSet checks if at least one ExportKubeConfigSecretReference property is set.
504
- func (s * ExportKubeConfigSecretReference ) IsSet () bool {
505
- return * s != (ExportKubeConfigSecretReference {})
506
- }
507
-
508
- // ExportKubeConfigAdditionalSecretReference defines the additional host cluster secret in which
509
- // vCluster stores the generated virtual cluster kubeconfigs.
510
- type ExportKubeConfigAdditionalSecretReference struct {
511
- ExportKubeConfigProperties
512
-
513
- // Name is the name of the secret where the kubeconfig is stored.
514
- Name string `json:"name,omitempty"`
515
-
516
- // Namespace where vCluster stores the kubeconfig secret. If this is not equal to the namespace
517
- // where you deployed vCluster, you need to make sure vCluster has access to this other namespace.
518
- Namespace string `json:"namespace,omitempty"`
519
- }
520
-
521
445
type Sync struct {
522
446
// Configure resources to sync from the virtual cluster to the host cluster.
523
447
ToHost SyncToHost `json:"toHost,omitempty"`
@@ -1125,7 +1049,15 @@ type DistroK8s struct {
1125
1049
Enabled bool `json:"enabled,omitempty"`
1126
1050
1127
1051
// Version specifies k8s components (scheduler, kube-controller-manager & apiserver) version.
1128
- // It is a shortcut for controlPlane.distro.k8s.image.tag
1052
+ // It is a shortcut for controlPlane.distro.k8s.apiServer.image.tag,
1053
+ // controlPlane.distro.k8s.controllerManager.image.tag and
1054
+ // controlPlane.distro.k8s.scheduler.image.tag
1055
+ // If e.g. controlPlane.distro.k8s.version is set to v1.30.1 and
1056
+ // controlPlane.distro.k8s.scheduler.image.tag
1057
+ //(or controlPlane.distro.k8s.controllerManager.image.tag or controlPlane.distro.k8s.apiServer.image.tag)
1058
+ // is set to v1.31.0,
1059
+ // value from controlPlane.distro.k8s.(controlPlane-component).image.tag will be used
1060
+ // (where controlPlane-component is apiServer, controllerManager and scheduler).
1129
1061
Version string `json:"version,omitempty"`
1130
1062
1131
1063
// APIServer holds configuration specific to starting the api server.
@@ -1152,12 +1084,6 @@ type DistroK0s struct {
1152
1084
}
1153
1085
1154
1086
type DistroCommon struct {
1155
- // Image is the distro image
1156
- Image Image `json:"image,omitempty"`
1157
-
1158
- // ImagePullPolicy is the pull policy for the distro image
1159
- ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
1160
-
1161
1087
// Env are extra environment variables to use for the main container and NOT the init container.
1162
1088
Env []map [string ]interface {} `json:"env,omitempty"`
1163
1089
@@ -1167,7 +1093,14 @@ type DistroCommon struct {
1167
1093
// Security options can be used for the distro init container
1168
1094
SecurityContext map [string ]interface {} `json:"securityContext,omitempty"`
1169
1095
}
1096
+
1170
1097
type DistroContainer struct {
1098
+ // Image is the distro image
1099
+ Image Image `json:"image,omitempty"`
1100
+
1101
+ // ImagePullPolicy is the pull policy for the distro image
1102
+ ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
1103
+
1171
1104
// Command is the command to start the distro binary. This will override the existing command.
1172
1105
Command []string `json:"command,omitempty"`
1173
1106
@@ -1179,6 +1112,12 @@ type DistroContainerEnabled struct {
1179
1112
// Enabled signals this container should be enabled.
1180
1113
Enabled bool `json:"enabled,omitempty"`
1181
1114
1115
+ // Image is the distro image
1116
+ Image Image `json:"image,omitempty"`
1117
+
1118
+ // ImagePullPolicy is the pull policy for the distro image
1119
+ ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
1120
+
1182
1121
// Command is the command to start the distro binary. This will override the existing command.
1183
1122
Command []string `json:"command,omitempty"`
1184
1123
@@ -1286,47 +1225,18 @@ type Etcd struct {
1286
1225
1287
1226
// Deploy defines to use an external etcd that is deployed by the helm chart
1288
1227
Deploy EtcdDeploy `json:"deploy,omitempty"`
1289
-
1290
- // External defines to use a self-hosted external etcd that is not deployed by the helm chart
1291
- External EtcdExternal `json:"external,omitempty"`
1292
1228
}
1293
1229
1294
1230
func (e Etcd ) JSONSchemaExtend (base * jsonschema.Schema ) {
1295
1231
addProToJSONSchema (base , reflect .TypeOf (e ))
1296
1232
}
1297
1233
1298
- type EtcdExternal struct {
1299
- // Enabled defines if the external etcd should be used.
1300
- Enabled bool `json:"enabled,omitempty"`
1301
-
1302
- // Endpoint holds the endpoint of the external etcd server, e.g. my-example-service:2379
1303
- Endpoint string `json:"endpoint,omitempty"`
1304
-
1305
- // TLS defines the tls configuration for the external etcd server
1306
- TLS EtcdExternalTLS `json:"tls,omitempty"`
1307
- }
1308
-
1309
- // EtcdExternalTLS defines tls for external etcd server
1310
- type EtcdExternalTLS struct {
1311
- // CaFile is the path to the ca file
1312
- CaFile string `json:"caFile,omitempty"`
1313
-
1314
- // CertFile is the path to the cert file
1315
- CertFile string `json:"certFile,omitempty"`
1316
-
1317
- // KeyFile is the path to the key file
1318
- KeyFile string `json:"keyFile,omitempty"`
1319
- }
1320
-
1321
1234
type EtcdEmbedded struct {
1322
1235
// Enabled defines if the embedded etcd should be used.
1323
1236
Enabled bool `json:"enabled,omitempty" product:"pro"`
1324
1237
1325
1238
// MigrateFromDeployedEtcd signals that vCluster should migrate from the deployed external etcd to embedded etcd.
1326
1239
MigrateFromDeployedEtcd bool `json:"migrateFromDeployedEtcd,omitempty"`
1327
-
1328
- // SnapshotCount defines the number of snapshots to keep for the embedded etcd. Defaults to 10000 if less than 1.
1329
- SnapshotCount int `json:"snapshotCount,omitempty"`
1330
1240
}
1331
1241
1332
1242
func (e EtcdEmbedded ) JSONSchemaExtend (base * jsonschema.Schema ) {
@@ -1818,18 +1728,9 @@ type NetworkPolicy struct {
1818
1728
// Enabled defines if the network policy should be deployed by vCluster.
1819
1729
Enabled bool `json:"enabled,omitempty"`
1820
1730
1821
- // FallbackDNS is the fallback DNS server to use if the virtual cluster does not have a DNS server.
1822
- FallbackDNS string `json:"fallbackDns,omitempty"`
1823
-
1824
- // OutgoingConnections are the outgoing connections options for the vCluster workloads.
1731
+ FallbackDNS string `json:"fallbackDns,omitempty"`
1825
1732
OutgoingConnections OutgoingConnections `json:"outgoingConnections,omitempty"`
1826
1733
1827
- // ExtraControlPlaneRules are extra allowed rules for the vCluster control plane.
1828
- ExtraControlPlaneRules []map [string ]interface {} `json:"extraControlPlaneRules,omitempty"`
1829
-
1830
- // ExtraWorkloadRules are extra allowed rules for the vCluster workloads.
1831
- ExtraWorkloadRules []map [string ]interface {} `json:"extraWorkloadRules,omitempty"`
1832
-
1833
1734
LabelsAndAnnotations `json:",inline"`
1834
1735
}
1835
1736
@@ -2072,6 +1973,9 @@ type Experimental struct {
2072
1973
// DenyProxyRequests denies certain requests in the vCluster proxy.
2073
1974
DenyProxyRequests []DenyRule `json:"denyProxyRequests,omitempty" product:"pro"`
2074
1975
1976
+ // SleepMode holds the native sleep mode configuration for Pro clusters
1977
+ SleepMode * SleepMode `json:"sleepMode,omitempty"`
1978
+
2075
1979
// ReuseNamespace allows reusing the same namespace to create multiple vClusters.
2076
1980
// This flag is deprecated, as this scenario will be removed entirely in upcoming releases.
2077
1981
ReuseNamespace bool `json:"reuseNamespace,omitempty"`
@@ -2500,8 +2404,6 @@ type SleepMode struct {
2500
2404
TimeZone string `json:"timeZone,omitempty"`
2501
2405
// AutoSleep holds autoSleep details
2502
2406
AutoSleep SleepModeAutoSleep `json:"autoSleep,omitempty"`
2503
- // AutoWakeup holds configuration for waking the vCluster on a schedule rather than waiting for some activity.
2504
- AutoWakeup AutoWakeup `json:"autoWakeup,omitempty"`
2505
2407
}
2506
2408
2507
2409
// SleepModeAutoSleep holds configuration for allowing a vCluster to sleep its workloads
@@ -2513,6 +2415,9 @@ type SleepModeAutoSleep struct {
2513
2415
// Schedule represents a cron schedule for when to sleep workloads
2514
2416
Schedule string `json:"schedule,omitempty"`
2515
2417
2418
+ // Wakeup holds configuration for waking the vCluster on a schedule rather than waiting for some activity.
2419
+ Wakeup AutoWakeup `json:"wakeup,omitempty"`
2420
+
2516
2421
// Exclude holds configuration for labels that, if present, will prevent a workload from going to sleep
2517
2422
Exclude AutoSleepExclusion `json:"exclude,omitempty"`
2518
2423
}
0 commit comments