...
1 package types
2
3 import (
4 "time"
5
6 "edge-infra.dev/pkg/edge/api/graph/model"
7 "edge-infra.dev/pkg/sds/ien/k8s/controllers/nodeagent/plugins/networking/netplan"
8 )
9
10 type TerminalBootstrapConfig struct {
11 FirstNode bool `yaml:"first_node"`
12 Role model.TerminalRoleType `yaml:"role"`
13 GrubUser string `yaml:"grub_user"`
14 Registry string `yaml:"registry"`
15 EdgeRegistries EdgeRegistries `yaml:"edge_registries"`
16 Hostname string `yaml:"hostname"`
17 NtpServers []string `yaml:"ntp_servers"`
18 VipAddress string `yaml:"vip_address"`
19 Netplan *netplan.Config `yaml:"netplan"`
20 BreakGlassHash string `yaml:"zylevel0_hash"`
21 GrubHash string `yaml:"grub_hash"`
22 BootstrapAck bool `yaml:"ack_bootstrap"`
23 Swap Swap `yaml:"swap"`
24
25 KubeadmConfig KubeadmConfig `yaml:"kubeadm-config"`
26 PodSubnet string `yaml:"pod_subnet"`
27 ServiceSubnet string `yaml:"service_subnet"`
28 NcrEdge `yaml:"ncr-edge,omitempty"`
29 DiskOptions `yaml:"disk_options"`
30 PrimaryInterface `yaml:"primary_interface,omitempty"`
31
32 Network `yaml:"network"`
33 BootstrapInfo `yaml:"bootstrap_info,omitempty"`
34 }
35
36 type EdgeRegistries struct {
37 Public []string `yaml:"public"`
38 Private []string `yaml:"private"`
39 }
40
41 type NcrEdge struct {
42 EdgeInfraVersion string `yaml:"edge-infra-version"`
43 NcrEdgeParams `yaml:"parameters"`
44 BootstrapPayload `yaml:"bootstrap-payload"`
45 }
46
47 type NcrEdgeParams struct {
48 ClusterEdgeID string `yaml:"cluster-edge-id"`
49 Organization string `yaml:"organization"`
50 UploadCaHash string `yaml:"upload-ca-hash"`
51 APIEndpoint string `yaml:"api-endpoint,omitempty"`
52 Token string `yaml:"token"`
53 }
54
55 type DiskOptions struct {
56 PersistentVolume `yaml:"pv"`
57 }
58
59 type BootstrapPayload struct {
60 ClusterEdgeID string `yaml:"clusterEdgeId"`
61 ClusterCaHash *string `yaml:"clusterCaHash,omitempty"`
62 Force *bool `yaml:"force,omitempty"`
63 }
64
65 type PersistentVolume struct {
66 Disks []Disks `yaml:"disks,omitempty"`
67 DiscoverDisks model.TerminalDiscoverDisksType `yaml:"discover_disks"`
68 BootDisk *string `yaml:"boot_disk,omitempty"`
69 ExistingEfiPart *string `yaml:"existing_efi_part,omitempty"`
70 }
71
72 type Disks struct {
73 DevicePath string `yaml:"device_path"`
74 ExpectEmpty bool `yaml:"expect_empty"`
75 IncludeDisk bool `yaml:"include"`
76 UsePart bool `yaml:"use_part"`
77 }
78
79 type KubeadmConfig struct {
80 KubeadmClusterConfig KubeadmClusterConfig `yaml:"kubeadm-cluster-config"`
81 KubeadmInitConfig *KubeadmInitConfig `yaml:"kubeadm-init-config,omitempty"`
82 KubeadmJoinConfig *KubeadmJoinConfig `yaml:"kubeadm-join-config,omitempty"`
83 }
84
85 type KubeadmClusterConfig struct {
86 APIVersion string `yaml:"apiVersion"`
87 ImageRepository string `yaml:"imageRepository"`
88 Kind string `yaml:"kind"`
89 KubernetesVersion string `yaml:"kubernetesVersion"`
90 ControlPlaneEndpoint string `yaml:"controlPlaneEndpoint"`
91 Networking KubeadmNetworkingConfig `yaml:"networking"`
92 Etcd KubeadmEtcdConfig `yaml:"etcd"`
93 }
94
95 type KubeadmNetworkingConfig struct {
96 ServiceSubnet string `yaml:"serviceSubnet"`
97 PodSubnet string `yaml:"podSubnet"`
98 }
99
100 type KubeadmEtcdConfig struct {
101 Local KubeadmEtcdLocal `yaml:"local"`
102 }
103
104 type KubeadmEtcdLocal struct {
105 ExtraArgs KubeadmEtcdExtraArgs `yaml:"extraArgs"`
106 }
107
108 type KubeadmEtcdExtraArgs struct {
109 AutoCompactionMode string `yaml:"auto-compaction-mode"`
110 AutoCompactionRetention string `yaml:"auto-compaction-retention"`
111 ListenMetricsURLs string `yaml:"listen-metrics-urls"`
112 }
113
114 type KubeadmInitConfig struct {
115 APIVersion string `yaml:"apiVersion"`
116 Kind string `yaml:"kind"`
117 NodeRegistration KubeadmNodeRegistration `yaml:"nodeRegistration"`
118 }
119
120 type KubeadmJoinConfig struct {
121 APIVersion string `yaml:"apiVersion"`
122 Kind string `yaml:"kind"`
123 Discovery KubeadmDiscovery `yaml:"discovery"`
124 NodeRegistration KubeadmNodeRegistration `yaml:"nodeRegistration"`
125 }
126
127 type KubeadmNodeRegistration struct {
128 Taints []string `yaml:"taints"`
129 }
130
131 type KubeadmDiscovery struct {
132 BootstrapToken KubeadmBootstrapToken `yaml:"bootstrapToken"`
133 }
134
135 type KubeadmBootstrapToken struct {
136 Token string `yaml:"token"`
137 APIServerEndpoint string `yaml:"apiServerEndpoint"`
138 CaCertHashes []string `yaml:"caCertHashes"`
139 }
140
141 type PrimaryInterface struct {
142 ID string `yaml:"id"`
143 Macs []string `yaml:"macs"`
144 }
145
146 type ClusterBootstrapToken struct {
147 SecretName string
148 ExpireAt time.Time
149 }
150
151
152 type Network struct {
153 ServiceSubnetCIDR string `yaml:"service_subnet_cidr,omitempty"`
154 PodSubnetCIDR string `yaml:"pod_subnet_cidr,omitempty"`
155 }
156
157 type BootstrapInfo struct {
158 ClusterCaHash string `yaml:"cluster_ca_hash,omitempty"`
159 JoinToken string `yaml:"join_token,omitempty"`
160 }
161
162 type Swap struct {
163 Enabled bool `yaml:"enabled"`
164 }
165
View as plain text