This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 522
/
azenvtypes.go
341 lines (310 loc) · 17.3 KB
/
azenvtypes.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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
package api
import "fmt"
//AzureEnvironmentSpecConfig is the overall configuration differences in different cloud environments.
type AzureEnvironmentSpecConfig struct {
CloudName string `json:"cloudName,omitempty"`
DockerSpecConfig DockerSpecConfig `json:"dockerSpecConfig,omitempty"`
KubernetesSpecConfig KubernetesSpecConfig `json:"kubernetesSpecConfig,omitempty"`
DCOSSpecConfig DCOSSpecConfig `json:"-"`
EndpointConfig AzureEndpointConfig `json:"endpointConfig,omitempty"`
OSImageConfig map[Distro]AzureOSImageConfig `json:"osImageConfig,omitempty"`
}
//DockerSpecConfig is the configurations of docker
type DockerSpecConfig struct {
DockerEngineRepo string `json:"dockerEngineRepo,omitempty"`
DockerComposeDownloadURL string `json:"dockerComposeDownloadURL,omitempty"`
}
//DCOSSpecConfig is the configurations of DCOS
type DCOSSpecConfig struct {
DCOS188BootstrapDownloadURL string
DCOS190BootstrapDownloadURL string
DCOS198BootstrapDownloadURL string
DCOS110BootstrapDownloadURL string
DCOS111BootstrapDownloadURL string
DCOSWindowsBootstrapDownloadURL string
DcosRepositoryURL string // For custom install, for example CI, need these three addributes
DcosClusterPackageListID string // the id of the package list file
DcosProviderPackageID string // the id of the dcos-provider-xxx package
}
//KubernetesSpecConfig is the kubernetes container images used.
type KubernetesSpecConfig struct {
AzureTelemetryPID string `json:"azureTelemetryPID,omitempty"`
// KubernetesImageBase defines a base image URL substring to source images that originate from upstream k8s.gcr.io
KubernetesImageBase string `json:"kubernetesImageBase,omitempty"`
TillerImageBase string `json:"tillerImageBase,omitempty"`
ACIConnectorImageBase string `json:"aciConnectorImageBase,omitempty"`
// MCRKubernetesImageBase defines a base image URL substring to source MS-curated images that originate from MCR
MCRKubernetesImageBase string `json:"mcrKubernetesImageBase,omitempty"`
NVIDIAImageBase string `json:"nvidiaImageBase,omitempty"`
AzureCNIImageBase string `json:"azureCNIImageBase,omitempty"`
CalicoImageBase string `json:"CalicoImageBase,omitempty"`
EtcdDownloadURLBase string `json:"etcdDownloadURLBase,omitempty"`
KubeBinariesSASURLBase string `json:"kubeBinariesSASURLBase,omitempty"`
WindowsTelemetryGUID string `json:"windowsTelemetryGUID,omitempty"`
CNIPluginsDownloadURL string `json:"cniPluginsDownloadURL,omitempty"`
VnetCNILinuxPluginsDownloadURL string `json:"vnetCNILinuxPluginsDownloadURL,omitempty"`
VnetCNIWindowsPluginsDownloadURL string `json:"vnetCNIWindowsPluginsDownloadURL,omitempty"`
ContainerdDownloadURLBase string `json:"containerdDownloadURLBase,omitempty"`
CSIProxyDownloadURL string `json:"csiProxyDownloadURL,omitempty"`
WindowsProvisioningScriptsPackageURL string `json:"windowsProvisioningScriptsPackageURL,omitempty"`
WindowsPauseImageURL string `json:"windowsPauseImageURL,omitempty"`
AlwaysPullWindowsPauseImage bool `json:"alwaysPullWindowsPauseImage,omitempty"`
}
//AzureEndpointConfig describes an Azure endpoint
type AzureEndpointConfig struct {
ResourceManagerVMDNSSuffix string `json:"resourceManagerVMDNSSuffix,omitempty"`
}
//AzureOSImageConfig describes an Azure OS image
type AzureOSImageConfig struct {
ImageOffer string `json:"imageOffer,omitempty"`
ImageSku string `json:"imageSku,omitempty"`
ImagePublisher string `json:"imagePublisher,omitempty"`
ImageVersion string `json:"imageVersion,omitempty"`
}
// AzureTelemetryPID represents the current telemetry ID
// See more information here https://docs.microsoft.com/en-us/azure/marketplace/azure-partner-customer-usage-attribution
// PID is maintained to keep consistent with Azure Stack Telemetry Terminologies
type AzureTelemetryPID string
const (
// DefaultAzureStackDeployTelemetryPID tracking ID for Deployment
DefaultAzureStackDeployTelemetryPID = "pid-1bda96ec-adf4-4eea-bb9a-8462de5475c0"
// DefaultAzureStackScaleTelemetryPID tracking ID for Scale
DefaultAzureStackScaleTelemetryPID = "pid-bbbafa53-d6a7-4022-84a2-86fcbaec7030"
// DefaultAzureStackUpgradeTelemetryPID tracking ID for Upgrade
DefaultAzureStackUpgradeTelemetryPID = "pid-0d9b5198-7cd7-4252-a890-5658eaf874be"
)
var (
//DefaultKubernetesSpecConfig is the default Docker image source of Kubernetes
DefaultKubernetesSpecConfig = KubernetesSpecConfig{
KubernetesImageBase: "k8s.gcr.io/",
TillerImageBase: "mcr.microsoft.com/",
ACIConnectorImageBase: "microsoft/",
NVIDIAImageBase: "mcr.microsoft.com/",
CalicoImageBase: "calico/",
AzureCNIImageBase: "mcr.microsoft.com/containernetworking/",
MCRKubernetesImageBase: "mcr.microsoft.com/",
EtcdDownloadURLBase: "mcr.microsoft.com/oss/etcd-io/",
KubeBinariesSASURLBase: "https://kubernetesartifacts.azureedge.net/kubernetes/",
WindowsTelemetryGUID: "fb801154-36b9-41bc-89c2-f4d4f05472b0",
CNIPluginsDownloadURL: "https://kubernetesartifacts.azureedge.net/cni-plugins/" + CNIPluginVer + "/binaries/cni-plugins-linux-amd64-" + CNIPluginVer + ".tgz",
VnetCNILinuxPluginsDownloadURL: "https://kubernetesartifacts.azureedge.net/azure-cni/" + AzureCniPluginVerLinux + "/binaries/azure-vnet-cni-linux-amd64-" + AzureCniPluginVerLinux + ".tgz",
VnetCNIWindowsPluginsDownloadURL: "https://kubernetesartifacts.azureedge.net/azure-cni/" + AzureCniPluginVerWindows + "/binaries/azure-vnet-cni-singletenancy-windows-amd64-" + AzureCniPluginVerWindows + ".zip",
ContainerdDownloadURLBase: "https://storage.googleapis.com/cri-containerd-release/",
CSIProxyDownloadURL: "https://kubernetesartifacts.azureedge.net/csi-proxy/v0.1.0/binaries/csi-proxy.tar.gz",
WindowsProvisioningScriptsPackageURL: "https://kubernetesartifacts.azureedge.net/aks-engine/windows/provisioning/signedscripts-" + DefaultWindowsProvisioningScriptsPackageVersion + ".zip",
WindowsPauseImageURL: "mcr.microsoft.com/oss/kubernetes/pause:" + WindowsPauseImageVersion,
AlwaysPullWindowsPauseImage: DefaultAlwaysPullWindowsPauseImage,
}
//DefaultDCOSSpecConfig is the default DC/OS binary download URL.
DefaultDCOSSpecConfig = DCOSSpecConfig{
DCOS188BootstrapDownloadURL: fmt.Sprintf(AzureEdgeDCOSBootstrapDownloadURL, "stable", "5df43052907c021eeb5de145419a3da1898c58a5"),
DCOS190BootstrapDownloadURL: fmt.Sprintf(AzureEdgeDCOSBootstrapDownloadURL, "stable", "58fd0833ce81b6244fc73bf65b5deb43217b0bd7"),
DCOS198BootstrapDownloadURL: fmt.Sprintf(AzureEdgeDCOSBootstrapDownloadURL, "stable/1.9.8", "f4ae0d20665fc68ee25282d6f78681b2773c6e10"),
DCOS110BootstrapDownloadURL: fmt.Sprintf(AzureEdgeDCOSBootstrapDownloadURL, "stable/1.10.0", "4d92536e7381176206e71ee15b5ffe454439920c"),
DCOS111BootstrapDownloadURL: fmt.Sprintf(AzureEdgeDCOSBootstrapDownloadURL, "stable/1.11.0", "a0654657903fb68dff60f6e522a7f241c1bfbf0f"),
DCOSWindowsBootstrapDownloadURL: "http://dcos-win.westus.cloudapp.azure.com/dcos-windows/stable/",
DcosRepositoryURL: "https://dcosio.azureedge.net/dcos/stable/1.11.0",
DcosClusterPackageListID: "248a66388bba1adbcb14a52fd3b7b424ab06fa76",
}
//DefaultDockerSpecConfig is the default Docker engine repo.
DefaultDockerSpecConfig = DockerSpecConfig{
DockerEngineRepo: "https://aptdocker.azureedge.net/repo",
DockerComposeDownloadURL: "https://github.com/docker/compose/releases/download",
}
//Ubuntu1604OSImageConfig is the default Linux distribution.
Ubuntu1604OSImageConfig = AzureOSImageConfig{
ImageOffer: "UbuntuServer",
ImageSku: "16.04-LTS",
ImagePublisher: "Canonical",
ImageVersion: "latest",
}
//Ubuntu1804OSImageConfig is the Ubunutu 18.04-LTS Linux distribution.
Ubuntu1804OSImageConfig = AzureOSImageConfig{
ImageOffer: "UbuntuServer",
ImageSku: "18.04-LTS",
ImagePublisher: "Canonical",
ImageVersion: "latest",
}
//Ubuntu1804Gen2OSImageConfig is Gen2 flavor the Ubunutu 18.04-LTS Linux distribution.
Ubuntu1804Gen2OSImageConfig = AzureOSImageConfig{
ImageOffer: "UbuntuServer",
ImageSku: "18_04-lts-gen2",
ImagePublisher: "Canonical",
ImageVersion: "latest",
}
//RHELOSImageConfig is the RHEL Linux distribution.
RHELOSImageConfig = AzureOSImageConfig{
ImageOffer: "RHEL",
ImageSku: "7.3",
ImagePublisher: "RedHat",
ImageVersion: "latest",
}
//FlatcarImageConfig is the Flatcar Linux distribution.
FlatcarImageConfig = AzureOSImageConfig{
ImageOffer: "flatcar-container-linux-free",
ImageSku: "stable",
ImagePublisher: "kinvolk",
ImageVersion: "latest",
}
// AKSUbuntu1604OSImageConfig is the AKS image based on Ubuntu 16.04-LTS.
AKSUbuntu1604OSImageConfig = AzureOSImageConfig{
ImageOffer: "aks",
ImageSku: "aks-engine-ubuntu-1604-202007",
ImagePublisher: "microsoft-aks",
ImageVersion: "2020.08.24",
}
// AKSUbuntu1804OSImageConfig is the AKS image based on Ubuntu 18.04-LTS.
AKSUbuntu1804OSImageConfig = AzureOSImageConfig{
ImageOffer: "aks",
ImageSku: "aks-engine-ubuntu-1804-202007",
ImagePublisher: "microsoft-aks",
ImageVersion: "2020.08.24",
}
// AKSWindowsServer2019OSImageConfig is the AKS image based on Windows Server 2019
AKSWindowsServer2019OSImageConfig = AzureOSImageConfig{
ImageOffer: "aks-windows",
ImageSku: "2019-datacenter-core-smalldisk-2008",
ImagePublisher: "microsoft-aks",
ImageVersion: "17763.1397.200820",
}
// WindowsServer2019OSImageConfig is the 'vanilla' Windows Server 2019 image
WindowsServer2019OSImageConfig = AzureOSImageConfig{
ImageOffer: "WindowsServer",
ImageSku: "2019-Datacenter-Core-with-Containers-smalldisk",
ImagePublisher: "MicrosoftWindowsServer",
ImageVersion: "17763.1397.2008070242",
}
// ACC1604OSImageConfig is the ACC image based on Ubuntu 16.04.
ACC1604OSImageConfig = AzureOSImageConfig{
ImageOffer: "confidential-compute-preview",
ImageSku: "16.04-LTS",
ImagePublisher: "Canonical",
ImageVersion: "latest",
}
//AzureCloudSpec is the default configurations for global azure.
AzureCloudSpec = AzureEnvironmentSpecConfig{
CloudName: AzurePublicCloud,
//DockerSpecConfig specify the docker engine download repo
DockerSpecConfig: DefaultDockerSpecConfig,
//KubernetesSpecConfig is the default kubernetes container image url.
KubernetesSpecConfig: DefaultKubernetesSpecConfig,
DCOSSpecConfig: DefaultDCOSSpecConfig,
EndpointConfig: AzureEndpointConfig{
ResourceManagerVMDNSSuffix: "cloudapp.azure.com",
},
OSImageConfig: map[Distro]AzureOSImageConfig{
Ubuntu: Ubuntu1604OSImageConfig,
Ubuntu1804: Ubuntu1804OSImageConfig,
Ubuntu1804Gen2: Ubuntu1804Gen2OSImageConfig,
RHEL: RHELOSImageConfig,
Flatcar: FlatcarImageConfig,
AKSUbuntu1604: AKSUbuntu1604OSImageConfig,
AKS1604Deprecated: AKSUbuntu1604OSImageConfig, // for back-compat
AKSUbuntu1804: AKSUbuntu1804OSImageConfig,
AKS1804Deprecated: AKSUbuntu1804OSImageConfig, // for back-compat
ACC1604: ACC1604OSImageConfig,
},
}
//AzureGermanCloudSpec is the German cloud config.
AzureGermanCloudSpec = AzureEnvironmentSpecConfig{
CloudName: AzureGermanCloud,
DockerSpecConfig: DefaultDockerSpecConfig,
KubernetesSpecConfig: DefaultKubernetesSpecConfig,
DCOSSpecConfig: DefaultDCOSSpecConfig,
EndpointConfig: AzureEndpointConfig{
ResourceManagerVMDNSSuffix: "cloudapp.microsoftazure.de",
},
OSImageConfig: map[Distro]AzureOSImageConfig{
Ubuntu: Ubuntu1604OSImageConfig,
Ubuntu1804: Ubuntu1804OSImageConfig,
Ubuntu1804Gen2: Ubuntu1804Gen2OSImageConfig,
RHEL: RHELOSImageConfig,
Flatcar: FlatcarImageConfig,
AKSUbuntu1604: Ubuntu1604OSImageConfig,
AKS1604Deprecated: Ubuntu1604OSImageConfig, // for back-compat
AKSUbuntu1804: Ubuntu1604OSImageConfig, // workaround for https://github.com/Azure/aks-engine/issues/761
AKS1804Deprecated: Ubuntu1604OSImageConfig, // for back-compat
},
}
//AzureUSGovernmentCloudSpec is the US government config.
AzureUSGovernmentCloudSpec = AzureEnvironmentSpecConfig{
CloudName: AzureUSGovernmentCloud,
DockerSpecConfig: DefaultDockerSpecConfig,
KubernetesSpecConfig: DefaultKubernetesSpecConfig,
DCOSSpecConfig: DefaultDCOSSpecConfig,
EndpointConfig: AzureEndpointConfig{
ResourceManagerVMDNSSuffix: "cloudapp.usgovcloudapi.net",
},
OSImageConfig: map[Distro]AzureOSImageConfig{
Ubuntu: Ubuntu1604OSImageConfig,
Ubuntu1804: Ubuntu1804OSImageConfig,
Ubuntu1804Gen2: Ubuntu1804Gen2OSImageConfig,
RHEL: RHELOSImageConfig,
Flatcar: FlatcarImageConfig,
AKSUbuntu1604: AKSUbuntu1604OSImageConfig,
AKS1604Deprecated: AKSUbuntu1604OSImageConfig, // for back-compat
AKSUbuntu1804: AKSUbuntu1804OSImageConfig,
AKS1804Deprecated: AKSUbuntu1804OSImageConfig, // for back-compat
},
}
//AzureChinaCloudSpec is the configurations for Azure China (Mooncake)
AzureChinaCloudSpec = AzureEnvironmentSpecConfig{
CloudName: AzureChinaCloud,
//DockerSpecConfig specify the docker engine download repo
DockerSpecConfig: DockerSpecConfig{
DockerEngineRepo: "https://mirror.azk8s.cn/docker-engine/apt/repo/",
DockerComposeDownloadURL: "https://mirror.azk8s.cn/docker-toolbox/linux/compose",
},
//KubernetesSpecConfig - Due to Chinese firewall issue, the default containers from google is blocked, use the Chinese local mirror instead
KubernetesSpecConfig: KubernetesSpecConfig{
KubernetesImageBase: "gcr.azk8s.cn/google_containers/",
TillerImageBase: "mcr.microsoft.com/",
ACIConnectorImageBase: "dockerhub.azk8s.cn/microsoft/",
NVIDIAImageBase: "dockerhub.azk8s.cn/nvidia/",
AzureCNIImageBase: "mcr.azk8s.cn/containernetworking/",
MCRKubernetesImageBase: "mcr.microsoft.com/",
CalicoImageBase: "dockerhub.azk8s.cn/calico/",
EtcdDownloadURLBase: "mcr.microsoft.com/oss/etcd-io/",
// Keep the global default value since mirror for AzureChinaCloud does not have the binaries
KubeBinariesSASURLBase: DefaultKubernetesSpecConfig.KubeBinariesSASURLBase,
WindowsTelemetryGUID: DefaultKubernetesSpecConfig.WindowsTelemetryGUID,
CNIPluginsDownloadURL: "https://mirror.azk8s.cn/kubernetes/containernetworking-plugins/cni-plugins-linux-amd64-" + CNIPluginVer + ".tgz",
VnetCNILinuxPluginsDownloadURL: "https://mirror.azk8s.cn/azure-cni/" + AzureCniPluginVerLinux + "/binaries/azure-vnet-cni-linux-amd64-" + AzureCniPluginVerLinux + ".tgz",
VnetCNIWindowsPluginsDownloadURL: "https://mirror.azk8s.cn/azure-cni/" + AzureCniPluginVerWindows + "/binaries/azure-vnet-cni-singletenancy-windows-amd64-" + AzureCniPluginVerWindows + ".zip",
ContainerdDownloadURLBase: "https://mirror.azk8s.cn/kubernetes/containerd/",
CSIProxyDownloadURL: "https://mirror.azk8s.cn/csi-proxy/v0.1.0/binaries/csi-proxy.tar.gz",
WindowsProvisioningScriptsPackageURL: "https://mirror.azk8s.cn/aks-engine/windows/provisioning/signedscripts-" + DefaultWindowsProvisioningScriptsPackageVersion + ".zip",
WindowsPauseImageURL: "mcr.microsoft.com/oss/kubernetes/pause:" + WindowsPauseImageVersion,
AlwaysPullWindowsPauseImage: DefaultAlwaysPullWindowsPauseImage,
},
DCOSSpecConfig: DCOSSpecConfig{
DCOS188BootstrapDownloadURL: fmt.Sprintf(AzureChinaCloudDCOSBootstrapDownloadURL, "5df43052907c021eeb5de145419a3da1898c58a5"),
DCOSWindowsBootstrapDownloadURL: "https://dcosdevstorage.blob.core.windows.net/dcos-windows",
DCOS190BootstrapDownloadURL: fmt.Sprintf(AzureChinaCloudDCOSBootstrapDownloadURL, "58fd0833ce81b6244fc73bf65b5deb43217b0bd7"),
DCOS198BootstrapDownloadURL: fmt.Sprintf(AzureChinaCloudDCOSBootstrapDownloadURL, "f4ae0d20665fc68ee25282d6f78681b2773c6e10"),
},
EndpointConfig: AzureEndpointConfig{
ResourceManagerVMDNSSuffix: "cloudapp.chinacloudapi.cn",
},
OSImageConfig: map[Distro]AzureOSImageConfig{
Ubuntu: Ubuntu1604OSImageConfig,
Ubuntu1804: Ubuntu1804OSImageConfig,
Ubuntu1804Gen2: Ubuntu1804Gen2OSImageConfig,
RHEL: RHELOSImageConfig,
Flatcar: FlatcarImageConfig,
AKSUbuntu1604: AKSUbuntu1604OSImageConfig,
AKS1604Deprecated: AKSUbuntu1604OSImageConfig, // for back-compat
AKSUbuntu1804: AKSUbuntu1804OSImageConfig,
AKS1804Deprecated: AKSUbuntu1804OSImageConfig, // for back-compat
},
}
// AzureCloudSpecEnvMap is the environment configuration map for all the Azure cloud environments.
AzureCloudSpecEnvMap = map[string]AzureEnvironmentSpecConfig{
AzureChinaCloud: AzureChinaCloudSpec,
AzureGermanCloud: AzureGermanCloudSpec,
AzureUSGovernmentCloud: AzureUSGovernmentCloudSpec,
AzurePublicCloud: AzureCloudSpec,
}
)