-
Notifications
You must be signed in to change notification settings - Fork 156
/
types.go
1689 lines (1437 loc) · 75.7 KB
/
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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Copyright 2020 The Kubermatic Kubernetes Platform contributors.
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 v2
import (
"time"
constrainttemplatesv1 "github.com/open-policy-agent/frameworks/constraint/pkg/apis/templates/v1"
apiv1 "k8c.io/kubermatic/v2/pkg/api/v1"
appskubermaticv1 "k8c.io/kubermatic/v2/pkg/apis/apps.kubermatic/v1"
kubermaticv1 "k8c.io/kubermatic/v2/pkg/apis/kubermatic/v1"
ksemver "k8c.io/kubermatic/v2/pkg/semver"
corev1 "k8s.io/api/core/v1"
)
// ConstraintTemplate represents a gatekeeper ConstraintTemplate
// swagger:model ConstraintTemplate
type ConstraintTemplate struct {
Name string `json:"name"`
Spec kubermaticv1.ConstraintTemplateSpec `json:"spec"`
Status constrainttemplatesv1.ConstraintTemplateStatus `json:"status"`
}
// Constraint represents a gatekeeper Constraint
// swagger:model Constraint
type Constraint struct {
Name string `json:"name"`
Labels map[string]string `json:"labels,omitempty"`
Spec kubermaticv1.ConstraintSpec `json:"spec"`
Status *ConstraintStatus `json:"status,omitempty"`
}
// ConstraintStatus represents a constraint status which holds audit info.
type ConstraintStatus struct {
Enforcement string `json:"enforcement,omitempty"`
AuditTimestamp string `json:"auditTimestamp,omitempty"`
Violations []Violation `json:"violations,omitempty"`
Synced *bool `json:"synced,omitempty"`
}
// Violation represents a gatekeeper constraint violation.
type Violation struct {
EnforcementAction string `json:"enforcementAction,omitempty"`
Kind string `json:"kind,omitempty"`
Message string `json:"message,omitempty"`
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,omitempty"`
}
// GatekeeperConfig represents a gatekeeper config
// swagger:model GatekeeperConfig
type GatekeeperConfig struct {
Spec GatekeeperConfigSpec `json:"spec"`
}
type GatekeeperConfigSpec struct {
// Configuration for syncing k8s objects
Sync Sync `json:"sync,omitempty"`
// Configuration for validation
Validation Validation `json:"validation,omitempty"`
// Configuration for namespace exclusion
Match []MatchEntry `json:"match,omitempty"`
// Configuration for readiness tracker
Readiness ReadinessSpec `json:"readiness,omitempty"`
}
type Sync struct {
// If non-empty, entries on this list will be replicated into OPA
SyncOnly []GVK `json:"syncOnly,omitempty"`
}
type Validation struct {
// List of requests to trace. Both "user" and "kinds" must be specified
Traces []Trace `json:"traces,omitempty"`
}
type Trace struct {
// Only trace requests from the specified user
User string `json:"user,omitempty"`
// Only trace requests of the following GroupVersionKind
Kind GVK `json:"kind,omitempty"`
// Also dump the state of OPA with the trace. Set to `All` to dump everything.
Dump string `json:"dump,omitempty"`
}
type MatchEntry struct {
// Namespaces which will be excluded
ExcludedNamespaces []string `json:"excludedNamespaces,omitempty"`
// Processes which will be excluded in the given namespaces (sync, webhook, audit, *)
Processes []string `json:"processes,omitempty"`
}
type ReadinessSpec struct {
// enables stats for gatekeeper audit
StatsEnabled bool `json:"statsEnabled,omitempty"`
}
// GVK group version kind of a resource.
type GVK struct {
Group string `json:"group,omitempty"`
Version string `json:"version,omitempty"`
Kind string `json:"kind,omitempty"`
}
// PresetList represents a list of presets
// swagger:model PresetList
type PresetList struct {
Items []Preset `json:"items"`
}
// Preset represents a preset
// swagger:model Preset
type Preset struct {
Name string `json:"name"`
Enabled bool `json:"enabled"`
Providers []PresetProvider `json:"providers"`
}
// PresetBody represents the body of a created preset
// swagger:model PresetBody
type PresetBody struct {
PresetBodyMetadata `json:"metadata,omitempty"`
Spec kubermaticv1.PresetSpec `json:"spec"`
}
// PresetBodyMetadata represents metadata within the body of a created preset
// swagger:model PresetBodyMetadata
type PresetBodyMetadata struct {
Name string `json:"name,omitempty"`
}
// PresetProvider represents a preset provider
// swagger:model PresetProvider
type PresetProvider struct {
Name kubermaticv1.ProviderType `json:"name"`
Enabled bool `json:"enabled"`
}
// PresetStats represents a preset statistics
// swagger:model PresetStats
type PresetStats struct {
AssociatedClusters int `json:"associatedClusters"`
AssociatedClusterTemplates int `json:"associatedClusterTemplates"`
}
// Alertmanager represents an Alertmanager Configuration
// swagger:model Alertmanager
type Alertmanager struct {
Spec AlertmanagerSpec `json:"spec"`
}
type AlertmanagerSpec struct {
// Config contains the alertmanager configuration in YAML
Config []byte `json:"config"`
}
// SeedSettings represents settings for a Seed cluster
// swagger:model SeedSettings
type SeedSettings struct {
// the Seed level MLA (Monitoring, Logging, and Alerting) stack settings
MLA MLA `json:"mla"`
// the Seed level metering settings
Metering kubermaticv1.MeteringConfiguration `json:"metering"`
// the Seed level seed dns overwrite
SeedDNSOverwrite string `json:"seedDNSOverwrite,omitempty"`
}
type MLA struct {
// whether the user cluster MLA (Monitoring, Logging & Alerting) stack is enabled in the seed
UserClusterMLAEnabled bool `json:"user_cluster_mla_enabled"`
}
// ClusterTemplate represents a ClusterTemplate object
// swagger:model ClusterTemplate
type ClusterTemplate struct {
apiv1.ObjectMeta
Name string `json:"name"`
ID string `json:"id,omitempty"`
ProjectID string `json:"projectID,omitempty"`
User string `json:"user,omitempty"`
Scope string `json:"scope"`
UserSSHKeys []ClusterTemplateSSHKey `json:"userSshKeys,omitempty"`
Cluster *ClusterTemplateInfo `json:"cluster,omitempty"`
NodeDeployment *ClusterTemplateNodeDeployment `json:"nodeDeployment,omitempty"`
Applications []apiv1.Application `json:"applications,omitempty"`
}
// ClusterTemplateInfo represents a ClusterTemplateInfo object.
type ClusterTemplateInfo struct {
Labels map[string]string `json:"labels,omitempty"`
InheritedLabels map[string]string `json:"inheritedLabels,omitempty"`
// indicates the preset name
Credential string `json:"credential,omitempty"`
Spec apiv1.ClusterSpec `json:"spec"`
}
type ClusterTemplateNodeDeployment struct {
Spec apiv1.NodeDeploymentSpec `json:"spec"`
}
// ClusterTemplateSSHKey represents SSH Key object for Cluster Template
// swagger:model ClusterTemplateSSHKey
type ClusterTemplateSSHKey struct {
Name string `json:"name"`
ID string `json:"id"`
}
// ClusterTemplateList represents a ClusterTemplate list
// swagger:model ClusterTemplateList
type ClusterTemplateList []ClusterTemplate
// ClusterTemplateInstance represents a ClusterTemplateInstance object
// swagger:model ClusterTemplateInstance
type ClusterTemplateInstance struct {
Name string `json:"name"`
Spec kubermaticv1.ClusterTemplateInstanceSpec `json:"spec"`
}
// RuleGroup represents a rule group of recording and alerting rules.
// swagger:model RuleGroup
type RuleGroup struct {
Name string `json:"name"`
// IsDefault indicates whether the ruleGroup is default
IsDefault bool `json:"isDefault,omitempty"`
// contains the RuleGroup data. Ref: https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/#rule_group
Data []byte `json:"data"`
// the type of this ruleGroup applies to. It can be `Metrics`.
Type kubermaticv1.RuleGroupType `json:"type"`
}
// AllowedRegistry represents a object containing a allowed image registry prefix
// swagger:model AllowedRegistry
type AllowedRegistry struct {
Name string `json:"name"`
Spec kubermaticv1.AllowedRegistrySpec `json:"spec"`
}
// EtcdBackupConfig represents an object holding the configuration for etcd backups
// swagger:model EtcdBackupConfig
type EtcdBackupConfig struct {
apiv1.ObjectMeta
Spec EtcdBackupConfigSpec `json:"spec"`
Status EtcdBackupConfigStatus `json:"status"`
}
type EtcdBackupConfigStatus struct {
// CurrentBackups tracks the creation and deletion progress if all backups managed by the EtcdBackupConfig
CurrentBackups []BackupStatus `json:"lastBackups,omitempty"`
// Conditions contains conditions of the EtcdBackupConfig
Conditions []EtcdBackupConfigCondition `json:"conditions,omitempty"`
// If the controller was configured with a cleanupContainer, CleanupRunning keeps track of the corresponding job
CleanupRunning bool `json:"cleanupRunning,omitempty"`
}
type BackupStatus struct {
// ScheduledTime will always be set when the BackupStatus is created, so it'll never be nil
ScheduledTime *apiv1.Time `json:"scheduledTime,omitempty"`
BackupName string `json:"backupName,omitempty"`
JobName string `json:"jobName,omitempty"`
BackupStartTime *apiv1.Time `json:"backupStartTime,omitempty"`
BackupFinishedTime *apiv1.Time `json:"backupFinishedTime,omitempty"`
BackupPhase kubermaticv1.BackupStatusPhase `json:"backupPhase,omitempty"`
BackupMessage string `json:"backupMessage,omitempty"`
DeleteJobName string `json:"deleteJobName,omitempty"`
DeleteStartTime *apiv1.Time `json:"deleteStartTime,omitempty"`
DeleteFinishedTime *apiv1.Time `json:"deleteFinishedTime,omitempty"`
DeletePhase kubermaticv1.BackupStatusPhase `json:"deletePhase,omitempty"`
DeleteMessage string `json:"deleteMessage,omitempty"`
}
type EtcdBackupConfigCondition struct {
// Type of EtcdBackupConfig condition.
Type kubermaticv1.EtcdBackupConfigConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
// Last time we got an update on a given condition.
// +optional
LastHeartbeatTime apiv1.Time `json:"lastHeartbeatTime,omitempty"`
// Last time the condition transit from one status to another.
// +optional
LastTransitionTime apiv1.Time `json:"lastTransitionTime,omitempty"`
// (brief) reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// Human readable message indicating details about last transition.
// +optional
Message string `json:"message,omitempty"`
}
// EtcdBackupConfigSpec represents an object holding the etcd backup configuration specification
// swagger:model EtcdBackupConfigSpec
type EtcdBackupConfigSpec struct {
// ClusterID is the id of the cluster which will be backed up
ClusterID string `json:"clusterId"`
// Schedule is a cron expression defining when to perform
// the backup. If not set, the backup is performed exactly
// once, immediately.
Schedule string `json:"schedule,omitempty"`
// Keep is the number of backups to keep around before deleting the oldest one
// If not set, defaults to DefaultKeptBackupsCount. Only used if Schedule is set.
Keep *int `json:"keep,omitempty"`
// Destination indicates where the backup will be stored. The destination name should correspond to a destination in
// the cluster's Seed.Spec.EtcdBackupRestore.
Destination string `json:"destination,omitempty"`
}
// EtcdRestore represents an object holding the configuration for etcd backup restore
// swagger:model EtcdRestore
type EtcdRestore struct {
apiv1.ObjectMeta
Name string `json:"name"`
Spec EtcdRestoreSpec `json:"spec"`
Status EtcdRestoreStatus `json:"status"`
}
type EtcdRestoreStatus struct {
Phase kubermaticv1.EtcdRestorePhase `json:"phase"`
RestoreTime *apiv1.Time `json:"restoreTime,omitempty"`
}
// EtcdRestoreSpec represents an object holding the etcd backup restore configuration specification
// swagger:model EtcdRestoreSpec
type EtcdRestoreSpec struct {
// ClusterID is the id of the cluster which will be restored from the backup
ClusterID string `json:"clusterId"`
// BackupName is the name of the backup to restore from
BackupName string `json:"backupName"`
// BackupDownloadCredentialsSecret is the name of a secret in the cluster-xxx namespace containing
// credentials needed to download the backup
BackupDownloadCredentialsSecret string `json:"backupDownloadCredentialsSecret,omitempty"`
// Destination indicates where the backup was stored. The destination name should correspond to a destination in
// the cluster's Seed.Spec.EtcdBackupRestore.
Destination string `json:"destination,omitempty"`
}
// OIDCSpec contains OIDC params that can be used to access user cluster.
// swagger:model OIDCSpec
type OIDCSpec struct {
IssuerURL string `json:"issuerUrl,omitempty"`
ClientID string `json:"clientId,omitempty"`
ClientSecret string `json:"clientSecret,omitempty"`
}
// BackupCredentials contains credentials for etcd backups
// swagger:model BackupCredentials
type BackupCredentials struct {
// S3BackupCredentials holds credentials for a S3 client compatible backup destination
S3BackupCredentials S3BackupCredentials `json:"s3,omitempty"`
// Destination corresponds to the Seeds Seed.Spec.EtcdBackupRestore.Destinations, it defines for which destination
// the backup credentials will be created. If set, it updates the credentials ref in the related Seed BackupDestination
Destination string `json:"destination,omitempty"`
}
// S3BackupCredentials contains credentials for S3 etcd backups
// swagger:model S3BackupCredentials
type S3BackupCredentials struct {
AccessKeyID string `json:"accessKeyId,omitempty"`
SecretAccessKey string `json:"secretAccessKey,omitempty"`
}
// MLAAdminSetting represents an object holding admin setting options for user cluster MLA (Monitoring, Logging and Alerting).
// swagger:model MLAAdminSetting
type MLAAdminSetting struct {
// MonitoringRateLimits contains rate-limiting configuration for monitoring in the user cluster.
MonitoringRateLimits *kubermaticv1.MonitoringRateLimitSettings `json:"monitoringRateLimits,omitempty"`
// LoggingRateLimits contains rate-limiting configuration logging in the user cluster.
LoggingRateLimits *kubermaticv1.LoggingRateLimitSettings `json:"loggingRateLimits,omitempty"`
}
// ExternalCluster represents an object holding cluster details
// swagger:model ExternalCluster
type ExternalCluster struct {
apiv1.ObjectMeta `json:",inline"`
Labels map[string]string `json:"labels,omitempty"`
Spec ExternalClusterSpec `json:"spec,omitempty"`
Cloud *ExternalClusterCloudSpec `json:"cloud,omitempty"`
Status ExternalClusterStatus `json:"status"`
}
type ExternalClusterState string
type ExternalClusterMDState string
const (
// ProvisioningExternalClusterState state indicates the cluster is being created.
ProvisioningExternalClusterState ExternalClusterState = "Provisioning"
// StoppedExternalClusterState state indicates the cluster is stopped, this state is specific to AKS clusters.
StoppedExternalClusterState ExternalClusterState = "Stopped"
// StoppingExternalClusterState state indicates the cluster is stopping, this state is specific to AKS clusters.
StoppingExternalClusterState ExternalClusterState = "Stopping"
// RunningExternalClusterState state indicates the cluster has been created and is fully usable.
RunningExternalClusterState ExternalClusterState = "Running"
// ReconcilingExternalClusterState state indicates that some work is actively being done on the cluster, such as upgrading the master or
// node software. Details can be found in the `StatusMessage` field.
ReconcilingExternalClusterState ExternalClusterState = "Reconciling"
// DeletingExternalClusterState state indicates the cluster is being deleted.
DeletingExternalClusterState ExternalClusterState = "Deleting"
// UnknownExternalClusterState indicates undefined state.
UnknownExternalClusterState ExternalClusterState = "Unknown"
// ErrorExternalClusterState state indicates the cluster is unusable. It will be automatically deleted. Details can be found in the
// `statusMessage` field.
ErrorExternalClusterState ExternalClusterState = "Error"
)
const (
// ProvisioningExternalClusterMDState state indicates the cluster machine dedeployment is being created.
ProvisioningExternalClusterMDState ExternalClusterMDState = "Provisioning"
// RunningExternalClusterMDState state indicates the cluster machine dedeployment has been created and is fully usable.
RunningExternalClusterMDState ExternalClusterMDState = "Running"
// ReconcilingExternalClusterMDState state indicates that some work is actively being done on the machine dedeployment, such as upgrading the master or
// node software. Details can be found in the `StatusMessage` field.
ReconcilingExternalClusterMDState ExternalClusterMDState = "Reconciling"
// DeletingExternalClusterMDState state indicates the machine dedeployment is being deleted.
DeletingExternalClusterMDState ExternalClusterMDState = "Deleting"
// UnknownExternalClusterMDState indicates undefined state.
UnknownExternalClusterMDState ExternalClusterMDState = "Unknown"
// ErrorExternalClusterMDState state indicates the machine dedeployment is unusable. It will be automatically deleted. Details can be found in the
// `statusMessage` field.
ErrorExternalClusterMDState ExternalClusterMDState = "Error"
)
// ExternalClusterStatus defines the external cluster status.
type ExternalClusterStatus struct {
State ExternalClusterState `json:"state"`
StatusMessage string `json:"statusMessage,omitempty"`
}
// ExternalClusterSpec defines the external cluster specification.
type ExternalClusterSpec struct {
// Version desired version of the kubernetes master components
Version ksemver.Semver `json:"version,omitempty"`
GKEClusterSpec *GKEClusterSpec `json:"gkeclusterSpec,omitempty"`
EKSClusterSpec *EKSClusterSpec `json:"eksclusterSpec,omitempty"`
AKSClusterSpec *AKSClusterSpec `json:"aksclusterSpec,omitempty"`
}
// ExternalClusterCloudSpec represents an object holding cluster cloud details
// swagger:model ExternalClusterCloudSpec
type ExternalClusterCloudSpec struct {
GKE *GKECloudSpec `json:"gke,omitempty"`
EKS *EKSCloudSpec `json:"eks,omitempty"`
AKS *AKSCloudSpec `json:"aks,omitempty"`
KubeOne *KubeOneSpec `json:"kubeOne,omitempty"`
BringYourOwn *BringYourOwnSpec `json:"bringYourOwn,omitempty"`
}
type BringYourOwnSpec struct{}
type KubeOneSpec struct {
// Manifest Base64 encoded manifest
Manifest string `json:"manifest,omitempty"`
SSHKey KubeOneSSHKey `json:"sshKey,omitempty"`
ContainerRuntime string `json:"containerRuntime,omitempty"`
CloudSpec *KubeOneCloudSpec `json:"cloudSpec,omitempty"`
}
// SSHKeySpec represents the details of a ssh key.
type KubeOneSSHKey struct {
// PrivateKey Base64 encoded privateKey
PrivateKey string `json:"privateKey,omitempty"`
Passphrase string `json:"passphrase,omitempty"`
}
type KubeOneCloudSpec struct {
AWS *KubeOneAWSCloudSpec `json:"aws,omitempty"`
GCP *KubeOneGCPCloudSpec `json:"gcp,omitempty"`
Azure *KubeOneAzureCloudSpec `json:"azure,omitempty"`
DigitalOcean *KubeOneDigitalOceanCloudSpec `json:"digitalocean,omitempty"`
OpenStack *KubeOneOpenStackCloudSpec `json:"openstack,omitempty"`
Equinix *KubeOneEquinixCloudSpec `json:"equinix,omitempty"`
Hetzner *KubeOneHetznerCloudSpec `json:"hetzner,omitempty"`
VSphere *KubeOneVSphereCloudSpec `json:"vsphere,omitempty"`
VMwareCloudDirector *KubeOneVMwareCloudDirectorCloudSpec `json:"vmwareclouddirector,omitempty"`
Nutanix *KubeOneNutanixCloudSpec `json:"nutanix,omitempty"`
}
// KubeOneAWSCloudSpec specifies access data to Amazon Web Services.
type KubeOneAWSCloudSpec struct {
AccessKeyID string `json:"accessKeyID"`
SecretAccessKey string `json:"secretAccessKey"`
}
// KubeOneGCPCloudSpec specifies access data to GCP.
type KubeOneGCPCloudSpec struct {
ServiceAccount string `json:"serviceAccount"`
}
// KubeOneAzureCloudSpec specifies access credentials to Azure cloud.
type KubeOneAzureCloudSpec struct {
TenantID string `json:"tenantID"`
SubscriptionID string `json:"subscriptionID"`
ClientID string `json:"clientID"`
ClientSecret string `json:"clientSecret"`
}
// KubeOneDigitalOceanCloudSpec specifies access data to DigitalOcean.
type KubeOneDigitalOceanCloudSpec struct {
// Token is used to authenticate with the DigitalOcean API.
Token string `json:"token"`
}
// KubeOneOpenStackCloudSpec specifies access data to an OpenStack cloud.
type KubeOneOpenStackCloudSpec struct {
AuthURL string `json:"authURL"`
Username string `json:"username"`
Password string `json:"password"`
// Project, formally known as tenant.
Project string `json:"project"`
// ProjectID, formally known as tenantID.
ProjectID string `json:"projectID"`
Domain string `json:"domain"`
Region string `json:"region"`
}
// KubeOneVSphereCloudSpec credentials represents a credential for accessing vSphere.
type KubeOneVSphereCloudSpec struct {
Server string `json:"server"`
Username string `json:"username"`
Password string `json:"password"`
}
// KubeOneVMwareCloudDirectorCloudSpec represents credentials for accessing VMWare Cloud Director.
type KubeOneVMwareCloudDirectorCloudSpec struct {
URL string `json:"url"`
Username string `json:"username"`
Password string `json:"password"`
Organization string `json:"organization"`
VDC string `json:"vdc"`
}
// KubeOneEquinixCloudSpec specifies access data to a Equinix cloud.
type KubeOneEquinixCloudSpec struct {
APIKey string `json:"apiKey"`
ProjectID string `json:"projectID"`
}
// KubeOneHetznerCloudSpec specifies access data to hetzner cloud.
type KubeOneHetznerCloudSpec struct {
// Token is used to authenticate with the Hetzner cloud API.
Token string `json:"token"`
}
// KubeOneNutanixCloudSpec specifies the access data to Nutanix.
type KubeOneNutanixCloudSpec struct {
Username string `json:"username"`
Password string `json:"password"`
// Endpoint is the Nutanix API (Prism Central) endpoint
Endpoint string `json:"endpoint"`
// Port is the Nutanix API (Prism Central) port
Port string `json:"port"`
// PrismElementUsername to be used for the CSI driver
PrismElementUsername string `json:"elementUsername"`
// PrismElementPassword to be used for the CSI driver
PrismElementPassword string `json:"elementPassword"`
// PrismElementEndpoint to access Nutanix Prism Element for the CSI driver
PrismElementEndpoint string `json:"elementEndpoint"`
// ClusterName is the Nutanix cluster that this user cluster will be deployed to.
// +optional
ClusterName string `json:"clusterName,omitempty"`
AllowInsecure bool `json:"allowInsecure,omitempty"`
ProxyURL string `json:"proxyURL,omitempty"`
}
type GKECloudSpec struct {
Name string `json:"name"`
ServiceAccount string `json:"serviceAccount,omitempty"`
Zone string `json:"zone"`
}
type EKSCloudSpec struct {
Name string `json:"name"`
AccessKeyID string `json:"accessKeyID,omitempty" required:"true"`
SecretAccessKey string `json:"secretAccessKey,omitempty" required:"true"`
Region string `json:"region" required:"true"`
}
type EKSClusterSpec struct {
// The VPC configuration used by the cluster control plane. Amazon EKS VPC resources
// have specific requirements to work properly with Kubernetes. For more information,
// see Cluster VPC Considerations (https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html)
// and Cluster Security Group Considerations (https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html)
// in the Amazon EKS User Guide. You must specify at least two subnets. You
// can specify up to five security groups, but we recommend that you use a dedicated
// security group for your cluster control plane.
//
// ResourcesVpcConfig is a required field
ResourcesVpcConfig VpcConfigRequest `json:"vpcConfigRequest" required:"true"`
// The Kubernetes network configuration for the cluster.
KubernetesNetworkConfig *EKSKubernetesNetworkConfigResponse `json:"kubernetesNetworkConfig,omitempty"`
// The desired Kubernetes version for your cluster. If you don't specify a value
// here, the latest version available in Amazon EKS is used.
Version string `json:"version,omitempty"`
// The Unix epoch timestamp in seconds for when the cluster was created.
CreatedAt *time.Time `json:"createdAt,omitempty"`
// The metadata that you apply to the cluster to assist with categorization
// and organization. Each tag consists of a key and an optional value. You define
// both. Cluster tags do not propagate to any other resources associated with
// the cluster.
Tags map[string]*string `json:"tags,omitempty"`
// The Amazon Resource Name (ARN) of the IAM role that provides permissions
// for the Kubernetes control plane to make calls to AWS API operations on your
// behalf. For more information, see Amazon EKS Service IAM Role (https://docs.aws.amazon.com/eks/latest/userguide/service_IAM_role.html)
// in the Amazon EKS User Guide .
//
// RoleArn is a required field
RoleArn string `json:"roleArn,omitempty" required:"true"`
}
// The Kubernetes network configuration for the cluster. The response contains
// a value for serviceIpv6Cidr or serviceIpv4Cidr, but not both.
type EKSKubernetesNetworkConfigResponse struct {
// The IP family used to assign Kubernetes pod and service IP addresses. The
// IP family is always ipv4, unless you have a 1.21 or later cluster running
// version 1.10.1 or later of the Amazon VPC CNI add-on and specified ipv6 when
// you created the cluster.
IpFamily *string `json:"ipFamily,omitempty"`
// The CIDR block that Kubernetes pod and service IP addresses are assigned
// from. Kubernetes assigns addresses from an IPv4 CIDR block assigned to a
// subnet that the node is in. If you didn't specify a CIDR block when you created
// the cluster, then Kubernetes assigns addresses from either the 10.100.0.0/16
// or 172.20.0.0/16 CIDR blocks. If this was specified, then it was specified
// when the cluster was created and it can't be changed.
ServiceIpv4Cidr *string `json:"serviceIpv4Cidr,omitempty"`
// The CIDR block that Kubernetes pod and service IP addresses are assigned
// from if you created a 1.21 or later cluster with version 1.10.1 or later
// of the Amazon VPC CNI add-on and specified ipv6 for ipFamily when you created
// the cluster. Kubernetes assigns service addresses from the unique local address
// range (fc00::/7) because you can't specify a custom IPv6 CIDR block when
// you create the cluster.
ServiceIpv6Cidr *string `json:"serviceIpv6Cidr,omitempty"`
}
type AKSCloudSpec struct {
Name string `json:"name"`
TenantID string `json:"tenantID,omitempty" required:"true"`
SubscriptionID string `json:"subscriptionID,omitempty" required:"true"`
ClientID string `json:"clientID,omitempty" required:"true"`
ClientSecret string `json:"clientSecret,omitempty" required:"true"`
ResourceGroup string `json:"resourceGroup" required:"true"`
}
// AKSClusterSpec Azure Kubernetes Service cluster.
type AKSClusterSpec struct {
// Location - Resource location
Location string `json:"location" required:"true"`
// The timestamp of resource creation (UTC).
CreatedAt *time.Time `json:"createdAt,omitempty"`
// The identity that created the resource.
CreatedBy *string `json:"createdBy,omitempty"`
// KubernetesVersion - When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details.
KubernetesVersion string `json:"kubernetesVersion"`
// EnableRBAC - Whether Kubernetes Role-Based Access Control Enabled.
EnableRBAC bool `json:"enableRBAC,omitempty"`
// DNSPrefix - This cannot be updated once the Managed Cluster has been created.
DNSPrefix string `json:"dnsPrefix,omitempty"`
// FqdnSubdomain - This cannot be updated once the Managed Cluster has been created.
FqdnSubdomain string `json:"fqdnSubdomain,omitempty"`
// Fqdn - READ-ONLY; The FQDN of the master pool.
Fqdn string `json:"fqdn,omitempty"`
// PrivateFQDN - READ-ONLY; The FQDN of private cluster.
PrivateFQDN string `json:"privateFQDN,omitempty"`
// MachineDeploymentSpec - The agent pool properties.
MachineDeploymentSpec *AKSMachineDeploymentCloudSpec `json:"machineDeploymentSpec,omitempty"`
// NetworkProfile - The network configuration profile.
NetworkProfile AKSNetworkProfile `json:"networkProfile,omitempty"`
// Resource tags.
Tags map[string]*string `json:"tags,omitempty"`
}
// AKS NetworkProfile profile of network configuration.
type AKSNetworkProfile struct {
// PodCidr - A CIDR notation IP range from which to assign pod IPs when kubenet is used.
PodCidr string `json:"podCidr,omitempty"`
// ServiceCidr - A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges.
ServiceCidr string `json:"serviceCidr,omitempty"`
// DNSServiceIP - An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr.
DNSServiceIP string `json:"dnsServiceIP,omitempty"`
// DockerBridgeCidr - A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range.
DockerBridgeCidr string `json:"dockerBridgeCidr,omitempty"`
// NetworkPlugin - Network plugin used for building the Kubernetes network. Possible values include: 'Azure', 'Kubenet'
NetworkPlugin string `json:"networkPlugin,omitempty"`
// NetworkPolicy - Network policy used for building the Kubernetes network. Possible values include: 'Calico', 'Azure'
NetworkPolicy string `json:"networkPolicy,omitempty"`
// NetworkMode - This cannot be specified if networkPlugin is anything other than 'azure'. Possible values include: 'Transparent', 'Bridge'
NetworkMode string `json:"networkMode,omitempty"`
// OutboundType - This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). Possible values include: 'OutboundTypeLoadBalancer', 'OutboundTypeUserDefinedRouting', 'OutboundTypeManagedNATGateway', 'OutboundTypeUserAssignedNATGateway'
OutboundType string `json:"outboundType,omitempty"`
// LoadBalancerSku - The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more information about the differences between load balancer SKUs. Possible values include: 'LoadBalancerSkuStandard', 'LoadBalancerSkuBasic'
LoadBalancerSku string `json:"loadBalancerSku,omitempty"`
}
type VpcConfigRequest struct {
// The VPC associated with your cluster.
VpcId *string `json:"vpcId,omitempty"`
// Specify one or more security groups for the cross-account elastic network
// interfaces that Amazon EKS creates to use to allow communication between
// your nodes and the Kubernetes control plane.
// For more information, see Amazon EKS security group considerations (https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html)
// in the Amazon EKS User Guide .
SecurityGroupIds []*string `json:"securityGroupIds" required:"true"`
// Specify subnets for your Amazon EKS nodes. Amazon EKS creates cross-account
// elastic network interfaces in these subnets to allow communication between
// your nodes and the Kubernetes control plane.
SubnetIds []*string `json:"subnetIds" required:"true"`
}
// ExternalClusterNode represents an object holding external cluster node
// swagger:model ExternalClusterNode
type ExternalClusterNode struct {
apiv1.Node `json:",inline"`
}
// ExternalClusterMachineDeployment represents an object holding external cluster machine deployment
// swagger:model ExternalClusterMachineDeployment
type ExternalClusterMachineDeployment struct {
apiv1.NodeDeployment `json:",inline"`
Cloud *ExternalClusterMachineDeploymentCloudSpec `json:"cloud,omitempty"`
Phase ExternalClusterMDPhase `json:"phase"`
}
// ExternalClusterMDPhase defines the external cluster machinedeployment phase.
type ExternalClusterMDPhase struct {
State ExternalClusterMDState `json:"state"`
StatusMessage string `json:"statusMessage,omitempty"`
}
// GKECluster represents a object of GKE cluster.
// swagger:model GKECluster
type GKECluster struct {
Name string `json:"name"`
IsImported bool `json:"imported"`
Zone string `json:"zone"`
}
// GKEClusterList represents an array of GKE clusters.
// swagger:model GKEClusterList
type GKEClusterList []GKECluster
// GKEImage represents an object of GKE image.
// swagger:model GKEImage
type GKEImage struct {
Name string `json:"name"`
IsDefault bool `json:"default,omitempty"`
}
// GKEImageList represents an array of GKE images.
// swagger:model GKEImageList
type GKEImageList []GKEImage
// GKEDiskTypeList represents an array of GKE disk types.
// swagger:model GKEDiskTypeList
type GKEDiskTypeList []GKEDiskType
// GKEDiskType represents a object of GKE disk type.
// swagger:model GKEDiskType
type GKEDiskType struct {
// Name of the resource.
Name string `json:"name"`
// Description: An optional description of this resource.
Description string `json:"description,omitempty"`
// DefaultDiskSizeGb: Server-defined default disk size in GB.
DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty"`
// Kind: Type of the resource. Always compute#diskType for
// disk types.
Kind string `json:"kind,omitempty"`
}
// GKEZone represents a object of GKE zone.
// swagger:model GKEZone
type GKEZone struct {
Name string `json:"name"`
IsDefault bool `json:"default,omitempty"`
}
// GKEZoneList represents an array of GKE zones.
// swagger:model GKEZoneList
type GKEZoneList []GKEZone
// EKSCluster represents a object of EKS cluster.
// swagger:model EKSCluster
type EKSCluster struct {
Name string `json:"name"`
Region string `json:"region"`
IsImported bool `json:"imported"`
}
// EKSClusterList represents a list of EKS clusters.
// swagger:model EKSClusterList
type EKSClusterList []EKSCluster
// EKSRegionList represents a list of EKS regions.
// swagger:model EKSRegionList
type EKSRegionList []string
// EKSAMITypeList represents a list of EKS AMI Types for node group.
// swagger:model EKSAMITypeList
type EKSAMITypeList []string
// EKSCapacityTypeList represents a list of EKS Capacity Types for node group.
// swagger:model EKSCapacityTypeList
type EKSCapacityTypeList []string
// EKSInstanceTypeList represents a list of EKS InstanceType object for node group.
// swagger:model EKSInstanceTypeList
type EKSInstanceTypeList []EKSInstanceType
// EKSInstanceType is the object representing EKS nodegroup instancetype..
// swagger:model EKSInstanceType
type EKSInstanceType struct {
Name string `json:"name"`
PrettyName string `json:"pretty_name,omitempty"`
Memory float32 `json:"memory,omitempty"`
VCPUs int `json:"vcpus,omitempty"`
GPUs int `json:"gpus,omitempty"`
}
// EKSSubnetList represents an array of EKS subnet.
// swagger:model EKSSubnetList
type EKSSubnetList []EKSSubnet
// EKSSubnet represents a object of EKS subnet.
// swagger:model EKSSubnet
type EKSSubnet struct {
// The Availability Zone of the subnet.
AvailabilityZone string `json:"availabilityZone"`
// The ID of the subnet.
SubnetId string `json:"subnetId"`
// The ID of the VPC the subnet is in.
VpcId string `json:"vpcId"`
}
// EKSSecurityGroupList represents an array of EKS securityGroup.
// swagger:model EKSSecurityGroupList
type EKSSecurityGroupList []EKSSecurityGroup
// EKSSecurityGroup represents a object of EKS securityGroup.
// swagger:model EKSSecurityGroup
type EKSSecurityGroup struct {
// The ID of the security group.
GroupId string `json:"groupId"`
// [VPC only] The ID of the VPC for the security group.
VpcId string `json:"vpcId"`
}
// EKSVPCList represents an array of EKS VPC.
// swagger:model EKSVPCList
type EKSVPCList []EKSVPC
// EKSVPC represents a object of EKS VpcId.
// swagger:model EKSVPC
type EKSVPC struct {
ID string `json:"id"`
IsDefault bool `json:"default"`
}
// AKSCluster represents a object of AKS cluster.
// swagger:model AKSCluster
type AKSCluster struct {
Name string `json:"name"`
ResourceGroup string `json:"resourceGroup"`
IsImported bool `json:"imported"`
}
// AKSClusterList represents an list of AKS clusters.
// swagger:model AKSClusterList
type AKSClusterList []AKSCluster
// AKSVMSizeList represents an array of AKS VM sizes.
// swagger:model AKSVMSizeList
type AKSVMSizeList []AKSVMSize
// AKSLocationList represents a list of AKS Location object for node group.
// swagger:model AKSLocationList
type AKSLocationList []AKSLocation
// AKSLocation is the object representing Azure Location.
// swagger:model AKSLocation
type AKSLocation struct {
// The location name.
Name string `json:"name,omitempty"`
// READ-ONLY; The category of the region.
RegionCategory string `json:"regionCategory,omitempty"`
}
// AKSVMSize is the object representing Azure VM sizes.
// swagger:model AKSVMSize
type AKSVMSize struct {
Name string `json:"name,omitempty"`
NumberOfCores int32 `json:"numberOfCores,omitempty"`
NumberOfGPUs int32 `json:"numberOfGPUs,omitempty"`
OsDiskSizeInMB int32 `json:"osDiskSizeInMB,omitempty"`
ResourceDiskSizeInMB int32 `json:"resourceDiskSizeInMB,omitempty"`
MemoryInMB int32 `json:"memoryInMB,omitempty"`
MaxDataDiskCount int32 `json:"maxDataDiskCount,omitempty"`
}
// AKSNodePoolModes represents nodepool modes.
// swagger:model AKSNodePoolModes
type AKSNodePoolModes []string
// FeatureGates represents an object holding feature gate settings
// swagger:model FeatureGates
type FeatureGates struct {
KonnectivityService *bool `json:"konnectivityService,omitempty"`
OIDCKubeCfgEndpoint *bool `json:"oidcKubeCfgEndpoint,omitempty"`
OperatingSystemManager *bool `json:"operatingSystemManager,omitempty"`
}
// ExternalClusterMachineDeploymentCloudSpec represents an object holding machine deployment cloud details.
// swagger:model ExternalClusterMachineDeploymentCloudSpec
type ExternalClusterMachineDeploymentCloudSpec struct {
GKE *GKEMachineDeploymentCloudSpec `json:"gke,omitempty"`
AKS *AKSMachineDeploymentCloudSpec `json:"aks,omitempty"`
EKS *EKSMachineDeploymentCloudSpec `json:"eks,omitempty"`
}
type EKSMachineDeploymentCloudSpec struct {
// The Unix epoch timestamp in seconds for when the managed node group was created.
CreatedAt time.Time `json:"createdAt,omitempty"`
// The subnets to use for the Auto Scaling group that is created for your node
// group. These subnets must have the tag key kubernetes.io/cluster/CLUSTER_NAME
// with a value of shared, where CLUSTER_NAME is replaced with the name of your
// cluster. If you specify launchTemplate, then don't specify SubnetId (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html)
// in your launch template, or the node group deployment will fail. For more
// information about using launch templates with Amazon EKS, see Launch template
// support (https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html)
// in the Amazon EKS User Guide.
//
// Subnets is a required field
Subnets []*string `json:"subnets" required:"true"`
// The Amazon Resource Name (ARN) of the IAM role to associate with your node
// group. The Amazon EKS worker node kubelet daemon makes calls to AWS APIs
// on your behalf. Nodes receive permissions for these API calls through an
// IAM instance profile and associated policies. Before you can launch nodes
// and register them into a cluster, you must create an IAM role for those nodes
// to use when they are launched. For more information, see Amazon EKS node
// IAM role (https://docs.aws.amazon.com/eks/latest/userguide/worker_node_IAM_role.html)
// in the Amazon EKS User Guide . If you specify launchTemplate, then don't
// specify IamInstanceProfile (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IamInstanceProfile.html)
// in your launch template, or the node group deployment will fail. For more
// information about using launch templates with Amazon EKS, see Launch template
// support (https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html)
// in the Amazon EKS User Guide.
//