refactor: remove unsupported orchestrators (#3965)

This commit is contained in:
Matt Boersma 2020-11-14 11:11:02 -07:00 коммит произвёл GitHub
Родитель 4026cdba2e
Коммит 04f7ff84ee
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
126 изменённых файлов: 49 добавлений и 22315 удалений

Просмотреть файл

@ -37,6 +37,5 @@ ignore:
- "pkg/armhelpers/mockclients.go"
- "pkg/engine/testutils.go"
- "pkg/test/*.go"
- "pkg/engine/engine_dcos.go"
- "pkg/engine/templates_generated.go"
- "pkg/i18n/translations_generated.go"

Просмотреть файл

@ -2,10 +2,10 @@
## 概览
微软容器服务引擎(`aks-engine`用于将一个容器集群描述文件转化成一组ARMAzure Resource Manager模板通过在Azure上部署这些模板用户可以很方便地在Azure上建立一套基于Docker的容器服务集群。用户可以自由地选择集群编排引擎DC/OS, Kubernetes或者是Swarm/Swarm Mode。集群描述文件使用和ARM模板相同的语法它们都可以用来部署Azure容器服务。
微软容器服务引擎(`aks-engine`用于将一个容器集群描述文件转化成一组ARMAzure Resource Manager模板通过在Azure上部署这些模板用户可以很方便地在Azure上建立一套基于Docker的容器服务集群。用户可以自由地选择集群编排引擎DC/OS, Kubernetes或者是Swarm。集群描述文件使用和ARM模板相同的语法它们都可以用来部署Azure容器服务。
集群描述文件提供了一下几个功能:
* 可以自由选择DC/OS, Kubernetes, Swarm Mode和Swarm等多种编排引擎
* 可以自由选择DC/OS, Kubernetes和Swarm等多种编排引擎
* 可以自由定制集群节点的规格,包括:
* 虚机的规格
* 节点的数量
@ -18,10 +18,7 @@
* [AKS Engine](docs/aksengine.md) - 演示如何使用ACS引擎来生成基于Docker的容器集群
* [Cluster Definition](docs/clusterdefinition.md) - 详细介绍集群描述文件的格式
* [DC/OS Walkthrough](docs/dcos.md) - 演示如何使用ACS引擎在Azure上创建DC/OS集群
* [Kubernetes Walkthrough](docs/kubernetes.md) - 演示如何使用ACS引擎在Azure上创建Kubernetes集群
* [Swarm Walkthrough](docs/swarm.md) - 演示如何使用ACS引擎在Azure上创建Swarm集群
* [Swarm Mode Walkthrough](docs/swarmmode.md) - 演示如何使用ACS引擎在Azure上创建Swarm Mode集群
* [Custom VNET](examples/vnet) - 演示如何在用户自定义VNET上创建容器集群
* [Attached Disks](examples/disks-storageaccount) - 演示如何在一个集群节点上创建4个磁盘
* [Managed Disks](examples/disks-managed) - 演示如何管理托管磁盘

Просмотреть файл

@ -20,10 +20,7 @@
可选的编排引擎如下所示:
1. `DCOS` - 指定编排引擎为 [DC/OS编排引擎](dcos.md)。
2. `Kubernetes` - 指定编排引擎为 [Kubernetes编排引擎](kubernetes.md)。
3. `Swarm` - 指定编排引擎为 [Swarm编排引擎](swarm.md)。
4. `Swarm Mode` - 指定编排引擎为 [Swarm Mode编排引擎](swarmmode.md)。
1. `Kubernetes` - 指定编排引擎为 [Kubernetes编排引擎](kubernetes.md)。
### masterProfile
`masterProfile` 指定了集群中master节点的各种配置。
@ -107,10 +104,7 @@
可选的编排引擎如下所示:
1. `DCOS` - 指定编排引擎为 [DC/OS编排引擎](dcos.md)。
2. `Swarm` - 指定编排引擎为 [Swarm编排引擎](swarm.md)。
3. `Kubernetes` - 指定编排引擎为 [Kubernetes编排引擎](kubernetes.md)。
4. `Swarm Mode` - 指定编排引擎为 [Swarm Mode编排引擎](swarmmode.md)。
1. `Kubernetes` - 指定编排引擎为 [Kubernetes编排引擎](kubernetes.md)。
### masterProfile
`masterProfile` 指定了集群中master节点的各种配置。

Просмотреть файл

@ -169,7 +169,7 @@ In order to install a preprovision extension, there are two required files - sup
|File Name|Description|
|-----------------------------|---|
|supported-orchestrators.json |Defines what orchestrators are supported by the extension (Swarm, Dcos, or Kubernetes)|
|supported-orchestrators.json |Defines what orchestrators are supported by the extension (Kubernetes)|
|template.json |The ARM template used to deploy the extension|
|template-link.json |The ARM template snippet which will be injected into azuredeploy.json to call template.json|
|EXTENSION-NAME.sh |The script file that will execute on the VM itself via Custom Script Extension to perform installation of the extension|

Просмотреть файл

@ -1,6 +1,6 @@
# 微软Azure容器服务引擎
微软容器服务引擎(`aks-engine`用于将一个容器集群描述文件转化成一组ARMAzure Resource Manager模板通过在Azure上部署这些模板用户可以很方便地在Azure上建立一套基于Docker的容器服务集群。用户可以自由地选择集群编排引擎DC/OS, Kubernetes或者是Swarm/Swarm Mode。集群描述文件使用和ARM模板相同的语法它们都可以用来部署Azure容器服务。
微软容器服务引擎(`aks-engine`用于将一个容器集群描述文件转化成一组ARMAzure Resource Manager模板通过在Azure上部署这些模板用户可以很方便地在Azure上建立一套基于Docker的容器服务集群。用户可以自由地选择集群编排引擎DC/OS, Kubernetes或者是。集群描述文件使用和ARM模板相同的语法它们都可以用来部署Azure容器服务。
# 基于Docker的部署

Просмотреть файл

@ -1,87 +0,0 @@
bootcmd:
- bash -c "if [ ! -f /var/lib/sdb-gpt ];then echo DCOS-5890;parted -s /dev/sdb mklabel
gpt;touch /var/lib/sdb-gpt;fi"
disk_setup:
ephemeral0:
layout:
- 50
- 50
overwrite: true
table_type: gpt
fs_setup:
- device: ephemeral0.1
filesystem: ext4
overwrite: true
- device: ephemeral0.2
filesystem: ext4
overwrite: true
mounts:
- - ephemeral0.1
- /var/lib/mesos
- - ephemeral0.2
- /var/lib/docker
runcmd:
- [ ln, -s, /bin/rm, /usr/bin/rm ]
- [ ln, -s, /bin/mkdir, /usr/bin/mkdir ]
- [ ln, -s, /bin/tar, /usr/bin/tar ]
- [ ln, -s, /bin/ln, /usr/bin/ln ]
- [ ln, -s, /bin/cp, /usr/bin/cp ]
- [ ln, -s, /bin/systemctl, /usr/bin/systemctl ]
- [ ln, -s, /bin/mount, /usr/bin/mount ]
- [ ln, -s, /bin/bash, /usr/bin/bash ]
- [ ln, -s, /usr/sbin/useradd, /usr/bin/useradd ]
- /opt/azure/containers/provision.sh
- /opt/azure/dcos/init_bootstrap.sh
write_files:
- content: |
DCOS_ENVIRONMENT={{{targetEnvironment}}}
owner: root
path: /opt/azure/dcos/environment
permissions: '0644'
- content: |
#!/bin/sh
curl -H Metadata:true -fsSL "http://169.254.169.254/metadata/instance/network/interface/0/ipv4/ipAddress/0/privateIpAddress?api-version=2017-04-02&format=text"
owner: root
path: /opt/azure/dcos/genconf/ip-detect
permissions: '0755'
- content: |
bootstrap_url: http://BOOTSTRAP_IP:8086
cluster_name: azure-dcos
exhibitor_storage_backend: static
master_discovery: static
oauth_enabled: BOOTSTRAP_OAUTH_ENABLED
ip_detect_public_filename: genconf/ip-detect
master_list:
MASTER_IP_LIST
resolvers:
- 168.63.129.16
dns_search:
owner: root
path: /opt/azure/dcos/genconf/config.yaml
permissions: '0644'
- content: |
#!/bin/bash
source /opt/azure/containers/provision_source.sh
# update dns_search
dns=$(grep search /etc/resolv.conf | cut -d " " -f 2)
sed -i "/dns_search:/c dns_search: $dns" /opt/azure/dcos/genconf/config.yaml
# install and run bootstrap package
cd /opt/azure/dcos
retrycmd_if_failure 10 10 120 curl -fsSL -o dcos_generate_config.sh.sha1sum {{{dcosBootstrapURL}}}.sha1sum
retry_download 1 1 120 {{{dcosBootstrapURL}}} dcos_generate_config.sh $(cat dcos_generate_config.sh.sha1sum)
bash dcos_generate_config.sh
docker run -d -p 8086:80 -v $PWD/genconf/serve:/usr/share/nginx/html:ro nginx
owner: root
path: /opt/azure/dcos/init_bootstrap.sh
permissions: '0755'
- content: 'PROVISION_SOURCE_STR'
path: /opt/azure/containers/provision_source.sh
permissions: "0744"
owner: "root"
- content: 'PROVISION_STR'
path: /opt/azure/containers/provision.sh
permissions: "0744"
owner: "root"

Просмотреть файл

@ -1,149 +0,0 @@
"linuxAdminUsername": {
"metadata": {
"description": "User name for the Linux Virtual Machines (SSH or Password)."
},
"type": "string"
},
{{range .ExtensionProfiles}}
"{{.Name}}Parameters": {
"metadata": {
"description": "Parameters for the extension"
},
"type": "securestring"
},
{{end}}
"bootstrapStaticIP": {
"metadata": {
"description": "Sets the static IP of the first bootstrap"
},
"type": "string"
},
"bootstrapVMSize": {
{{GetMasterAllowedSizes}}
"metadata": {
"description": "The size of the Virtual Machine."
},
"type": "string"
},
"sshRSAPublicKey": {
"metadata": {
"description": "SSH public key used for auth to all Linux machines. Not Required. If not set, you must provide a password key."
},
"type": "string"
},
"nameSuffix": {
"defaultValue": "{{GetUniqueNameSuffix}}",
"metadata": {
"description": "A string hash of the bootstrap DNS name to uniquely identify the cluster."
},
"type": "string"
},
"osImageName": {
"defaultValue": "",
"metadata": {
"description": "Name of a Linux OS image. Needs to be used in conjuction with osImageResourceGroup."
},
"type": "string"
},
"osImageResourceGroup": {
"defaultValue": "",
"metadata": {
"description": "Resource group of a Linux OS image. Needs to be used in conjuction with osImageName."
},
"type": "string"
},
"osImageOffer": {
"defaultValue": "UbuntuServer",
"metadata": {
"description": "Linux OS image type."
},
"type": "string"
},
"osImagePublisher": {
"defaultValue": "Canonical",
"metadata": {
"description": "OS image publisher."
},
"type": "string"
},
"osImageSKU": {
"defaultValue": "16.04-LTS",
"metadata": {
"description": "OS image SKU."
},
"type": "string"
},
"osImageVersion": {
"defaultValue": "16.04.201804050",
"metadata": {
"description": "OS image version."
},
"type": "string"
},
"fqdnEndpointSuffix":{
"defaultValue": "cloudapp.azure.com",
"metadata": {
"description": "Endpoint of FQDN."
},
"type": "string"
},
"targetEnvironment": {
"defaultValue": "AzurePublicCloud",
"metadata": {
"description": "The azure deploy environment. Currently support: AzurePublicCloud, AzureChinaCloud"
},
"type": "string"
},
"location": {
"defaultValue": "{{GetLocation}}",
"metadata": {
"description": "Sets the location for all resources in the cluster"
},
"type": "string"
}
{{if .LinuxProfile.HasSecrets}}
{{range $vIndex, $vault := .LinuxProfile.Secrets}}
,
"linuxKeyVaultID{{$vIndex}}": {
"metadata": {
"description": "KeyVaultId{{$vIndex}} to install certificates from on linux machines."
},
"type": "string"
}
{{range $cIndex, $cert := $vault.VaultCertificates}}
,
"linuxKeyVaultID{{$vIndex}}CertificateURL{{$cIndex}}": {
"metadata": {
"description": "CertificateURL{{$cIndex}} to install from KeyVaultId{{$vIndex}} on linux machines."
},
"type": "string"
}
{{end}}
{{end}}
{{end}}
{{if .HasWindows}}{{if .WindowsProfile.HasSecrets}}
{{range $vIndex, $vault := .WindowsProfile.Secrets}}
,
"windowsKeyVaultID{{$vIndex}}": {
"metadata": {
"description": "KeyVaultId{{$vIndex}} to install certificates from on windows machines."
},
"type": "string"
}
{{range $cIndex, $cert := $vault.VaultCertificates}}
,
"windowsKeyVaultID{{$vIndex}}CertificateURL{{$cIndex}}": {
"metadata": {
"description": "Url to retrieve Certificate{{$cIndex}} from KeyVaultId{{$vIndex}} to install on windows machines."
},
"type": "string"
},
"windowsKeyVaultID{{$vIndex}}CertificateStore{{$cIndex}}": {
"metadata": {
"description": "CertificateStore to install Certificate{{$cIndex}} from KeyVaultId{{$vIndex}} on windows machines."
},
"type": "string"
}
{{end}}
{{end}}
{{end}} {{end}}

Просмотреть файл

@ -1,34 +0,0 @@
#!/bin/bash
source /opt/azure/containers/provision_source.sh
source /opt/azure/dcos/environment
# default dc/os component download address (Azure CDN)
packages=(
https://dcos-mirror.azureedge.net/pkg/libltdl7_2.4.6-0.1_amd64.deb
https://dcos-mirror.azureedge.net/pkg/docker-ce_17.09.0~ce-0~ubuntu_amd64.deb
)
# sha1sum checksums for @packages
sha1sums=(
9a0f9f2769d3dc834737aa7df50aaaea369af98d
94f6e89be6d45d9988269a237eb27c7d6a844d7f
)
case $DCOS_ENVIRONMENT in
# because of Chinese GreatWall Firewall, the default packages on Azure CDN is blocked. So the following Chinese local mirror url should be used instead.
AzureChinaCloud)
packages=(
http://acsengine.blob.core.chinacloudapi.cn/dcos/libltdl7_2.4.6-0.1_amd64.deb
http://mirror.kaiyuanshe.cn/docker-ce/linux/ubuntu/dists/xenial/pool/stable/amd64/docker-ce_17.09.0~ce-0~ubuntu_amd64.deb
)
;;
esac
len=$((${#packages[@]}-1))
for i in $(seq 0 $len); do
retry_get_install_deb 10 10 120 ${packages[$i]} ${sha1sums[$i]}
if [ $? -ne 0 ]; then
exit 1
fi
done

Просмотреть файл

@ -1,158 +0,0 @@
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('bootstrapNSGName')]",
"properties": {
"securityRules": [
{
"properties": {
"priority": 200,
"access": "Allow",
"direction": "Inbound",
"destinationPortRange": "22",
"sourcePortRange": "*",
"destinationAddressPrefix": "*",
"protocol": "Tcp",
"description": "Allow SSH",
"sourceAddressPrefix": "*"
},
"name": "ssh"
},
{
"properties": {
"priority": 201,
"access": "Allow",
"direction": "Inbound",
"destinationPortRange": "8086",
"sourcePortRange": "*",
"destinationAddressPrefix": "*",
"protocol": "Tcp",
"description": "Allow bootstrap service",
"sourceAddressPrefix": "*"
},
"name": "Port8086"
}
]
},
"type": "Microsoft.Network/networkSecurityGroups"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
{{if not .MasterProfile.IsCustomVNET}}
"[variables('vnetID')]",
{{end}}
"[variables('bootstrapNSGID')]"
],
"location": "[variables('location')]",
"name": "[concat(variables('bootstrapVMName'), '-nic')]",
"properties": {
"ipConfigurations": [
{
"name": "ipConfigNode",
"properties": {
"privateIPAddress": "[variables('bootstrapStaticIP')]",
"privateIPAllocationMethod": "Static",
"subnet": {
"id": "[variables('masterVnetSubnetID')]"
}
}
}
],
"networkSecurityGroup": {
"id": "[variables('bootstrapNSGID')]"
}
},
"type": "Microsoft.Network/networkInterfaces"
},
{
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('bootstrapVMName'), '-nic')]",
{{if .MasterProfile.IsStorageAccount}}
"[variables('masterStorageAccountName')]",
{{end}}
"[variables('masterStorageAccountExhibitorName')]"
],
"tags":
{
"creationSource": "[concat('acsengine-', variables('bootstrapVMName'))]",
"orchestratorName": "dcos",
"orchestratorVersion": "[variables('orchestratorVersion')]",
"orchestratorNode": "bootstrap"
},
"location": "[variables('location')]",
"name": "[variables('bootstrapVMName')]",
"properties": {
"hardwareProfile": {
"vmSize": "[variables('bootstrapVMSize')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('bootstrapVMName'), '-nic'))]"
}
]
},
"osProfile": {
"adminUsername": "[variables('adminUsername')]",
"computername": "[variables('bootstrapVMName')]",
{{GetDCOSBootstrapCustomData}}
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"keyData": "[variables('sshRSAPublicKey')]",
"path": "[variables('sshKeyPath')]"
}
]
}
}
{{if .LinuxProfile.HasSecrets}}
,
"secrets": "[variables('linuxProfileSecrets')]"
{{end}}
},
"storageProfile": {
"imageReference": {
"offer": "[variables('osImageOffer')]",
"publisher": "[variables('osImagePublisher')]",
"sku": "[variables('osImageSKU')]",
"version": "[variables('osImageVersion')]"
},
"osDisk": {
"caching": "ReadWrite"
,"createOption": "FromImage"
{{if .MasterProfile.IsStorageAccount}}
,"name": "[concat(variables('bootstrapVMName'), '-osdisk')]"
,"vhd": {
"uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('masterStorageAccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'vhds/',variables('bootstrapVMName'),-osdisk.vhd')]"
}
{{end}}
{{if ne .OrchestratorProfile.DcosConfig.BootstrapProfile.OSDiskSizeGB 0}}
,"diskSizeGB": "60"
{{end}}
}
}
},
"type": "Microsoft.Compute/virtualMachines"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', variables('bootstrapVMName'))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('bootstrapVMName'), '/bootstrapready')]",
"properties": {
"autoUpgradeMinorVersion": true,
"publisher": "Microsoft.OSTCExtensions",
"settings": {
"commandToExecute": "[concat('/bin/bash -c \"until curl -f http://', variables('bootstrapStaticIP'), ':8086/dcos_install.sh > /dev/null; do echo waiting for bootstrap node; sleep 15; done; echo bootstrap node up\"')]"
},
"type": "CustomScriptForLinux",
"typeHandlerVersion": "1.4"
},
"type": "Microsoft.Compute/virtualMachines/extensions"
}{{WriteLinkedTemplatesForExtensions}}

Просмотреть файл

@ -1,9 +0,0 @@
{{if .OrchestratorProfile.DcosConfig.BootstrapProfile}}
,
"dcosBootstrapURL": "[parameters('dcosBootstrapURL')]",
"bootstrapVMSize": "[parameters('bootstrapVMSize')]",
"bootstrapNSGID": "[resourceId('Microsoft.Network/networkSecurityGroups',variables('bootstrapNSGName'))]",
"bootstrapNSGName": "[concat('bootstrap-nsg-', variables('nameSuffix'))]",
"bootstrapVMName": "[concat('bootstrap-', variables('nameSuffix'))]",
"bootstrapStaticIP": "[parameters('bootstrapStaticIP')]"
{{end}}

Просмотреть файл

@ -1,99 +0,0 @@
bootcmd:
- bash -c "if [ ! -f /var/lib/sdb-gpt ];then echo DCOS-5890;parted -s /dev/sdb mklabel
gpt;touch /var/lib/sdb-gpt;fi"
disk_setup:
ephemeral0:
layout:
- 50
- 50
overwrite: true
table_type: gpt
fs_setup:
- device: ephemeral0.1
filesystem: ext4
overwrite: true
- device: ephemeral0.2
filesystem: ext4
overwrite: true
mounts:
- - ephemeral0.1
- /var/lib/mesos
- - ephemeral0.2
- /var/lib/docker
runcmd: PREPROVISION_EXTENSION
- ln -s /bin/rm /usr/bin/rm
- ln -s /bin/mkdir /usr/bin/mkdir
- ln -s /bin/tar /usr/bin/tar
- ln -s /bin/ln /usr/bin/ln
- ln -s /bin/cp /usr/bin/cp
- ln -s /bin/systemctl /usr/bin/systemctl
- ln -s /bin/mount /usr/bin/mount
- ln -s /bin/bash /usr/bin/bash
- ln -s /usr/sbin/useradd /usr/bin/useradd
- systemctl disable --now resolvconf.service
- systemctl mask --now lxc-net.service
- systemctl disable --now unscd.service
- systemctl stop --now unscd.service
- /opt/azure/containers/provision.sh
- bash /tmp/dcos/dcos_install.sh ROLENAME
- /opt/azure/dcos/postinstall-cond.sh
- bash /opt/azure/dcos/diagnostics_fix.sh
write_files:
- content: |
[Service]
Restart=always
StartLimitInterval=0
RestartSec=15
ExecStartPre=-/sbin/ip link del docker0
ExecStart=
ExecStart=/usr/bin/dockerd --storage-driver=overlay
path: /etc/systemd/system/docker.service.d/execstart.conf
permissions: '0644'
- content: |
[Unit]
PartOf=docker.service
[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker
ListenStream=2375
BindIPv6Only=both
[Install]
WantedBy=sockets.target
path: /etc/systemd/system/docker.socket
permissions: '0644'
- content: |
DCOS_ENVIRONMENT={{{targetEnvironment}}}
owner: root
path: /opt/azure/dcos/environment
permissions: '0644'
- content: |
#!/bin/bash
for f in /opt/mesosphere/packages/dcos-config--setup_*/etc/dcos-diagnostics-runner-config.json; do
if [ -e $f ]; then
sed -i.bak "99 s/1s/10s/" $f
fi
done
owner: root
path: /opt/azure/dcos/diagnostics_fix.sh
permissions: '0744'
- path: /var/lib/dcos/mesos-slave-common
content: 'ATTRIBUTES_STR'
permissions: "0644"
owner: "root"
- content: 'PROVISION_SOURCE_STR'
path: /opt/azure/containers/provision_source.sh
permissions: "0744"
owner: "root"
- content: 'PROVISION_STR'
path: /opt/azure/containers/provision.sh
permissions: "0744"
owner: "root"
- content: |
#!/bin/bash
if [ -f /opt/azure/dcos/postinstall.sh ]; then /opt/azure/dcos/postinstall.sh; fi
path: /opt/azure/dcos/postinstall-cond.sh
permissions: "0744"
owner: "root"

Просмотреть файл

@ -1,87 +0,0 @@
bootcmd:
- bash -c "if [ ! -f /var/lib/sdb-gpt ];then echo DCOS-5890;parted -s /dev/sdb mklabel
gpt;touch /var/lib/sdb-gpt;fi"
disk_setup:
ephemeral0:
layout:
- 50
- 50
overwrite: true
table_type: gpt
fs_setup:
- device: ephemeral0.1
filesystem: ext4
overwrite: true
- device: ephemeral0.2
filesystem: ext4
overwrite: true
mounts:
- - ephemeral0.1
- /var/lib/mesos
- - ephemeral0.2
- /var/lib/docker
runcmd: PREPROVISION_EXTENSION
- ln -s /bin/rm /usr/bin/rm
- ln -s /bin/mkdir /usr/bin/mkdir
- ln -s /bin/tar /usr/bin/tar
- ln -s /bin/ln /usr/bin/ln
- ln -s /bin/cp /usr/bin/cp
- ln -s /bin/systemctl /usr/bin/systemctl
- ln -s /bin/mount /usr/bin/mount
- ln -s /bin/bash /usr/bin/bash
- ln -s /usr/sbin/useradd /usr/bin/useradd
- systemctl disable --now resolvconf.service
- systemctl mask --now lxc-net.service
- systemctl disable --now unscd.service
- systemctl stop --now unscd.service
- /opt/azure/containers/provision.sh
- bash /tmp/dcos/dcos_install.sh ROLENAME
- /opt/azure/dcos/postinstall-cond.sh
write_files:
- content: |
[Service]
Restart=always
StartLimitInterval=0
RestartSec=15
ExecStartPre=-/sbin/ip link del docker0
ExecStart=
ExecStart=/usr/bin/dockerd --storage-driver=overlay
path: /etc/systemd/system/docker.service.d/execstart.conf
permissions: '0644'
- content: |
[Unit]
PartOf=docker.service
[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker
ListenStream=2375
BindIPv6Only=both
[Install]
WantedBy=sockets.target
path: /etc/systemd/system/docker.socket
permissions: '0644'
- content: |
DCOS_ENVIRONMENT={{{targetEnvironment}}}
owner: root
path: /opt/azure/dcos/environment
permissions: '0644'
- path: /var/lib/dcos/mesos-slave-common
content: 'ATTRIBUTES_STR'
permissions: "0644"
owner: "root"
- content: 'PROVISION_SOURCE_STR'
path: /opt/azure/containers/provision_source.sh
permissions: "0744"
owner: "root"
- content: 'PROVISION_STR'
path: /opt/azure/containers/provision.sh
permissions: "0744"
owner: "root"
- content: |
#!/bin/bash
if [ -f /opt/azure/dcos/postinstall.sh ]; then /opt/azure/dcos/postinstall.sh; fi
path: /opt/azure/dcos/postinstall-cond.sh
permissions: "0744"
owner: "root"

Просмотреть файл

@ -1,65 +0,0 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
{{range .AgentPoolProfiles}}{{template "agentparams.t" .}},{{end}}
{{if .HasWindows}}
"dcosBinariesURL": {
"metadata": {
"description": "The download url for dcos/mesos windows binaries."
},
"type": "string"
},
"dcosBinariesVersion": {
"metadata": {
"description": "DCOS windows binaries version"
},
"type": "string"
},
{{template "windowsparams.t"}},
{{end}}
{{template "dcos/dcosparams.t" .}}
{{template "dcos/bstrap/bootstrapparams.t" .}},
{{template "masterparams.t" .}}
},
"variables": {
{{range $index, $agent := .AgentPoolProfiles}}
"{{.Name}}Index": {{$index}},
{{template "dcos/dcosagentvars.t" .}}
{{if .IsStorageAccount}}
"{{.Name}}StorageAccountOffset": "[mul(variables('maxStorageAccountsPerAgent'),{{$index}})]",
"{{.Name}}AccountName": "[concat(variables('storageAccountBaseName'), 'agnt{{$index}}')]",
{{if .HasDisks}}
"{{.Name}}DataAccountName": "[concat(variables('storageAccountBaseName'), 'data{{$index}}')]",
{{end}}
{{end}}
{{end}}
{{template "dcos/bstrap/dcosmastervars.t" .}}
{{template "dcos/bstrap/bootstrapvars.t" .}}
},
"resources": [
{{range .AgentPoolProfiles}}
{{if .IsWindows}}
{{if .IsAvailabilitySets}}
{{template "dcos/dcosWindowsAgentResourcesVmas.t" .}},
{{else}}
{{template "dcos/dcosWindowsAgentResourcesVmss.t" .}},
{{end}}
{{else}}
{{if .IsAvailabilitySets}}
{{template "dcos/dcosagentresourcesvmas.t" .}},
{{else}}
{{template "dcos/dcosagentresourcesvmss.t" .}},
{{end}}
{{end}}
{{end}}
{{template "dcos/bstrap/bootstrapresources.t" .}},
{{template "dcos/bstrap/dcosmasterresources.t" .}}
],
"outputs": {
{{range .AgentPoolProfiles}}{{template "agentoutputs.t" .}}
{{end}}
{{template "masteroutputs.t" .}}
}
}

Просмотреть файл

@ -1,355 +0,0 @@
{{if .MasterProfile.IsManagedDisks}}
{
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
"location": "[variables('location')]",
"name": "[variables('masterAvailabilitySet')]",
"properties": {
"platformFaultDomainCount": 2,
"platformUpdateDomainCount": 3,
"managed": "true"
},
"type": "Microsoft.Compute/availabilitySets"
},
{{else if .MasterProfile.IsStorageAccount}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('masterStorageAccountName')]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('masterVMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('masterAvailabilitySet')]",
"properties": {},
"type": "Microsoft.Compute/availabilitySets"
},
{{end}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('masterStorageAccountExhibitorName')]",
"properties": {
"accountType": "Standard_LRS"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{if not .MasterProfile.IsCustomVNET}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
{{GetVNETSubnetDependencies}}
],
"location": "[variables('location')]",
"name": "[variables('virtualNetworkName')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
{{GetVNETAddressPrefixes}}
]
},
"subnets": [
{{GetVNETSubnets true}}
]
},
"type": "Microsoft.Network/virtualNetworks"
},
{{end}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('masterPublicIPAddressName')]",
"properties": {
"dnsSettings": {
"domainNameLabel": "[variables('masterEndpointDNSNamePrefix')]"
},
"publicIPAllocationMethod": "Dynamic"
},
"type": "Microsoft.Network/publicIPAddresses"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('masterLbName')]",
"properties": {
"backendAddressPools": [
{
"name": "[variables('masterLbBackendPoolName')]"
}
],
"frontendIPConfigurations": [
{
"name": "[variables('masterLbIPConfigName')]",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('masterPublicIPAddressName'))]"
}
}
}
]
{{if .MasterProfile.OAuthEnabled}}
,"loadBalancingRules": [
{
"name": "LBRule443",
"properties": {
"frontendIPConfiguration": {
"id": "[variables('masterLbIPConfigID')]"
},
"frontendPort": 443,
"backendPort": 443,
"enableFloatingIP": false,
"idleTimeoutInMinutes": 4,
"protocol": "Tcp",
"loadDistribution": "Default",
"backendAddressPool": {
"id": "[concat(variables('masterLbID'), '/backendAddressPools/', variables('masterLbBackendPoolName'))]"
},
"probe": {
"id": "[concat(variables('masterLbID'),'/probes/dcosMasterProbe')]"
}
}
},
{
"name": "LBRule80",
"properties": {
"frontendIPConfiguration": {
"id": "[variables('masterLbIPConfigID')]"
},
"frontendPort": 80,
"backendPort": 80,
"enableFloatingIP": false,
"idleTimeoutInMinutes": 4,
"protocol": "Tcp",
"loadDistribution": "Default",
"backendAddressPool": {
"id": "[concat(variables('masterLbID'), '/backendAddressPools/', variables('masterLbBackendPoolName'))]"
},
"probe": {
"id": "[concat(variables('masterLbID'),'/probes/dcosMasterProbe')]"
}
}
}
],
"probes": [
{
"name": "dcosMasterProbe",
"properties": {
"protocol": "Http",
"port": 5050,
"requestPath": "/health",
"intervalInSeconds": 5,
"numberOfProbes": 2
}
}
]
{{end}}
},
"type": "Microsoft.Network/loadBalancers"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"copy": {
"count": "[variables('masterCount')]",
"name": "masterLbLoopNode"
},
"dependsOn": [
"[variables('masterLbID')]"
],
"location": "[variables('location')]",
"name": "[concat(variables('masterLbName'), '/', 'SSH-', variables('masterVMNamePrefix'), copyIndex())]",
"properties": {
"backendPort": 22,
"enableFloatingIP": false,
"frontendIPConfiguration": {
"id": "[variables('masterLbIPConfigID')]"
},
"frontendPort": "[copyIndex(2200)]",
"protocol": "Tcp"
},
"type": "Microsoft.Network/loadBalancers/inboundNatRules"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('masterNSGName')]",
"properties": {
"securityRules": [
{
"properties": {
"priority": 200,
"access": "Allow",
"direction": "Inbound",
"destinationPortRange": "22",
"sourcePortRange": "*",
"destinationAddressPrefix": "*",
"protocol": "Tcp",
"description": "Allow SSH",
"sourceAddressPrefix": "*"
},
"name": "ssh"
}
]
},
"type": "Microsoft.Network/networkSecurityGroups"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"copy": {
"count": "[variables('masterCount')]",
"name": "nicLoopNode"
},
"dependsOn": [
"[variables('masterNSGID')]",
{{if not .MasterProfile.IsCustomVNET}}
"[variables('vnetID')]",
{{end}}
"[variables('masterLbID')]",
"[concat(variables('masterLbID'),'/inboundNatRules/SSH-',variables('masterVMNamePrefix'),copyIndex())]"
],
"location": "[variables('location')]",
"name": "[concat(variables('masterVMNamePrefix'), 'nic-', copyIndex())]",
"properties": {
"ipConfigurations": [
{
"name": "ipConfigNode",
"properties": {
"loadBalancerBackendAddressPools": [
{
"id": "[concat(variables('masterLbID'), '/backendAddressPools/', variables('masterLbBackendPoolName'))]"
}
],
"loadBalancerInboundNatRules": [
{
"id": "[concat(variables('masterLbID'),'/inboundNatRules/SSH-',variables('masterVMNamePrefix'),copyIndex())]"
}
],
"privateIPAddress": "[concat(variables('masterFirstAddrPrefix'), copyIndex(int(variables('masterFirstAddrOctet4'))))]",
"privateIPAllocationMethod": "Static",
"subnet": {
"id": "[variables('masterVnetSubnetID')]"
}
}
}
]
,"networkSecurityGroup": {
"id": "[variables('masterNSGID')]"
}
},
"type": "Microsoft.Network/networkInterfaces"
},
{
{{if .MasterProfile.IsManagedDisks}}
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
{{else}}
"apiVersion": "[variables('apiVersionDefault')]",
{{end}}
"copy": {
"count": "[variables('masterCount')]",
"name": "vmLoopNode"
},
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('masterVMNamePrefix'), 'nic-', copyIndex())]",
"[concat('Microsoft.Compute/availabilitySets/',variables('masterAvailabilitySet'))]",
{{if .MasterProfile.IsStorageAccount}}
"[variables('masterStorageAccountName')]",
{{end}}
"[variables('masterStorageAccountExhibitorName')]"
,"[concat('Microsoft.Compute/virtualMachines/', variables('bootstrapVMName'), '/extensions/bootstrapready')]"
],
"tags":
{
"creationSource" : "[concat('acsengine-', variables('masterVMNamePrefix'), copyIndex())]",
"orchestratorName": "dcos",
"orchestratorVersion": "[variables('orchestratorVersion')]",
"orchestratorNode": "master"
},
"location": "[variables('location')]",
"name": "[concat(variables('masterVMNamePrefix'), copyIndex())]",
"properties": {
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets',variables('masterAvailabilitySet'))]"
},
"hardwareProfile": {
"vmSize": "[variables('masterVMSize')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('masterVMNamePrefix'), 'nic-', copyIndex()))]"
}
]
},
"osProfile": {
"adminUsername": "[variables('adminUsername')]",
"computername": "[concat(variables('masterVMNamePrefix'), copyIndex())]",
{{GetDCOSMasterCustomData}}
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"keyData": "[variables('sshRSAPublicKey')]",
"path": "[variables('sshKeyPath')]"
}
]
}
}
{{if .LinuxProfile.HasSecrets}}
,
"secrets": "[variables('linuxProfileSecrets')]"
{{end}}
},
"storageProfile": {
"imageReference": {
"offer": "[variables('osImageOffer')]",
"publisher": "[variables('osImagePublisher')]",
"sku": "[variables('osImageSKU')]",
"version": "[variables('osImageVersion')]"
},
"osDisk": {
"caching": "ReadWrite"
,"createOption": "FromImage"
{{if .MasterProfile.IsStorageAccount}}
,"name": "[concat(variables('masterVMNamePrefix'), copyIndex(),'-osdisk')]"
,"vhd": {
"uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('masterStorageAccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'vhds/',variables('masterVMNamePrefix'),copyIndex(),'-osdisk.vhd')]"
}
{{end}}
{{if ne .MasterProfile.OSDiskSizeGB 0}}
,"diskSizeGB": {{.MasterProfile.OSDiskSizeGB}}
{{end}}
}
}
},
"type": "Microsoft.Compute/virtualMachines"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', variables('masterVMNamePrefix'), sub(variables('masterCount'), 1))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('masterVMNamePrefix'), sub(variables('masterCount'), 1), '/waitforleader')]",
"properties": {
"autoUpgradeMinorVersion": true,
"publisher": "Microsoft.OSTCExtensions",
"settings": {
"commandToExecute": "sh -c 'until ping -c1 leader.mesos;do echo waiting for leader.mesos;sleep 15;done;echo leader.mesos up'"
},
"type": "CustomScriptForLinux",
"typeHandlerVersion": "1.4"
},
"type": "Microsoft.Compute/virtualMachines/extensions"
}{{WriteLinkedTemplatesForExtensions}}

Просмотреть файл

@ -1,141 +0,0 @@
"adminUsername": "[parameters('linuxAdminUsername')]",
"targetEnvironment": "[parameters('targetEnvironment')]",
"maxVMsPerPool": 100,
"apiVersionDefault": "2016-03-30",
"apiVersionLinkDefault": "2015-01-01",
"singleQuote": "'",
"doubleSingleQuote": "''",
{{if .LinuxProfile.HasSecrets}}
"linuxProfileSecrets" :
[
{{range $vIndex, $vault := .LinuxProfile.Secrets}}
{{if $vIndex}} , {{end}}
{
"sourceVault":{
"id":"[parameters('linuxKeyVaultID{{$vIndex}}')]"
},
"vaultCertificates":[
{{range $cIndex, $cert := $vault.VaultCertificates}}
{{if $cIndex}} , {{end}}
{
"certificateUrl" :"[parameters('linuxKeyVaultID{{$vIndex}}CertificateURL{{$cIndex}}')]"
}
{{end}}
]
}
{{end}}
],
{{end}}
"orchestratorVersion": "{{.OrchestratorProfile.OrchestratorVersion}}",
{{if .HasWindows}}
"windowsAdminUsername": "[parameters('windowsAdminUsername')]",
"windowsAdminPassword": "[parameters('windowsAdminPassword')]",
"agentWindowsBackendPort": 3389,
"agentWindowsPublisher": "[parameters('agentWindowsPublisher')]",
"agentWindowsOffer": "[parameters('agentWindowsOffer')]",
"agentWindowsSku": "[parameters('agentWindowsSku')]",
"agentWindowsVersion": "[parameters('agentWindowsVersion')]",
"dcosWindowsBootstrapURL" : "[parameters('dcosWindowsBootstrapURL')]",
"windowsCustomScriptSuffix": " $inputFile = '%SYSTEMDRIVE%\\AzureData\\CustomData.bin' ; $outputFile = '%SYSTEMDRIVE%\\AzureData\\dcosWindowsProvision.ps1' ; $inputStream = New-Object System.IO.FileStream $inputFile, ([IO.FileMode]::Open), ([IO.FileAccess]::Read), ([IO.FileShare]::Read) ; $sr = New-Object System.IO.StreamReader(New-Object System.IO.Compression.GZipStream($inputStream, [System.IO.Compression.CompressionMode]::Decompress)) ; $sr.ReadToEnd() | Out-File($outputFile) ; Invoke-Expression('{0} {1}' -f $outputFile, $arguments) ; ",
"windowsMasterCustomScriptArguments": "[concat('$arguments = ', variables('singleQuote'),'-MasterCount ', variables('masterCount'), ' -firstMasterIP ', parameters('firstConsecutiveStaticIP'), variables('singleQuote'), ' ; ')]",
"windowsMasterCustomScript": "[concat('powershell.exe -ExecutionPolicy Unrestricted -command \"', variables('windowsMasterCustomScriptArguments'), variables('windowsCustomScriptSuffix'), '\" > %SYSTEMDRIVE%\\AzureData\\dcosWindowsProvision.log 2>&1')]",
{{end}}
"masterAvailabilitySet": "[concat(variables('orchestratorName'), '-master-availabilitySet-', variables('nameSuffix'))]",
"masterCount": {{.MasterProfile.Count}},
"masterEndpointDNSNamePrefix": "[tolower(parameters('masterEndpointDNSNamePrefix'))]",
"masterHttpSourceAddressPrefix": "{{.MasterProfile.HTTPSourceAddressPrefix}}",
"masterLbBackendPoolName": "[concat(variables('orchestratorName'), '-master-pool-', variables('nameSuffix'))]",
"masterLbID": "[resourceId('Microsoft.Network/loadBalancers',variables('masterLbName'))]",
"masterLbIPConfigID": "[concat(variables('masterLbID'),'/frontendIPConfigurations/', variables('masterLbIPConfigName'))]",
"masterLbIPConfigName": "[concat(variables('orchestratorName'), '-master-lbFrontEnd-', variables('nameSuffix'))]",
"masterLbName": "[concat(variables('orchestratorName'), '-master-lb-', variables('nameSuffix'))]",
"masterNSGID": "[resourceId('Microsoft.Network/networkSecurityGroups',variables('masterNSGName'))]",
"masterNSGName": "[concat(variables('orchestratorName'), '-master-nsg-', variables('nameSuffix'))]",
"masterPublicIPAddressName": "[concat(variables('orchestratorName'), '-master-ip-', variables('masterEndpointDNSNamePrefix'), '-', variables('nameSuffix'))]",
"apiVersionStorage": "2015-06-15",
"storageAccountBaseName": "[uniqueString(concat(variables('masterEndpointDNSNamePrefix'),variables('location'),variables('orchestratorName')))]",
"masterStorageAccountExhibitorName": "[concat(variables('storageAccountBaseName'), 'exhb0')]",
"storageAccountType": "Standard_LRS",
{{if .HasStorageAccountDisks}}
"maxVMsPerStorageAccount": 20,
"maxStorageAccountsPerAgent": "[div(variables('maxVMsPerPool'),variables('maxVMsPerStorageAccount'))]",
"dataStorageAccountPrefixSeed": 97,
"storageAccountPrefixes": [ "0", "6", "c", "i", "o", "u", "1", "7", "d", "j", "p", "v", "2", "8", "e", "k", "q", "w", "3", "9", "f", "l", "r", "x", "4", "a", "g", "m", "s", "y", "5", "b", "h", "n", "t", "z" ],
"storageAccountPrefixesCount": "[length(variables('storageAccountPrefixes'))]",
{{GetSizeMap}},
{{else}}
"storageAccountPrefixes": [],
{{end}}
{{if .HasManagedDisks}}
"apiVersionStorageManagedDisks": "2016-04-30-preview",
{{end}}
{{if .MasterProfile.IsStorageAccount}}
"masterStorageAccountName": "[concat(variables('storageAccountBaseName'), 'mstr0')]",
{{end}}
{{if .MasterProfile.IsCustomVNET}}
"masterVnetSubnetID": "[parameters('masterVnetSubnetID')]",
{{else}}
"masterSubnet": "[parameters('masterSubnet')]",
"masterSubnetName": "[concat(variables('orchestratorName'), '-masterSubnet')]",
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]",
"masterVnetSubnetID": "[concat(variables('vnetID'),'/subnets/',variables('masterSubnetName'))]",
"virtualNetworkName": "[concat(variables('orchestratorName'), '-vnet-', variables('nameSuffix'))]",
{{end}}
"masterFirstAddrOctets": "[split(parameters('firstConsecutiveStaticIP'),'.')]",
"masterFirstAddrOctet4": "[variables('masterFirstAddrOctets')[3]]",
"masterFirstAddrPrefix": "[concat(variables('masterFirstAddrOctets')[0],'.',variables('masterFirstAddrOctets')[1],'.',variables('masterFirstAddrOctets')[2],'.')]",
"masterVMNamePrefix": "[concat(variables('orchestratorName'), '-master-', variables('nameSuffix'), '-')]",
"masterVMNic": [
"[concat(variables('masterVMNamePrefix'), 'nic-0')]",
"[concat(variables('masterVMNamePrefix'), 'nic-1')]",
"[concat(variables('masterVMNamePrefix'), 'nic-2')]",
"[concat(variables('masterVMNamePrefix'), 'nic-3')]",
"[concat(variables('masterVMNamePrefix'), 'nic-4')]",
"[concat(variables('masterVMNamePrefix'), 'nic-5')]",
"[concat(variables('masterVMNamePrefix'), 'nic-6')]"
],
"masterVMSize": "[parameters('masterVMSize')]",
"nameSuffix": "[parameters('nameSuffix')]",
"oauthEnabled": "{{.MasterProfile.OAuthEnabled}}",
"orchestratorName": "dcos",
"osImageOffer": "[parameters('osImageOffer')]",
"osImagePublisher": "[parameters('osImagePublisher')]",
"osImageSKU": "[parameters('osImageSKU')]",
"osImageVersion": "[parameters('osImageVersion')]",
"sshKeyPath": "[concat('/home/', variables('adminUsername'), '/.ssh/authorized_keys')]",
"sshRSAPublicKey": "[parameters('sshRSAPublicKey')]",
"locations": [
"[resourceGroup().location]",
"[parameters('location')]"
],
"location": "[variables('locations')[mod(add(2,length(parameters('location'))),add(1,length(parameters('location'))))]]",
"masterSshInboundNatRuleIdPrefix": "[concat(variables('masterLbID'),'/inboundNatRules/SSH-',variables('masterVMNamePrefix'))]",
"masterLbInboundNatRules": [
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'0')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'1')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'2')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'3')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'4')]"
}
]
]

Просмотреть файл

@ -1,54 +0,0 @@
#!/bin/bash
source /opt/azure/containers/provision_source.sh
source /opt/azure/dcos/environment
TMPDIR="/tmp/dcos"
mkdir -p $TMPDIR
# default dc/os component download address (Azure CDN)
packages=(
https://dcos-mirror.azureedge.net/pkg/libipset3_6.29-1_amd64.deb
https://dcos-mirror.azureedge.net/pkg/ipset_6.29-1_amd64.deb
https://dcos-mirror.azureedge.net/pkg/unzip_6.0-20ubuntu1_amd64.deb
https://dcos-mirror.azureedge.net/pkg/libltdl7_2.4.6-0.1_amd64.deb
https://dcos-mirror.azureedge.net/pkg/docker-ce_17.09.0~ce-0~ubuntu_amd64.deb
https://dcos-mirror.azureedge.net/pkg/selinux-utils_2.4-3build2_amd64.deb
)
# sha1sum checksums for @packages
sha1sums=(
f88d09688291917c8bb65682fea9f5d571ec8d6a
807dc11f5bfa39bb4b0dc9024fc51bb309905a21
57ae2bb6ded1fdf91b6d518294134df1ff13fcca
9a0f9f2769d3dc834737aa7df50aaaea369af98d
94f6e89be6d45d9988269a237eb27c7d6a844d7f
77bdb5847060845c0a158f567b1ddd7fa34b7236
)
case $DCOS_ENVIRONMENT in
# because of Chinese GreatWall Firewall, the default packages on Azure CDN is blocked. So the following Chinese local mirror url should be used instead.
AzureChinaCloud)
packages=(
http://acsengine.blob.core.chinacloudapi.cn/dcos/libipset3_6.29-1_amd64.deb
http://acsengine.blob.core.chinacloudapi.cn/dcos/ipset_6.29-1_amd64.deb
http://acsengine.blob.core.chinacloudapi.cn/dcos/unzip_6.0-20ubuntu1_amd64.deb
http://acsengine.blob.core.chinacloudapi.cn/dcos/libltdl7_2.4.6-0.1_amd64.deb
http://mirror.kaiyuanshe.cn/docker-ce/linux/ubuntu/dists/xenial/pool/stable/amd64/docker-ce_17.09.0~ce-0~ubuntu_amd64.deb
http://acsengine.blob.core.chinacloudapi.cn/dcos/selinux-utils_2.4-3build2_amd64.deb
)
;;
esac
len=$((${#packages[@]}-1))
for i in $(seq 0 $len); do
retry_get_install_deb 10 10 120 ${packages[$i]} ${sha1sums[$i]}
if [ $? -ne 0 ]; then
exit 1
fi
done
retrycmd_if_failure 10 10 120 curl -fsSL -o $TMPDIR/dcos_install.sh http://BOOTSTRAP_IP:8086/dcos_install.sh
if [ $? -ne 0 ]; then
exit 1
fi

Просмотреть файл

@ -1,294 +0,0 @@
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}NSGName')]",
"properties": {
"securityRules": [
{{GetSecurityRules .Ports}}
]
},
"type": "Microsoft.Network/networkSecurityGroups"
},
{{if HasWindowsCustomImage}}
{"type": "Microsoft.Compute/images",
"apiVersion": "2017-12-01",
"name": "{{.Name}}CustomWindowsImage",
"location": "[variables('location')]",
"properties": {
"storageProfile": {
"osDisk": {
"osType": "Windows",
"osState": "Generalized",
"blobUri": "[parameters('agentWindowsSourceUrl')]",
"storageAccountType": "Standard_LRS"
}
}
}
},
{{end}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"copy": {
"count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]",
"name": "loop"
},
"dependsOn": [
{{if .IsCustomVNET}}
"[concat('Microsoft.Network/networkSecurityGroups/', variables('{{.Name}}NSGName'))]"
{{else}}
"[variables('vnetID')]"
{{end}}
{{if IsPublic .Ports}}
,"[variables('{{.Name}}LbID')]"
{{end}}
],
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), 'nic-', copyIndex(variables('{{.Name}}Offset')))]",
"properties": {
{{if .IsCustomVNET}}
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups/', variables('{{.Name}}NSGName'))]"
},
{{end}}
"ipConfigurations": [
{
"name": "ipConfigNode",
"properties": {
{{if IsPublic .Ports}}
"loadBalancerBackendAddressPools": [
{
"id": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/loadBalancers/', variables('{{.Name}}LbName'), '/backendAddressPools/',variables('{{.Name}}LbBackendPoolName'))]"
}
],
"loadBalancerInboundNatPools": [
{
"id": "[concat(variables('{{.Name}}LbID'), '/inboundNatPools/', 'RDP-', variables('{{.Name}}VMNamePrefix'))]"
}
],
{{end}}
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[variables('{{.Name}}VnetSubnetID')]"
}
}
}
]
},
"type": "Microsoft.Network/networkInterfaces"
},
{{if .IsManagedDisks}}
{
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}AvailabilitySet')]",
"properties": {
"platformFaultDomainCount": 2,
"platformUpdateDomainCount": 3,
"managed": "true"
},
"type": "Microsoft.Compute/availabilitySets"
},
{{else if .IsStorageAccount}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"copy": {
"count": "[variables('{{.Name}}StorageAccountsCount')]",
"name": "loop"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{if .HasDisks}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"copy": {
"count": "[variables('{{.Name}}StorageAccountsCount')]",
"name": "datadiskLoop"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(variables('dataStorageAccountPrefixSeed')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(variables('dataStorageAccountPrefixSeed')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}DataAccountName'))]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{end}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}AvailabilitySet')]",
"properties": {},
"type": "Microsoft.Compute/availabilitySets"
},
{{end}}
{{if IsPublic .Ports}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}IPAddressName')]",
"properties": {
"dnsSettings": {
"domainNameLabel": "[variables('{{.Name}}EndpointDNSNamePrefix')]"
},
"publicIPAllocationMethod": "Dynamic"
},
"type": "Microsoft.Network/publicIPAddresses"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('{{.Name}}IPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('{{.Name}}LbName')]",
"properties": {
"backendAddressPools": [
{
"name": "[variables('{{.Name}}LbBackendPoolName')]"
}
],
"frontendIPConfigurations": [
{
"name": "[variables('{{.Name}}LbIPConfigName')]",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('{{.Name}}IPAddressName'))]"
}
}
}
],
"inboundNatPools": [
{
"name": "[concat('RDP-', variables('{{.Name}}VMNamePrefix'))]",
"properties": {
"frontendIPConfiguration": {
"id": "[variables('{{.Name}}LbIPConfigID')]"
},
"protocol": "Tcp",
"frontendPortRangeStart": "[variables('{{.Name}}WindowsRDPNatRangeStart')]",
"frontendPortRangeEnd": "[variables('{{.Name}}WindowsRDPEndRangeStop')]",
"backendPort": "[variables('agentWindowsBackendPort')]"
}
}
],
"loadBalancingRules": [
{{(GetLBRules .Name .Ports)}}
],
"probes": [
{{(GetProbes .Ports)}}
]
},
"type": "Microsoft.Network/loadBalancers"
},
{{end}}
{
{{if .IsManagedDisks}}
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
{{else}}
"apiVersion": "[variables('apiVersionDefault')]",
{{end}}
"copy": {
"count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]",
"name": "vmLoopNode"
},
"dependsOn": [
{{if .IsStorageAccount}}
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
{{if .HasDisks}}
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('dataStorageAccountPrefixSeed')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('dataStorageAccountPrefixSeed')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}DataAccountName'))]",
{{end}}
{{end}}
"[concat('Microsoft.Network/networkInterfaces/', variables('{{.Name}}VMNamePrefix'), 'nic-', copyIndex(variables('{{.Name}}Offset')))]",
"[concat('Microsoft.Compute/availabilitySets/', variables('{{.Name}}AvailabilitySet'))]"
],
"tags":
{
"creationSource" : "[concat('acsengine-', variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')))]",
"orchestratorName": "dcos",
"orchestratorVersion": "[variables('orchestratorVersion')]",
"orchestratorNode": "agent"
},
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')))]",
"properties": {
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets',variables('{{.Name}}AvailabilitySet'))]"
},
"hardwareProfile": {
"vmSize": "[variables('{{.Name}}VMSize')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('{{.Name}}VMNamePrefix'), 'nic-', copyIndex(variables('{{.Name}}Offset'))))]"
}
]
},
"osProfile": {
"computername": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')))]",
"adminUsername": "[variables('windowsAdminUsername')]",
"adminPassword": "[variables('windowsAdminPassword')]",
{{GetDCOSWindowsAgentCustomData .}}
},
"storageProfile": {
{{GetDataDisks .}}
"imageReference": {
{{if HasWindowsCustomImage}}
"id": "[resourceId('Microsoft.Compute/images','{{.Name}}CustomWindowsImage')]"
{{else}}
"offer": "[variables('agentWindowsOffer')]",
"publisher": "[variables('agentWindowsPublisher')]",
"sku": "[variables('agentWindowsSKU')]",
"version": "[variables('agentWindowsVersion')]"
{{end}}
}
,"osDisk": {
"caching": "ReadOnly"
,"createOption": "FromImage"
{{if .IsStorageAccount}}
,"name": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')),'-osdisk')]"
,"vhd": {
"uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'osdisk/', variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')), '-osdisk.vhd')]"
}
{{end}}
{{if ne .OSDiskSizeGB 0}}
,"diskSizeGB": {{.OSDiskSizeGB}}
{{end}}
}
}
},
"type": "Microsoft.Compute/virtualMachines"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"copy": {
"count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]",
"name": "vmLoopNode"
},
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')), '/cse')]",
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.8",
"autoUpgradeMinorVersion": true,
"settings": {
"commandToExecute": "[variables('{{.Name}}windowsAgentCustomScript')]"
}
},
"type": "Microsoft.Compute/virtualMachines/extensions"
}

Просмотреть файл

@ -1,229 +0,0 @@
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}NSGName')]",
"properties": {
"securityRules": [
{{GetSecurityRules .Ports}}
]
},
"type": "Microsoft.Network/networkSecurityGroups"
},
{{if HasWindowsCustomImage}}
{"type": "Microsoft.Compute/images",
"apiVersion": "2017-12-01",
"name": "{{.Name}}CustomWindowsImage",
"location": "[variables('location')]",
"properties": {
"storageProfile": {
"osDisk": {
"osType": "Windows",
"osState": "Generalized",
"blobUri": "[parameters('agentWindowsSourceUrl')]",
"storageAccountType": "Standard_LRS"
}
}
}
},
{{end}}
{{if .IsStorageAccount}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"copy": {
"count": "[variables('{{.Name}}StorageAccountsCount')]",
"name": "loop"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{end}}
{{if IsPublic .Ports}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}IPAddressName')]",
"properties": {
"dnsSettings": {
"domainNameLabel": "[variables('{{.Name}}EndpointDNSNamePrefix')]"
},
"publicIPAllocationMethod": "Dynamic"
},
"type": "Microsoft.Network/publicIPAddresses"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('{{.Name}}IPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('{{.Name}}LbName')]",
"properties": {
"backendAddressPools": [
{
"name": "[variables('{{.Name}}LbBackendPoolName')]"
}
],
"frontendIPConfigurations": [
{
"name": "[variables('{{.Name}}LbIPConfigName')]",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('{{.Name}}IPAddressName'))]"
}
}
}
],
"inboundNatRules": [],
"loadBalancingRules": [
{{(GetLBRules .Name .Ports)}}
],
"probes": [
{{(GetProbes .Ports)}}
]
},
"type": "Microsoft.Network/loadBalancers"
},
{{end}}
{
{{if .IsManagedDisks}}
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
{{else}}
"apiVersion": "[variables('apiVersionDefault')]",
{{end}}
"dependsOn": [
{{if .IsCustomVNET}}
"[concat('Microsoft.Network/networkSecurityGroups/', variables('{{.Name}}NSGName'))]"
{{else}}
"[variables('vnetID')]"
{{end}}
{{if .IsStorageAccount}}
,"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]"
{{end}}
{{if IsPublic .Ports}}
,"[concat('Microsoft.Network/loadBalancers/', variables('{{.Name}}LbName'))]"
{{end}}
],
"tags":
{
"creationSource" : "[concat('acsengine-', variables('{{.Name}}VMNamePrefix'), '-vmss')]",
"orchestratorName": "dcos",
"orchestratorVersion": "[variables('orchestratorVersion')]",
"orchestratorNode": "agent"
},
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), '-vmss')]",
"properties": {
"overprovision": false,
"upgradePolicy": {
"mode": "Manual"
},
"virtualMachineProfile": {
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "nic",
"properties": {
{{if .IsCustomVNET}}
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups/', variables('{{.Name}}NSGName'))]"
},
{{end}}
"ipConfigurations": [
{
"name": "nicipconfig",
"properties": {
{{if IsPublic .Ports}}
"loadBalancerBackendAddressPools": [
{
"id": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/loadBalancers/', variables('{{.Name}}LbName'), '/backendAddressPools/',variables('{{.Name}}LbBackendPoolName'))]"
}
],
{{end}}
"subnet": {
"id": "[variables('{{.Name}}VnetSubnetID')]"
}
}
}
],
"primary": "true"
}
}
]
},
"osProfile": {
"computerNamePrefix": "[concat(substring(variables('nameSuffix'), 0, 5), 'acs')]",
"adminUsername": "[variables('windowsAdminUsername')]",
"adminPassword": "[variables('windowsAdminPassword')]",
{{GetDCOSWindowsAgentCustomData .}}
{{if HasWindowsSecrets}}
,
"secrets": "[variables('windowsProfileSecrets')]"
{{end}}
},
"storageProfile": {
"imageReference": {
{{if HasWindowsCustomImage}}
"id": "[resourceId('Microsoft.Compute/images','{{.Name}}CustomWindowsImage')]"
{{else}}
"publisher": "[variables('agentWindowsPublisher')]",
"offer": "[variables('agentWindowsOffer')]",
"sku": "[variables('agentWindowsSku')]",
"version": "latest"
{{end}}
},
{{GetDataDisks .}}
"osDisk": {
"caching": "ReadOnly",
"createOption": "FromImage"
{{if .IsStorageAccount}}
,"name": "vmssosdisk"
,"vhdContainers": [
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'osdisk')]"
]
{{end}}
{{if ne .OSDiskSizeGB 0}}
,"diskSizeGB": {{.OSDiskSizeGB}}
{{end}}
}
},
"extensionProfile": {
"extensions": [
{
"name": "vmssCustomScriptExtension",
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.8",
"autoUpgradeMinorVersion": true,
"settings": {
"commandToExecute": "[variables('{{.Name}}windowsAgentCustomScript')]"
}
}
}
]
}
}
},
"sku": {
"capacity": "[variables('{{.Name}}Count')]",
"name": "[variables('{{.Name}}VMSize')]",
"tier": "[variables('{{.Name}}VMSizeTier')]"
},
"type": "Microsoft.Compute/virtualMachineScaleSets"
}

Просмотреть файл

@ -1,214 +0,0 @@
<#
.SYNOPSIS
Provisions VM as a DCOS agent.
.DESCRIPTION
Provisions VM as a DCOS agent.
Invoke by:
#>
[CmdletBinding(DefaultParameterSetName="Standard")]
param(
[string]
[ValidateNotNullOrEmpty()]
$masterCount,
[string]
[ValidateNotNullOrEmpty()]
$firstMasterIP,
[string]
[ValidateNotNullOrEmpty()]
$bootstrapUri,
[parameter()]
[ValidateNotNullOrEmpty()]
$isAgent,
[parameter()]
[ValidateNotNullOrEmpty()]
$subnet,
[parameter()]
[AllowNull()]
$isPublic = $false,
[string]
[AllowNull()]
$customAttrs = "",
[string]
[AllowNull()]
$preprovisionExtensionParams = ""
)
$global:BootstrapInstallDir = "C:\AzureData"
filter Timestamp {"$(Get-Date -Format o): $_"}
function
Write-Log($message)
{
$msg = $message | Timestamp
Write-Output $msg
}
function
Expand-ZIPFile($file, $destination)
{
$shell = new-object -com shell.application
$zip = $shell.NameSpace($file)
foreach($item in $zip.items())
{
$shell.Namespace($destination).copyhere($item, 0x14)
}
}
function
Remove-Directory($dirname)
{
try {
#Get-ChildItem $dirname -Recurse | Remove-Item -force -confirm:$false
# This doesn't work because of long file names
# But this does:
Invoke-Expression ("cmd /C rmdir /s /q "+$dirname)
}
catch {
# If this fails we don't want it to stop
}
}
function
Check-Subnet ([string]$cidr, [string]$ip)
{
try {
$network, [int]$subnetlen = $cidr.Split('/')
if ($subnetlen -eq 0)
{
$subnetlen = 8 # Default in case we get an IP addr, not CIDR
}
$a = ([IPAddress] $network)
[uint32] $unetwork = [uint32]$a.Address
$mask = -bnot ((-bnot [uint32]0) -shl (32 - $subnetlen))
$a = [IPAddress]$ip
[uint32] $uip = [uint32]$a.Address
return ($unetwork -eq ($mask -band $uip))
}
catch {
return $false
}
}
#
# Gets the bootstrap script from the blob store and places it in c:\AzureData
function
Get-BootstrapScript($download_uri, $download_dir)
{
# Get Mesos Binaries
$scriptfile = "DCOSWindowsAgentSetup.ps1"
Write-Log "get script $download_uri/$scriptfile and put it $download_dir\$scriptfile"
Invoke-WebRequest -Uri ($download_uri+"/"+$scriptfile) -OutFile ($download_dir+"\"+$scriptfile)
}
try
{
# Set to false for debugging. This will output the start script to
# c:\AzureData\dcosProvisionScript.log, and then you can RDP
# to the windows machine, and run the script manually to watch
# the output.
Write-Log "Get the install script"
Write-Log ("Parameters = isAgent = ["+ $isAgent + "] mastercount = ["+$MasterCount + "] First master ip= [" + $firstMasterIp+ "] boostrap URI = ["+ $bootstrapUri+"] Subnet = ["+ $subnet +"]" + " -customAttrs " + $customAttrs + " -preprovisionExtensionParms = "+ $preprovisionExtensionParams )
# Get the boostrap script
Get-BootstrapScript $bootstrapUri $global:BootstrapInstallDir
# Convert Master count and first IP to a JSON array of IPAddresses
$ip = ([IPAddress]$firstMasterIp).getAddressBytes()
[Array]::Reverse($ip)
$ip = ([IPAddress]($ip -join '.')).Address
$MasterIP = @([IPAddress]$null)
for ($i = 0; $i -lt $MasterCount; $i++ )
{
$new_ip = ([IPAddress]$ip).getAddressBytes()
[Array]::Reverse($new_ip)
$new_ip = [IPAddress]($new_ip -join '.')
$MasterIP += $new_ip
$ip++
}
$master_str = $MasterIP.IPAddressToString
# Add the port numbers
if ($master_str.count -eq 1) {
$master_str += ":2181"
}
else {
for ($i = 0; $i -lt $master_str.count; $i++)
{
$master_str[$i] += ":2181"
}
}
$master_json = ConvertTo-Json $master_str
$master_json = $master_json -replace [Environment]::NewLine,""
$private_ip = ( Get-NetIPAddress | where { $_.AddressFamily -eq "IPv4" } | where { Check-Subnet $subnet $_.IPAddress } ) # We know the subnet we are on. Makes it easier and more robust
[Environment]::SetEnvironmentVariable("DCOS_AGENT_IP", $private_ip.IPAddress, "Machine")
if ($isAgent)
{
$run_cmd = $global:BootstrapInstallDir+"\DCOSWindowsAgentSetup.ps1 -MasterIP '$master_json' -AgentPrivateIP "+($private_ip.IPAddress) +" -BootstrapUrl '$bootstrapUri' "
if ($isPublic)
{
$run_cmd += " -isPublic:`$true "
}
if ($customAttrs)
{
$run_cmd += " -customAttrs '$customAttrs'"
}
$run_cmd += ">"+$global:BootstrapInstallDir+"\DCOSWindowsAgentSetup.log 2>&1"
Write-Log "run setup script $run_cmd"
Invoke-Expression $run_cmd
Write-Log "setup script completed"
}
else # We must be deploying a master
{
$run_cmd = $global:BootstrapInstallDir+"\DCOSWindowsMasterSetup.ps1 -MasterIP '$master_json' -MasterPrivateIP $privateIP.IPAddress -BootstrapUrl '$bootstrapUri'"
Write-Log "run setup script $run_cmd"
Invoke-Expression $run_cmd
}
PREPROVISION_EXTENSION
Write-Log "Provisioning script succeeded"
}
catch
{
Write-Log "Provisioning script failed"
Write-Error $_
exit 1
}

Просмотреть файл

@ -1,250 +0,0 @@
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}NSGName')]",
"properties": {
"securityRules": [
{{GetSecurityRules .Ports}}
]
},
"type": "Microsoft.Network/networkSecurityGroups"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"copy": {
"count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]",
"name": "loop"
},
"dependsOn": [
{{if .IsCustomVNET}}
"[concat('Microsoft.Network/networkSecurityGroups/', variables('{{.Name}}NSGName'))]"
{{else}}
"[variables('vnetID')]"
{{end}}
{{if IsPublic .Ports}}
,"[variables('{{.Name}}LbID')]"
{{end}}
],
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), 'nic-', copyIndex(variables('{{.Name}}Offset')))]",
"properties": {
{{if .IsCustomVNET}}
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups/', variables('{{.Name}}NSGName'))]"
},
{{end}}
"ipConfigurations": [
{
"name": "ipConfigNode",
"properties": {
{{if IsPublic .Ports}}
"loadBalancerBackendAddressPools": [
{
"id": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/loadBalancers/', variables('{{.Name}}LbName'), '/backendAddressPools/',variables('{{.Name}}LbBackendPoolName'))]"
}
],
{{end}}
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[variables('{{.Name}}VnetSubnetID')]"
}
}
}
]
},
"type": "Microsoft.Network/networkInterfaces"
},
{{if .IsManagedDisks}}
{
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}AvailabilitySet')]",
"properties": {
"platformFaultDomainCount": 2,
"platformUpdateDomainCount": 3,
"managed": "true"
},
"type": "Microsoft.Compute/availabilitySets"
},
{{else if .IsStorageAccount}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"copy": {
"count": "[variables('{{.Name}}StorageAccountsCount')]",
"name": "loop"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{if .HasDisks}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"copy": {
"count": "[variables('{{.Name}}StorageAccountsCount')]",
"name": "datadiskLoop"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(variables('dataStorageAccountPrefixSeed')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(variables('dataStorageAccountPrefixSeed')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}DataAccountName'))]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{end}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}AvailabilitySet')]",
"properties": {},
"type": "Microsoft.Compute/availabilitySets"
},
{{end}}
{{if IsPublic .Ports}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}IPAddressName')]",
"properties": {
"dnsSettings": {
"domainNameLabel": "[variables('{{.Name}}EndpointDNSNamePrefix')]"
},
"publicIPAllocationMethod": "Dynamic"
},
"type": "Microsoft.Network/publicIPAddresses"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('{{.Name}}IPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('{{.Name}}LbName')]",
"properties": {
"backendAddressPools": [
{
"name": "[variables('{{.Name}}LbBackendPoolName')]"
}
],
"frontendIPConfigurations": [
{
"name": "[variables('{{.Name}}LbIPConfigName')]",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('{{.Name}}IPAddressName'))]"
}
}
}
],
"inboundNatRules": [],
"loadBalancingRules": [
{{(GetLBRules .Name .Ports)}}
],
"probes": [
{{(GetProbes .Ports)}}
]
},
"type": "Microsoft.Network/loadBalancers"
},
{{end}}
{
{{if .IsManagedDisks}}
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
{{else}}
"apiVersion": "[variables('apiVersionDefault')]",
{{end}}
"copy": {
"count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]",
"name": "vmLoopNode"
},
"dependsOn": [
{{if .IsStorageAccount}}
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
{{if .HasDisks}}
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('dataStorageAccountPrefixSeed')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('dataStorageAccountPrefixSeed')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}DataAccountName'))]",
{{end}}
{{end}}
"[concat('Microsoft.Network/networkInterfaces/', variables('{{.Name}}VMNamePrefix'), 'nic-', copyIndex(variables('{{.Name}}Offset')))]",
"[concat('Microsoft.Compute/availabilitySets/', variables('{{.Name}}AvailabilitySet'))]"
{{if HasBootstrap}}
,"[concat('Microsoft.Compute/virtualMachines/', variables('bootstrapVMName'), /extensions/bootstrapready')]"
{{end}}
],
"tags":
{
"creationSource" : "[concat('acsengine-', variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')))]",
"orchestratorName": "dcos",
"orchestratorVersion": "[variables('orchestratorVersion')]",
"orchestratorNode": "agent"
},
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')))]",
"properties": {
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets',variables('{{.Name}}AvailabilitySet'))]"
},
"hardwareProfile": {
"vmSize": "[variables('{{.Name}}VMSize')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('{{.Name}}VMNamePrefix'), 'nic-', copyIndex(variables('{{.Name}}Offset'))))]"
}
]
},
"osProfile": {
"adminUsername": "[variables('adminUsername')]",
"computername": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')))]",
{{GetDCOSAgentCustomData .}}
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"keyData": "[parameters('sshRSAPublicKey')]",
"path": "[variables('sshKeyPath')]"
}
]
}
}
{{if HasLinuxSecrets}}
,
"secrets": "[variables('linuxProfileSecrets')]"
{{end}}
},
"storageProfile": {
{{GetDataDisks .}}
"imageReference": {
"offer": "[variables('osImageOffer')]",
"publisher": "[variables('osImagePublisher')]",
"sku": "[variables('osImageSKU')]",
"version": "[variables('osImageVersion')]"
}
,"osDisk": {
"caching": "ReadOnly"
,"createOption": "FromImage"
{{if .IsStorageAccount}}
,"name": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')),'-osdisk')]"
,"vhd": {
"uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'osdisk/', variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')), '-osdisk.vhd')]"
}
{{end}}
{{if ne .OSDiskSizeGB 0}}
,"diskSizeGB": {{.OSDiskSizeGB}}
{{end}}
}
}
},
"type": "Microsoft.Compute/virtualMachines"
}

Просмотреть файл

@ -1,205 +0,0 @@
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}NSGName')]",
"properties": {
"securityRules": [
{{GetSecurityRules .Ports}}
]
},
"type": "Microsoft.Network/networkSecurityGroups"
},
{{if .IsStorageAccount}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"copy": {
"count": "[variables('{{.Name}}StorageAccountsCount')]",
"name": "loop"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{end}}
{{if IsPublic .Ports}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}IPAddressName')]",
"properties": {
"dnsSettings": {
"domainNameLabel": "[variables('{{.Name}}EndpointDNSNamePrefix')]"
},
"publicIPAllocationMethod": "Dynamic"
},
"type": "Microsoft.Network/publicIPAddresses"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('{{.Name}}IPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('{{.Name}}LbName')]",
"properties": {
"backendAddressPools": [
{
"name": "[variables('{{.Name}}LbBackendPoolName')]"
}
],
"frontendIPConfigurations": [
{
"name": "[variables('{{.Name}}LbIPConfigName')]",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('{{.Name}}IPAddressName'))]"
}
}
}
],
"inboundNatRules": [],
"loadBalancingRules": [
{{(GetLBRules .Name .Ports)}}
],
"probes": [
{{(GetProbes .Ports)}}
]
},
"type": "Microsoft.Network/loadBalancers"
},
{{end}}
{
{{if .IsManagedDisks}}
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
{{else}}
"apiVersion": "[variables('apiVersionDefault')]",
{{end}}
"dependsOn": [
{{if .IsCustomVNET}}
"[concat('Microsoft.Network/networkSecurityGroups/', variables('{{.Name}}NSGName'))]"
{{else}}
"[variables('vnetID')]"
{{end}}
{{if .IsStorageAccount}}
,"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]"
{{end}}
{{if IsPublic .Ports}}
,"[concat('Microsoft.Network/loadBalancers/', variables('{{.Name}}LbName'))]"
{{end}}
{{if HasBootstrap}}
,"[concat('Microsoft.Compute/virtualMachines/', variables('bootstrapVMName'), '/extensions/bootstrapready')]"
{{end}}
],
"tags":
{
"creationSource" : "[concat('acsengine-', variables('{{.Name}}VMNamePrefix'), 'vmss')]",
"orchestratorName": "dcos",
"orchestratorVersion": "[variables('orchestratorVersion')]",
"orchestratorNode": "agent"
},
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), 'vmss')]",
"properties": {
"overprovision": false,
"upgradePolicy": {
"mode": "Manual"
},
"virtualMachineProfile": {
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "nic",
"properties": {
{{if .IsCustomVNET}}
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups/', variables('{{.Name}}NSGName'))]"
},
{{end}}
"ipConfigurations": [
{
"name": "nicipconfig",
"properties": {
{{if IsPublic .Ports}}
"loadBalancerBackendAddressPools": [
{
"id": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/loadBalancers/', variables('{{.Name}}LbName'), '/backendAddressPools/',variables('{{.Name}}LbBackendPoolName'))]"
}
],
{{end}}
"subnet": {
"id": "[variables('{{.Name}}VnetSubnetID')]"
}
}
}
],
"primary": "true"
}
}
]
},
"osProfile": {
"adminUsername": "[variables('adminUsername')]",
"computerNamePrefix": "[variables('{{.Name}}VMNamePrefix')]",
{{GetDCOSAgentCustomData .}}
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"keyData": "[parameters('sshRSAPublicKey')]",
"path": "[variables('sshKeyPath')]"
}
]
}
}
{{if HasLinuxSecrets}}
,
"secrets": "[variables('linuxProfileSecrets')]"
{{end}}
},
"storageProfile": {
"imageReference": {
"offer": "[variables('osImageOffer')]",
"publisher": "[variables('osImagePublisher')]",
"sku": "[variables('osImageSKU')]",
"version": "[variables('osImageVersion')]"
},
{{GetDataDisks .}}
"osDisk": {
"caching": "ReadOnly",
"createOption": "FromImage"
{{if .IsStorageAccount}}
,"name": "vmssosdisk"
,"vhdContainers": [
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'osdisk')]"
]
{{end}}
{{if ne .OSDiskSizeGB 0}}
,"diskSizeGB": {{.OSDiskSizeGB}}
{{end}}
}
}
}
},
"sku": {
"capacity": "[variables('{{.Name}}Count')]",
"name": "[variables('{{.Name}}VMSize')]",
"tier": "[variables('{{.Name}}VMSizeTier')]"
},
"type": "Microsoft.Compute/virtualMachineScaleSets"
}

Просмотреть файл

@ -1,64 +0,0 @@
"{{.Name}}Count": "[parameters('{{.Name}}Count')]",
"{{.Name}}NSGID": "[resourceId('Microsoft.Network/networkSecurityGroups',variables('{{.Name}}NSGName'))]",
"{{.Name}}NSGName": "[concat(variables('orchestratorName'), '-{{.Name}}-nsg-', variables('nameSuffix'))]",
{{if .IsWindows}}
"winResourceNamePrefix" : "[substring(variables('nameSuffix'), 0, 5)]",
{{if IsPublic .Ports}}
"{{.Name}}VMNamePrefix": "[concat('wp', variables('winResourceNamePrefix'), add(900,variables('{{.Name}}Index')))]",
"{{.Name}}windowsAgentCustomAttributes": "[concat(' -customAttrs ', variables('doubleSingleQuote'), '{{GetDCOSWindowsAgentCustomNodeAttributes . }}', variables('doubleSingleQuote') )]",
"{{.Name}}windowsAgentCustomScriptArguments": "[concat('$arguments = ', variables('singleQuote'), '-subnet ', variables('{{.Name}}Subnet'), ' -MasterCount ', variables('masterCount'), ' -firstMasterIP ', parameters('firstConsecutiveStaticIP'), ' -bootstrapUri ', '\"', variables('dcosWindowsBootstrapURL'), '\"', ' -isAgent $true -isPublic $true ', variables('{{.Name}}windowsAgentCustomAttributes'), ' -preprovisionExtensionParams ', variables('doubleSingleQuote'), '{{GetDCOSWindowsAgentPreprovisionParameters .}}', variables('doubleSingleQuote'), variables('singleQuote'), ' ; ')]",
{{else}}
"{{.Name}}VMNamePrefix": "[concat('w', variables('winResourceNamePrefix'), add(900,variables('{{.Name}}Index')))]",
"{{.Name}}windowsAgentCustomAttributes": "[concat(' -customAttrs ', variables('doubleSingleQuote'), '{{GetDCOSWindowsAgentCustomNodeAttributes . }}', variables('doubleSingleQuote') )]",
"{{.Name}}windowsAgentCustomScriptArguments": "[concat('$arguments = ', variables('singleQuote'), '-subnet ', variables('{{.Name}}Subnet'), ' -MasterCount ', variables('masterCount'), ' -firstMasterIP ', parameters('firstConsecutiveStaticIP'), ' -bootstrapUri ', '\"', variables('dcosWindowsBootstrapURL'), '\"', ' -isAgent $true -isPublic $false ', variables('{{.Name}}windowsAgentCustomAttributes'), ' -preprovisionExtensionParams ', variables('doubleSingleQuote'), '{{GetDCOSWindowsAgentPreprovisionParameters .}}', variables('doubleSingleQuote'), variables('singleQuote'), ' ; ')]",
{{end}}
"{{.Name}}windowsAgentCustomScript": "[concat('powershell.exe -ExecutionPolicy Unrestricted -command \"', variables('{{.Name}}windowsAgentCustomScriptArguments'), variables('windowsCustomScriptSuffix'), '\" > %SYSTEMDRIVE%\\AzureData\\dcosWindowsProvision.log 2>&1; exit $LASTEXITCODE')]",
{{else}}
"{{.Name}}VMNamePrefix": "[concat(variables('orchestratorName'), '-{{.Name}}-', variables('nameSuffix'), '-')]",
{{end}}
"{{.Name}}VMSize": "[parameters('{{.Name}}VMSize')]",
"{{.Name}}VMSizeTier": "[split(parameters('{{.Name}}VMSize'),'_')[0]]",
{{if .IsAvailabilitySets}}
{{if .IsStorageAccount}}
"{{.Name}}StorageAccountsCount": "[add(div(variables('{{.Name}}Count'), variables('maxVMsPerStorageAccount')), mod(add(mod(variables('{{.Name}}Count'), variables('maxVMsPerStorageAccount')),2), add(mod(variables('{{.Name}}Count'), variables('maxVMsPerStorageAccount')),1)))]",
"{{.Name}}StorageAccountOffset": "[mul(variables('maxStorageAccountsPerAgent'),variables('{{.Name}}Index'))]",
{{end}}
"{{.Name}}AvailabilitySet": "[concat('{{.Name}}-availabilitySet-', variables('nameSuffix'))]",
"{{.Name}}Offset": "[parameters('{{.Name}}Offset')]",
{{else}}
{{if .IsStorageAccount}}
"{{.Name}}StorageAccountsCount": "[variables('maxStorageAccountsPerAgent')]",
{{end}}
{{end}}
{{if .IsCustomVNET}}
"{{.Name}}VnetSubnetID": "[parameters('{{.Name}}VnetSubnetID')]",
{{else}}
"{{.Name}}Subnet": "[parameters('{{.Name}}Subnet')]",
"{{.Name}}SubnetName": "[concat(variables('orchestratorName'), '-{{.Name}}Subnet')]",
"{{.Name}}VnetSubnetID": "[concat(variables('vnetID'),'/subnets/',variables('{{.Name}}SubnetName'))]",
{{end}}
{{if IsPublic .Ports}}
"{{.Name}}EndpointDNSNamePrefix": "[tolower(parameters('{{.Name}}EndpointDNSNamePrefix'))]",
"{{.Name}}IPAddressName": "[concat(variables('orchestratorName'), '-agent-ip-', variables('{{.Name}}EndpointDNSNamePrefix'), '-', variables('nameSuffix'))]",
"{{.Name}}LbBackendPoolName": "[concat(variables('orchestratorName'), '-{{.Name}}-', variables('nameSuffix'))]",
"{{.Name}}LbID": "[resourceId('Microsoft.Network/loadBalancers',variables('{{.Name}}LbName'))]",
"{{.Name}}LbIPConfigID": "[concat(variables('{{.Name}}LbID'),'/frontendIPConfigurations/', variables('{{.Name}}LbIPConfigName'))]",
"{{.Name}}LbIPConfigName": "[concat(variables('orchestratorName'), '-{{.Name}}-', variables('nameSuffix'))]",
"{{.Name}}LbName": "[concat(variables('orchestratorName'), '-{{.Name}}-', variables('nameSuffix'))]",
{{if .IsWindows}}
"{{.Name}}WindowsRDPNatRangeStart": 3389,
"{{.Name}}WindowsRDPEndRangeStop": "[add(variables('{{.Name}}WindowsRDPNatRangeStart'), add(variables('{{.Name}}Count'),variables('{{.Name}}Count')))]",
{{end}}
{{end}}
{{if HasPrivateRegistry}}
"registry" : "[tolower(parameters('registry'))]",
"registryKey" : "[parameters('registryKey')]",
{{else}}
"registry" : "",
"registryKey" : "",
{{end}}

Просмотреть файл

@ -1,65 +0,0 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
{{range .AgentPoolProfiles}}{{template "agentparams.t" .}},{{end}}
{{if .HasWindows}}
"dcosBinariesURL": {
"metadata": {
"description": "The download url for dcos/mesos windows binaries."
},
"type": "string"
},
"dcosBinariesVersion": {
"metadata": {
"description": "DCOS windows binaries version"
},
"type": "string"
},
{{template "windowsparams.t"}},
{{end}}
{{template "dcos/dcosparams.t" .}}
{{template "masterparams.t" .}}
},
"variables": {
"dcosRepositoryURL": "[parameters('dcosRepositoryURL')]",
"dcosClusterPackageListID": "[parameters('dcosClusterPackageListID')]",
"dcosProviderPackageID": "[parameters('dcosProviderPackageID')]",
{{range $index, $agent := .AgentPoolProfiles}}
"{{.Name}}Index": {{$index}},
{{template "dcos/dcosagentvars.t" .}}
{{if .IsStorageAccount}}
"{{.Name}}StorageAccountOffset": "[mul(variables('maxStorageAccountsPerAgent'),{{$index}})]",
"{{.Name}}AccountName": "[concat(variables('storageAccountBaseName'), 'agnt{{$index}}')]",
{{if .HasDisks}}
"{{.Name}}DataAccountName": "[concat(variables('storageAccountBaseName'), 'data{{$index}}')]",
{{end}}
{{end}}
{{end}}
{{template "dcos/dcosmastervars.t" .}}
},
"resources": [
{{range .AgentPoolProfiles}}
{{if .IsWindows}}
{{if .IsAvailabilitySets}}
{{template "dcos/dcosWindowsAgentResourcesVmas.t" .}},
{{else}}
{{template "dcos/dcosWindowsAgentResourcesVmss.t" .}},
{{end}}
{{else}}
{{if .IsAvailabilitySets}}
{{template "dcos/dcosagentresourcesvmas.t" .}},
{{else}}
{{template "dcos/dcosagentresourcesvmss.t" .}},
{{end}}
{{end}}
{{end}}
{{template "dcos/dcosmasterresources.t" .}}
],
"outputs": {
{{range .AgentPoolProfiles}}{{template "agentoutputs.t" .}}
{{end}}
{{template "masteroutputs.t" .}}
}
}

Просмотреть файл

@ -1,343 +0,0 @@
bootcmd:
- bash -c "if [ ! -f /var/lib/sdb-gpt ];then echo DCOS-5890;parted -s /dev/sdb mklabel
gpt;touch /var/lib/sdb-gpt;fi"
- bash -c "if [ ! -f /var/lib/sdc-gpt ];then echo DCOS-5890;parted -s /dev/sdc mklabel
gpt&&touch /var/lib/sdc-gpt;fi"
- bash -c "if [ ! -f /var/lib/sdd-gpt ];then echo DCOS-5890;parted -s /dev/sdd mklabel
gpt&&touch /var/lib/sdd-gpt;fi"
- bash -c "if [ ! -f /var/lib/sde-gpt ];then echo DCOS-5890;parted -s /dev/sde mklabel
gpt&&touch /var/lib/sde-gpt;fi"
- bash -c "if [ ! -f /var/lib/sdf-gpt ];then echo DCOS-5890;parted -s /dev/sdf mklabel
gpt&&touch /var/lib/sdf-gpt;fi"
- bash -c "mkdir -p /dcos/volume{0,1,2,3}"
disk_setup:
ephemeral0:
layout:
- 45
- 45
- 10
overwrite: true
table_type: gpt
/dev/sdc:
layout: true
overwrite: true
table_type: gpt
/dev/sdd:
layout: true
overwrite: true
table_type: gpt
/dev/sde:
layout: true
overwrite: true
table_type: gpt
/dev/sdf:
layout: true
overwrite: true
table_type: gpt
fs_setup:
- device: ephemeral0.1
filesystem: ext4
overwrite: true
- device: ephemeral0.2
filesystem: ext4
overwrite: true
- device: ephemeral0.3
filesystem: ext4
overwrite: true
- device: /dev/sdc1
filesystem: ext4
overwrite: true
- device: /dev/sdd1
filesystem: ext4
overwrite: true
- device: /dev/sde1
filesystem: ext4
overwrite: true
- device: /dev/sdf1
filesystem: ext4
overwrite: true
mounts:
- - ephemeral0.1
- /var/lib/mesos
- - ephemeral0.2
- /var/lib/docker
- - ephemeral0.3
- /var/tmp
- - /dev/sdc1
- /dcos/volume0
- - /dev/sdd1
- /dcos/volume1
- - /dev/sde1
- /dcos/volume2
- - /dev/sdf1
- /dcos/volume3
runcmd: PREPROVISION_EXTENSION
- - ln
- -s
- /bin/rm
- /usr/bin/rm
- - ln
- -s
- /bin/mkdir
- /usr/bin/mkdir
- - ln
- -s
- /bin/tar
- /usr/bin/tar
- - ln
- -s
- /bin/ln
- /usr/bin/ln
- - ln
- -s
- /bin/cp
- /usr/bin/cp
- - ln
- -s
- /bin/systemctl
- /usr/bin/systemctl
- - ln
- -s
- /bin/mount
- /usr/bin/mount
- - ln
- -s
- /bin/bash
- /usr/bin/bash
- - ln
- -s
- /usr/sbin/useradd
- /usr/bin/useradd
- - systemctl
- disable
- --now
- resolvconf.service
- - systemctl
- mask
- --now
- lxc-net.service
- - systemctl
- disable
- --now
- unscd.service
- - systemctl
- stop
- --now
- unscd.service
- /opt/azure/containers/provision.sh
- - cp
- -p
- /etc/resolv.conf
- /tmp/resolv.conf
- - rm
- -f
- /etc/resolv.conf
- - cp
- -p
- /tmp/resolv.conf
- /etc/resolv.conf
- - systemctl
- start
- dcos-docker-install.service
- - systemctl
- start
- dcos-config-writer.service
- - systemctl
- restart
- systemd-journald.service
- - systemctl
- restart
- docker.service
- - systemctl
- start
- dcos-link-env.service
- - systemctl
- enable
- dcos-setup.service
- - systemctl
- --no-block
- start
- dcos-setup.service
write_files:
- content: '{{{dcosRepositoryURL}}}
'
owner: root
path: /etc/mesosphere/setup-flags/repository-url
permissions: '0644'
- content: '["adminrouter--1166a3736442e7963a68d1d644bf5f54ca3cb01d", "avro-cpp--9cb0ee14e3cd5bbdb171efcc72a84d16862ea02d",
"boost-libs--8d515c2f703c666ae1b6c5ccc35cc0f8fa36677f", "bootstrap--c1bc86593e212cf9fe83db2246bacd129a6b3adc",
"boto--3890cb2817c00b874ba033abe784b5b343caa3c7", "check-time--79e3f6ab99125471e1d94d5f6bc0fea88446831c",
"cni--7a8572e385c3f5262945c52c8003d1bbb22cf7aa", "cosmos--e84c5bf3259405df90d682536ba445cc4839a324",
"curl--17866a8ae9305826aa5f357a09db2c1f2b2c2ad0", "dcos-checks--8fd33919e6f163dba1bd13e4c7e4e0523919a719",
"dcos-cni--12a77c1e9bebd4cbd600524a864c2bd8483330d3", "dcos-config--setup_{{{dcosProviderPackageID}}}",
"dcos-diagnostics--e3b557b0ec8e98617d0cd0fdf136ef9dded96316", "dcos-history--23de88ddc1a5f9018dd11b279c5be6a768a18de4",
"dcos-image--df630d8e930d6650ce3d0ade519660142233d862", "dcos-image-deps--81d23d00b1acddb316c9b15fd8499c2b10f6b697",
"dcos-integration-test--9ec173650d4e73ba494603324e7583d23970e4b8", "dcos-log--d2af4b1a47d3755a51823e95fbc6c366cf0f9269",
"dcos-metadata--setup_{{{dcosProviderPackageID}}}", "dcos-metrics--2a26c0b50b0b6564f86c48d50aa86f681c9af93c",
"dcos-oauth--445bb1388670981c6acc667b2529fc32d4c1fbd4", "dcos-signal--4366023212ea49a64c5c9aef1965e5a3133c4b61",
"dcos-test-utils--1066d896d25f4c1e3f6d9a5e7f9c1c6e8c675bb7", "dcos-ui--cc2e3d26537ea190efacd6f899dd4cc2210d45b7",
"dnspython--0be432372a3820eafcfa66975943c9536dbe1164", "docker-gc--89f5535aea154dca504f84cd60eac6f61836aef9",
"dvdcli--ee85411e3cb9f0988ed54b5cc0789172b887f12f", "erlang--d693172f6f033707c7f07ff78fc18ac543d66b41",
"exhibitor--c3e48bbae19c0ed9c30d7f9396305d1e77130658", "flask--6d0f985ad677e8422c7190cbe207424acd813c3b",
"java--ce5ff19502fca31eaf4a9af86d50a10a8c212a5b", "libevent--05dc18bc0ab7434b2738318c5ebaa2e61a311f50",
"libffi--0e5b99b94f296b2a9a1b75e9fe5f74f5446f5e9b", "libsodium--e7056355f1fe160ade83aac0d11352a2bf3844e6",
"logrotate--877aece1fd506af3b9167b6938c316adfa79d4f5", "marathon--accdc43bafeca02da1be340baba4b55011eadf63",
"mesos--0677ce2b7d2e8c45091f6481884542f1f765c3d5", "mesos-dns--600da87080b7634f2380594499004a7ff0b34662",
"mesos-modules--1f5c4860450949db92ed27326c3146526041e681", "metronome--2ec6f56be44ed822e7228cb66c4dae6a78345789",
"navstar--c66f92f01d837433de3e2b19d221c64d26cc54b1", "ncurses--030fd6b08ed46a7ecce001c36901f5b4ad5d2af5",
"octarine--4e37c062d2f145f9c2ce01d30dadf72c2aac5c4a", "openssl--44777d19d54a3c33cc19543f2201cb20bf085d98",
"pkgpanda-api--30cb1e68f92ed5d4b89d57ca526f8a69b44132c8", "pkgpanda-role--612a6734567cc0c7c2ae1d508f03172f4bc7beed",
"pytest--5e26c8ed9fd2c325672d56fe558299bfbd0f7018", "python--5a4285ff7296548732203950bf73d360ea67f6ab",
"python-azure-mgmt-resource--26cbe8349f3fe139f7dc8bff7f0cb735382314fc", "python-cryptography--0d83d8afef4a8faddf0d8b713619d9d76e510a9e",
"python-dateutil--519201adebeba186049ecd79a9f358f614173b10", "python-docopt--0af809c220a922f7f6c58f15beafebaa043477c7",
"python-gunicorn--2ceb53716237da0736f67f4004682083f6ac68e1", "python-isodate--c9efb5859a0cfb06d82f25220cc5b387914af85d",
"python-jinja2--601a1443aa4c649ab1da10c2a6d7a4477a263fb3", "python-kazoo--0ff8e6ef528f58c6f36f0a9df6dc27d3871e5c27",
"python-markupsafe--1388c95920b4eb920c7a753d620a1ad07fc8b64d", "python-passlib--4691268be760073188b555dc436f836c6706b37a",
"python-pyyaml--d8a775d6e43da5eb239af5cccdf1d3fceeb0335f", "python-requests--db0474fab16019ba29a609a354285f221c1a2859",
"python-retrying--37dd25bf69bcbefe0c50139085d6bb2e22ccf439", "python-tox--322c468e2a75c5b143cb06af460b5e801ee34342",
"rexray--da7f17f8a4b772c0bac3f8d289a08abd4ff272b4", "six--93734bac9907087744815f9cb5b6152e9a198fae",
"spartan--c3d8005b1340bcbc3a00496861745b2d0bb2d697", "strace--9be573456909e3931a890785eb6474af7e0dcce4",
"teamcity-messages--073793b16cf369e58ebdb6348b93ed14b0e5e59a", "toybox--0c49f879bfe2f99e6f99b397136894fa5096fa0c"]
'
owner: root
path: /etc/mesosphere/setup-flags/cluster-packages.json
permissions: '0644'
- content: |
[Journal]
MaxLevelConsole=warning
RateLimitInterval=1s
RateLimitBurst=20000
owner: root
path: /etc/systemd/journald.conf.d/dcos.conf
permissions: '0644'
- content: |
rexray:
loglevel: info
modules:
default-docker:
disabled: true
service: vfs
path: /etc/rexray/config.yml
permissions: '0644'
- content: |
[Unit]
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
Environment=DEBIAN_FRONTEND=noninteractive
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/curl -fLsSv --retry 20 -Y 100000 -y 60 -o /var/tmp/d.deb https://mesosphere.blob.core.windows.net/dcos-deps/docker-engine_1.13.1-0-ubuntu-xenial_amd64.deb
ExecStart=/usr/bin/bash -c "try=1;until dpkg -D3 -i /var/tmp/d.deb || ((try>9));do echo retry $((try++));sleep $((try*try));done;systemctl --now start docker;systemctl restart docker.socket"
path: /etc/systemd/system/dcos-docker-install.service
permissions: '0644'
- content: |
[Service]
Restart=always
StartLimitInterval=0
RestartSec=15
ExecStartPre=-/sbin/ip link del docker0
ExecStart=
ExecStart=/usr/bin/dockerd --storage-driver=overlay
path: /etc/systemd/system/docker.service.d/execstart.conf
permissions: '0644'
- content: |
[Unit]
PartOf=docker.service
[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker
ListenStream=2375
BindIPv6Only=both
[Install]
WantedBy=sockets.target
path: /etc/systemd/system/docker.socket
permissions: '0644'
- content: |
[Unit]
Requires=dcos-setup.service
After=dcos-setup.service
[Service]
Type=oneshot
EnvironmentFile=/etc/environment
EnvironmentFile=/opt/mesosphere/environment
ExecStart=/usr/bin/bash -c "echo $(detect_ip) $(hostname) > /etc/hosts"
path: /etc/systemd/system/dcos-config-writer.service
permissions: '0644'
- content: |
"bound_values":
"adminrouter_auth_enabled": |-
{{{oauthEnabled}}}
"cluster_name": |-
{{{masterPublicIPAddressName}}}
"exhibitor_azure_account_key": |-
', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('masterStorageAccountExhibitorName')), '2015-06-15').key1, '
"exhibitor_azure_account_name": |-
{{{masterStorageAccountExhibitorName}}}
"exhibitor_azure_prefix": |-
{{{masterPublicIPAddressName}}}
"master_list": |-
["', DCOSCUSTOMDATAPUBLICIPSTR'"]
"oauth_enabled": |-
{{{oauthEnabled}}}
"late_bound_package_id": |-
dcos-provider-{{{dcosProviderPackageID}}}-azure--setup
owner: root
path: /etc/mesosphere/setup-flags/late-config.yaml
permissions: '0644'
- content: |
[Unit]
Before=dcos.target
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/mkdir -p /etc/profile.d
ExecStart=/usr/bin/ln -sf /opt/mesosphere/bin/add_dcos_path.sh /etc/profile.d/dcos.sh
path: /etc/systemd/system/dcos-link-env.service
permissions: '0644'
- content: |
[Unit]
Description=Pkgpanda: Download DC/OS to this host.
After=network-online.target
Wants=network-online.target
ConditionPathExists=!/opt/mesosphere/
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/curl --keepalive-time 2 -fLsSv --retry 20 -Y 100000 -y 60 -o //var/tmp/bootstrap.tar.xz {{{dcosBootstrapURL}}}
ExecStartPre=/usr/bin/mkdir -p /opt/mesosphere
ExecStart=/usr/bin/tar -axf //var/tmp/bootstrap.tar.xz -C /opt/mesosphere
ExecStartPost=-/usr/bin/rm -f //var/tmp/bootstrap.tar.xz
path: /etc/systemd/system/dcos-download.service
permissions: '0644'
- content: |
[Unit]
Description=Pkgpanda: Specialize DC/OS for this host.
Requires=dcos-download.service
After=dcos-download.service
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
EnvironmentFile=/opt/mesosphere/environment
ExecStart=/opt/mesosphere/bin/pkgpanda setup --no-block-systemd
[Install]
WantedBy=multi-user.target
path: /etc/systemd/system/dcos-setup.service
permissions: '0644'
- content: ''
path: /etc/mesosphere/roles/azure
- path: /var/lib/dcos/mesos-slave-common
content: 'ATTRIBUTES_STR'
permissions: "0644"
owner: "root"
- content: 'PROVISION_STR'
path: /opt/azure/containers/provision.sh
permissions: "0744"
owner: "root"

Просмотреть файл

@ -1,371 +0,0 @@
bootcmd:
- bash -c "if [ ! -f /var/lib/sdb-gpt ];then echo DCOS-5890;parted -s /dev/sdb mklabel
gpt;touch /var/lib/sdb-gpt;fi"
disk_setup:
ephemeral0:
layout:
- 50
- 50
overwrite: true
table_type: gpt
fs_setup:
- device: ephemeral0.1
filesystem: ext4
overwrite: true
- device: ephemeral0.2
filesystem: ext4
overwrite: true
mounts:
- - ephemeral0.1
- /var/lib/mesos
- - ephemeral0.2
- /var/lib/docker
runcmd: PREPROVISION_EXTENSION
- /usr/lib/apt/apt.systemd.daily
- echo 2dd1ce17-079e-403c-b352-a1921ee207ee > /sys/bus/vmbus/drivers/hv_util/unbind # mitigation for bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1676635
- sed -i "13i\echo 2dd1ce17-079e-403c-b352-a1921ee207ee > /sys/bus/vmbus/drivers/hv_util/unbind\n" /etc/rc.local # mitigation for bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1676635
- - ln
- -s
- /bin/rm
- /usr/bin/rm
- - ln
- -s
- /bin/mkdir
- /usr/bin/mkdir
- - ln
- -s
- /bin/tar
- /usr/bin/tar
- - ln
- -s
- /bin/ln
- /usr/bin/ln
- - ln
- -s
- /bin/cp
- /usr/bin/cp
- - ln
- -s
- /bin/systemctl
- /usr/bin/systemctl
- - ln
- -s
- /bin/mount
- /usr/bin/mount
- - ln
- -s
- /bin/bash
- /usr/bin/bash
- - ln
- -s
- /usr/sbin/useradd
- /usr/bin/useradd
- - systemctl
- disable
- --now
- resolvconf.service
- - systemctl
- mask
- --now
- lxc-net.service
- - tar
- czf
- /etc/docker.tar.gz
- -C
- /tmp/xtoph
- .docker
- - rm
- -rf
- /tmp/xtoph
- /opt/azure/containers/provision.sh
- - cp
- -p
- /etc/resolv.conf
- /tmp/resolv.conf
- - rm
- -f
- /etc/resolv.conf
- - cp
- -p
- /tmp/resolv.conf
- /etc/resolv.conf
- - systemctl
- start
- dcos-docker-install.service
- - systemctl
- start
- dcos-config-writer.service
- - systemctl
- restart
- systemd-journald.service
- - systemctl
- restart
- docker.service
- - systemctl
- start
- dcos-link-env.service
- - systemctl
- enable
- dcos-setup.service
- - systemctl
- --no-block
- start
- dcos-setup.service
write_files:
- content: 'https://dcosio.azureedge.net/dcos/testing
'
owner: root
path: /etc/mesosphere/setup-flags/repository-url
permissions: '0644'
- content: 'DCOS_ENVIRONMENT={{{targetEnvironment}}}
'
owner: root
path: /etc/mesosphere/setup-flags/dcos-deploy-environment
permissions: '0644'
- content: 'BOOTSTRAP_ID=5b4aa43610c57ee1d60b4aa0751a1fb75824c083
'
owner: root
path: /etc/mesosphere/setup-flags/bootstrap-id
permissions: '0644'
- content: '["dcos-config--setup_{{{dcosProviderPackageID}}}", "dcos-metadata--setup_{{{dcosProviderPackageID}}}"]
'
owner: root
path: /etc/mesosphere/setup-flags/cluster-packages.json
permissions: '0644'
- content: '[Journal]
MaxLevelConsole=warning
RateLimitInterval=1s
RateLimitBurst=20000
'
owner: root
path: /etc/systemd/journald.conf.d/dcos.conf
permissions: '0644'
- content: "rexray:\n loglevel: info\n modules:\n default-admin:\n host:\
\ tcp://127.0.0.1:61003\n default-docker:\n disabled: true\n"
path: /etc/rexray/config.yml
permissions: '0644'
- content: '[Unit]
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
Environment=DEBIAN_FRONTEND=noninteractive
StandardOutput=journal+console
StandardError=journal+console
ExecStart=/usr/bin/bash -c "try=1;until dpkg -D3 -i /var/lib/mesos/dl/d.deb || ((try>9));do
echo retry $((try++));sleep $((try*try));done;systemctl --now start docker;systemctl
restart docker.socket"
'
path: /etc/systemd/system/dcos-docker-install.service
permissions: '0644'
- content: '[Service]
Restart=always
StartLimitInterval=0
RestartSec=15
ExecStartPre=-/sbin/ip link del docker0
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --storage-driver=overlay
'
path: /etc/systemd/system/docker.service.d/execstart.conf
permissions: '0644'
- content: '[Unit]
PartOf=docker.service
[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker
ListenStream=2375
BindIPv6Only=both
[Install]
WantedBy=sockets.target
'
path: /etc/systemd/system/docker.socket
permissions: '0644'
- content: '[Unit]
Requires=dcos-setup.service
After=dcos-setup.service
[Service]
Type=oneshot
EnvironmentFile=/etc/environment
EnvironmentFile=/opt/mesosphere/environment
ExecStart=/usr/bin/bash -c "echo $(detect_ip) $(hostname) > /etc/hosts"
'
path: /etc/systemd/system/dcos-config-writer.service
permissions: '0644'
- content: 'MESOS_CLUSTER={{{masterPublicIPAddressName}}}
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/mesos-master-provider
- content: 'ADMINROUTER_ACTIVATE_AUTH_MODULE={{{oauthEnabled}}}
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/adminrouter.env
- content: '["'', DCOSCUSTOMDATAPUBLICIPSTR''"]
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/master_list
- content: 'EXHIBITOR_BACKEND=AZURE
AZURE_CONTAINER=dcos-exhibitor
AZURE_PREFIX={{{masterPublicIPAddressName}}}
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/exhibitor
- content: 'com.netflix.exhibitor.azure.account-name={{{masterStorageAccountExhibitorName}}}
com.netflix.exhibitor.azure.account-key='', listKeys(resourceId(''Microsoft.Storage/storageAccounts'',
variables(''masterStorageAccountExhibitorName'')), ''2015-06-15'').key1,''
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/exhibitor.properties
- content: '{"uiConfiguration":{"plugins":{"banner":{"enabled":false,"backgroundColor":"#1E232F","foregroundColor":"#FFFFFF","headerTitle":null,"headerContent":null,"footerContent":null,"imagePath":null,"dismissible":null},"branding":{"enabled":false},"external-links":
{"enabled": false},
"authentication":{"enabled":false},
"oauth":{"enabled":{{{oauthEnabled}}},"authHost":"https://dcos.auth0.com"},
"tracking":{"enabled":false}}}}
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/ui-config.json
- content: '{}'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/pkginfo.json
- content: '[Unit]
Before=dcos.target
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/mkdir -p /etc/profile.d
ExecStart=/usr/bin/ln -sf /opt/mesosphere/environment.export /etc/profile.d/dcos.sh
'
path: /etc/systemd/system/dcos-link-env.service
permissions: '0644'
- content: '[Unit]
Description=Pkgpanda: Download DC/OS to this host.
After=network-online.target
Wants=network-online.target
ConditionPathExists=!/opt/mesosphere/
[Service]
EnvironmentFile=/etc/mesosphere/setup-flags/bootstrap-id
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/curl --keepalive-time 2 -fLsSv --retry 20 -Y 100000 -y 60
-o /var/lib/mesos/dl/bootstrap.tar.xz {{{dcosBootstrapURL}}}
ExecStartPre=/usr/bin/mkdir -p /opt/mesosphere
ExecStart=/usr/bin/tar -axf /var/lib/mesos/dl/bootstrap.tar.xz -C /opt/mesosphere
ExecStartPost=-/usr/bin/rm -f /var/lib/mesos/dl/bootstrap.tar.xz
'
path: /etc/systemd/system/dcos-download.service
permissions: '0644'
- content: '[Unit]
Description=Pkgpanda: Specialize DC/OS for this host.
Requires=dcos-download.service
After=dcos-download.service
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
EnvironmentFile=/opt/mesosphere/environment
ExecStart=/opt/mesosphere/bin/pkgpanda setup --no-block-systemd
[Install]
WantedBy=multi-user.target
'
path: /etc/systemd/system/dcos-setup.service
permissions: '0644'
- path: /var/lib/dcos/mesos-slave-common
content: 'ATTRIBUTES_STR'
- content: ''
path: /etc/mesosphere/roles/azure
- content: 'PROVISION_STR'
path: "/opt/azure/containers/provision.sh"
permissions: "0744"
owner: "root"
- content: '{ "auths": { "{{{registry}}}": { "auth" : "{{{registryKey}}}" } } }'
path: "/tmp/xtoph/.docker/config.json"
owner: "root"

Просмотреть файл

@ -1,364 +0,0 @@
bootcmd:
- bash -c "if [ ! -f /var/lib/sdb-gpt ];then echo DCOS-5890;parted -s /dev/sdb mklabel
gpt;touch /var/lib/sdb-gpt;fi"
disk_setup:
ephemeral0:
layout:
- 50
- 50
overwrite: true
table_type: gpt
fs_setup:
- device: ephemeral0.1
filesystem: ext4
overwrite: true
- device: ephemeral0.2
filesystem: ext4
overwrite: true
mounts:
- - ephemeral0.1
- /var/lib/mesos
- - ephemeral0.2
- /var/lib/docker
runcmd: PREPROVISION_EXTENSION
- /usr/lib/apt/apt.systemd.daily
- echo 2dd1ce17-079e-403c-b352-a1921ee207ee > /sys/bus/vmbus/drivers/hv_util/unbind # mitigation for bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1676635
- sed -i "13i\echo 2dd1ce17-079e-403c-b352-a1921ee207ee > /sys/bus/vmbus/drivers/hv_util/unbind\n" /etc/rc.local # mitigation for bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1676635
- - ln
- -s
- /bin/rm
- /usr/bin/rm
- - ln
- -s
- /bin/mkdir
- /usr/bin/mkdir
- - ln
- -s
- /bin/tar
- /usr/bin/tar
- - ln
- -s
- /bin/ln
- /usr/bin/ln
- - ln
- -s
- /bin/cp
- /usr/bin/cp
- - ln
- -s
- /bin/systemctl
- /usr/bin/systemctl
- - ln
- -s
- /bin/mount
- /usr/bin/mount
- - ln
- -s
- /bin/bash
- /usr/bin/bash
- - ln
- -s
- /usr/sbin/useradd
- /usr/bin/useradd
- - systemctl
- disable
- --now
- resolvconf.service
- - systemctl
- mask
- --now
- lxc-net.service
- - tar
- czf
- /etc/docker.tar.gz
- -C
- /tmp/xtoph
- .docker
- - rm
- -rf
- /tmp/xtoph
- /opt/azure/containers/provision.sh
- - cp
- -p
- /etc/resolv.conf
- /tmp/resolv.conf
- - rm
- -f
- /etc/resolv.conf
- - cp
- -p
- /tmp/resolv.conf
- /etc/resolv.conf
- - systemctl
- start
- dcos-docker-install.service
- - systemctl
- start
- dcos-config-writer.service
- - systemctl
- restart
- systemd-journald.service
- - systemctl
- restart
- docker.service
- - systemctl
- start
- dcos-link-env.service
- - systemctl
- enable
- dcos-setup.service
- - systemctl
- --no-block
- start
- dcos-setup.service
write_files:
- content: 'https://dcosio.azureedge.net/dcos/stable
'
owner: root
path: /etc/mesosphere/setup-flags/repository-url
permissions: '0644'
- content: '["dcos-config--setup_{{{dcosProviderPackageID}}}", "dcos-metadata--setup_{{{dcosProviderPackageID}}}"]
'
owner: root
path: /etc/mesosphere/setup-flags/cluster-packages.json
permissions: '0644'
- content: 'DCOS_ENVIRONMENT={{{targetEnvironment}}}
'
owner: root
path: /etc/mesosphere/setup-flags/dcos-deploy-environment
permissions: '0644'
- content: '[Journal]
MaxLevelConsole=warning
RateLimitInterval=1s
RateLimitBurst=20000
'
owner: root
path: /etc/systemd/journald.conf.d/dcos.conf
permissions: '0644'
- content: "rexray:\n loglevel: info\n modules:\n default-admin:\n host:\
\ tcp://127.0.0.1:61003\n default-docker:\n disabled: true\n"
path: /etc/rexray/config.yml
permissions: '0644'
- content: '[Unit]
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
Environment=DEBIAN_FRONTEND=noninteractive
StandardOutput=journal+console
StandardError=journal+console
ExecStart=/usr/bin/bash -c "try=1;until dpkg -D3 -i /var/lib/mesos/dl/d.deb || ((try>9));do
echo retry $((try++));sleep $((try*try));done;systemctl --now start docker;systemctl
restart docker.socket"
'
path: /etc/systemd/system/dcos-docker-install.service
permissions: '0644'
- content: '[Service]
Restart=always
StartLimitInterval=0
RestartSec=15
ExecStartPre=-/sbin/ip link del docker0
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --storage-driver=overlay
'
path: /etc/systemd/system/docker.service.d/execstart.conf
permissions: '0644'
- content: '[Unit]
PartOf=docker.service
[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker
ListenStream=2375
BindIPv6Only=both
[Install]
WantedBy=sockets.target
'
path: /etc/systemd/system/docker.socket
permissions: '0644'
- content: '[Unit]
Requires=dcos-setup.service
After=dcos-setup.service
[Service]
Type=oneshot
EnvironmentFile=/etc/environment
EnvironmentFile=/opt/mesosphere/environment
ExecStart=/usr/bin/bash -c "echo $(detect_ip) $(hostname) > /etc/hosts"
'
path: /etc/systemd/system/dcos-config-writer.service
permissions: '0644'
- content: 'MESOS_CLUSTER={{{masterPublicIPAddressName}}}
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/mesos-master-provider
- content: 'ADMINROUTER_ACTIVATE_AUTH_MODULE={{{oauthEnabled}}}
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/adminrouter.env
- content: '["'', DCOSCUSTOMDATAPUBLICIPSTR''"]
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/master_list
- content: 'EXHIBITOR_BACKEND=AZURE
AZURE_CONTAINER=dcos-exhibitor
AZURE_PREFIX={{{masterPublicIPAddressName}}}
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/exhibitor
- content: 'com.netflix.exhibitor.azure.account-name={{{masterStorageAccountExhibitorName}}}
com.netflix.exhibitor.azure.account-key='', listKeys(resourceId(''Microsoft.Storage/storageAccounts'',
variables(''masterStorageAccountExhibitorName'')), ''2015-06-15'').key1,''
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/exhibitor.properties
- content: '{"uiConfiguration":{"plugins":{"banner":{"enabled":false,"backgroundColor":"#1E232F","foregroundColor":"#FFFFFF","headerTitle":null,"headerContent":null,"footerContent":null,"imagePath":null,"dismissible":null},"branding":{"enabled":false},"external-links":
{"enabled": false},
"authentication":{"enabled":false},
"oauth":{"enabled":{{{oauthEnabled}}},"authHost":"https://dcos.auth0.com"},
"tracking":{"enabled":false}}}}
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/ui-config.json
- content: '{}'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/pkginfo.json
- content: '[Unit]
Before=dcos.target
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/mkdir -p /etc/profile.d
ExecStart=/usr/bin/ln -sf /opt/mesosphere/environment.export /etc/profile.d/dcos.sh
'
path: /etc/systemd/system/dcos-link-env.service
permissions: '0644'
- content: '[Unit]
Description=Pkgpanda: Download DC/OS to this host.
After=network-online.target
Wants=network-online.target
ConditionPathExists=!/opt/mesosphere/
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/curl --keepalive-time 2 -fLsSv --retry 20 -Y 100000 -y 60 -o /var/lib/mesos/dl/bootstrap.tar.xz {{{dcosBootstrapURL}}}
ExecStartPre=/usr/bin/mkdir -p /opt/mesosphere
ExecStart=/usr/bin/tar -axf /var/lib/mesos/dl/bootstrap.tar.xz -C /opt/mesosphere
ExecStartPost=-/usr/bin/rm -f /var/lib/mesos/dl/bootstrap.tar.xz
'
path: /etc/systemd/system/dcos-download.service
permissions: '0644'
- content: '[Unit]
Description=Pkgpanda: Specialize DC/OS for this host.
Requires=dcos-download.service
After=dcos-download.service
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
EnvironmentFile=/opt/mesosphere/environment
ExecStart=/opt/mesosphere/bin/pkgpanda setup --no-block-systemd
[Install]
WantedBy=multi-user.target
'
path: /etc/systemd/system/dcos-setup.service
permissions: '0644'
- content: ''
path: /etc/mesosphere/roles/azure
- content: 'PROVISION_STR'
path: "/opt/azure/containers/provision.sh"
permissions: "0744"
owner: "root"
- path: /var/lib/dcos/mesos-slave-common
content: 'ATTRIBUTES_STR'
permissions: "0644"
owner: "root"
- content: '{ "auths": { "{{{registry}}}": { "auth" : "{{{registryKey}}}" } } }'
path: "/tmp/xtoph/.docker/config.json"
owner: "root"

Просмотреть файл

@ -1,364 +0,0 @@
bootcmd:
- bash -c "if [ ! -f /var/lib/sdb-gpt ];then echo DCOS-5890;parted -s /dev/sdb mklabel
gpt;touch /var/lib/sdb-gpt;fi"
disk_setup:
ephemeral0:
layout:
- 50
- 50
overwrite: true
table_type: gpt
fs_setup:
- device: ephemeral0.1
filesystem: ext4
overwrite: true
- device: ephemeral0.2
filesystem: ext4
overwrite: true
mounts:
- - ephemeral0.1
- /var/lib/mesos
- - ephemeral0.2
- /var/lib/docker
runcmd: PREPROVISION_EXTENSION
- /usr/lib/apt/apt.systemd.daily
- echo 2dd1ce17-079e-403c-b352-a1921ee207ee > /sys/bus/vmbus/drivers/hv_util/unbind # mitigation for bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1676635
- sed -i "13i\echo 2dd1ce17-079e-403c-b352-a1921ee207ee > /sys/bus/vmbus/drivers/hv_util/unbind\n" /etc/rc.local # mitigation for bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1676635
- - ln
- -s
- /bin/rm
- /usr/bin/rm
- - ln
- -s
- /bin/mkdir
- /usr/bin/mkdir
- - ln
- -s
- /bin/tar
- /usr/bin/tar
- - ln
- -s
- /bin/ln
- /usr/bin/ln
- - ln
- -s
- /bin/cp
- /usr/bin/cp
- - ln
- -s
- /bin/systemctl
- /usr/bin/systemctl
- - ln
- -s
- /bin/mount
- /usr/bin/mount
- - ln
- -s
- /bin/bash
- /usr/bin/bash
- - ln
- -s
- /usr/sbin/useradd
- /usr/bin/useradd
- - systemctl
- disable
- --now
- resolvconf.service
- - systemctl
- mask
- --now
- lxc-net.service
- - tar
- czf
- /etc/docker.tar.gz
- -C
- /tmp/xtoph
- .docker
- - rm
- -rf
- /tmp/xtoph
- /opt/azure/containers/provision.sh
- - cp
- -p
- /etc/resolv.conf
- /tmp/resolv.conf
- - rm
- -f
- /etc/resolv.conf
- - cp
- -p
- /tmp/resolv.conf
- /etc/resolv.conf
- - systemctl
- start
- dcos-docker-install.service
- - systemctl
- start
- dcos-config-writer.service
- - systemctl
- restart
- systemd-journald.service
- - systemctl
- restart
- docker.service
- - systemctl
- start
- dcos-link-env.service
- - systemctl
- enable
- dcos-setup.service
- - systemctl
- --no-block
- start
- dcos-setup.service
write_files:
- content: 'https://dcosio.azureedge.net/dcos/stable
'
owner: root
path: /etc/mesosphere/setup-flags/repository-url
permissions: '0644'
- content: 'DCOS_ENVIRONMENT={{{targetEnvironment}}}
'
owner: root
path: /etc/mesosphere/setup-flags/dcos-deploy-environment
permissions: '0644'
- content: '["dcos-config--setup_{{{dcosProviderPackageID}}}", "dcos-metadata--setup_{{{dcosProviderPackageID}}}"]
'
owner: root
path: /etc/mesosphere/setup-flags/cluster-packages.json
permissions: '0644'
- content: '[Journal]
MaxLevelConsole=warning
RateLimitInterval=1s
RateLimitBurst=20000
'
owner: root
path: /etc/systemd/journald.conf.d/dcos.conf
permissions: '0644'
- content: "rexray:\n loglevel: info\n modules:\n default-admin:\n host:\
\ tcp://127.0.0.1:61003\n default-docker:\n disabled: true\n"
path: /etc/rexray/config.yml
permissions: '0644'
- content: '[Unit]
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
Environment=DEBIAN_FRONTEND=noninteractive
StandardOutput=journal+console
StandardError=journal+console
ExecStart=/usr/bin/bash -c "try=1;until dpkg -D3 -i /var/lib/mesos/dl/d.deb || ((try>9));do
echo retry $((try++));sleep $((try*try));done;systemctl --now start docker;systemctl
restart docker.socket"
'
path: /etc/systemd/system/dcos-docker-install.service
permissions: '0644'
- content: '[Service]
Restart=always
StartLimitInterval=0
RestartSec=15
ExecStartPre=-/sbin/ip link del docker0
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --storage-driver=overlay
'
path: /etc/systemd/system/docker.service.d/execstart.conf
permissions: '0644'
- content: '[Unit]
PartOf=docker.service
[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker
ListenStream=2375
BindIPv6Only=both
[Install]
WantedBy=sockets.target
'
path: /etc/systemd/system/docker.socket
permissions: '0644'
- content: '[Unit]
Requires=dcos-setup.service
After=dcos-setup.service
[Service]
Type=oneshot
EnvironmentFile=/etc/environment
EnvironmentFile=/opt/mesosphere/environment
ExecStart=/usr/bin/bash -c "echo $(detect_ip) $(hostname) > /etc/hosts"
'
path: /etc/systemd/system/dcos-config-writer.service
permissions: '0644'
- content: 'MESOS_CLUSTER={{{masterPublicIPAddressName}}}
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/mesos-master-provider
- content: 'ADMINROUTER_ACTIVATE_AUTH_MODULE={{{oauthEnabled}}}
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/adminrouter.env
- content: '["'', DCOSCUSTOMDATAPUBLICIPSTR''"]
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/master_list
- content: 'EXHIBITOR_BACKEND=AZURE
AZURE_CONTAINER=dcos-exhibitor
AZURE_PREFIX={{{masterPublicIPAddressName}}}
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/exhibitor
- content: 'com.netflix.exhibitor.azure.account-name={{{masterStorageAccountExhibitorName}}}
com.netflix.exhibitor.azure.account-key='', listKeys(resourceId(''Microsoft.Storage/storageAccounts'',
variables(''masterStorageAccountExhibitorName'')), ''2015-06-15'').key1,''
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/exhibitor.properties
- content: '{"uiConfiguration":{"plugins":{"banner":{"enabled":false,"backgroundColor":"#1E232F","foregroundColor":"#FFFFFF","headerTitle":null,"headerContent":null,"footerContent":null,"imagePath":null,"dismissible":null},"branding":{"enabled":false},"external-links":
{"enabled": false},
"authentication":{"enabled":false},
"oauth":{"enabled":{{{oauthEnabled}}},"authHost":"https://dcos.auth0.com"},
"tracking":{"enabled":false}}}}
'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/etc/ui-config.json
- content: '{}'
path: /etc/mesosphere/setup-packages/dcos-provider-azure--setup/pkginfo.json
- content: '[Unit]
Before=dcos.target
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/mkdir -p /etc/profile.d
ExecStart=/usr/bin/ln -sf /opt/mesosphere/environment.export /etc/profile.d/dcos.sh
'
path: /etc/systemd/system/dcos-link-env.service
permissions: '0644'
- content: '[Unit]
Description=Pkgpanda: Download DC/OS to this host.
After=network-online.target
Wants=network-online.target
ConditionPathExists=!/opt/mesosphere/
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/curl --keepalive-time 2 -fLsSv --retry 20 -Y 100000 -y 60 -o /var/lib/mesos/dl/bootstrap.tar.xz {{{dcosBootstrapURL}}}
ExecStartPre=/usr/bin/mkdir -p /opt/mesosphere
ExecStart=/usr/bin/tar -axf /var/lib/mesos/dl/bootstrap.tar.xz -C /opt/mesosphere
ExecStartPost=-/usr/bin/rm -f /var/lib/mesos/dl/bootstrap.tar.xz
'
path: /etc/systemd/system/dcos-download.service
permissions: '0644'
- content: '[Unit]
Description=Pkgpanda: Specialize DC/OS for this host.
Requires=dcos-download.service
After=dcos-download.service
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
EnvironmentFile=/opt/mesosphere/environment
ExecStart=/opt/mesosphere/bin/pkgpanda setup --no-block-systemd
[Install]
WantedBy=multi-user.target
'
path: /etc/systemd/system/dcos-setup.service
permissions: '0644'
- content: ''
path: /etc/mesosphere/roles/azure
- content: 'PROVISION_STR'
path: "/opt/azure/containers/provision.sh"
permissions: "0744"
owner: "root"
- path: /var/lib/dcos/mesos-slave-common
content: 'ATTRIBUTES_STR'
permissions: "0644"
owner: "root"
- content: '{ "auths": { "{{{registry}}}": { "auth" : "{{{registryKey}}}" } } }'
path: "/tmp/xtoph/.docker/config.json"
owner: "root"

Просмотреть файл

@ -1,357 +0,0 @@
bootcmd:
- bash -c "if [ ! -f /var/lib/sdb-gpt ];then echo DCOS-5890;parted -s /dev/sdb mklabel
gpt;touch /var/lib/sdb-gpt;fi"
disk_setup:
ephemeral0:
layout:
- 45
- 45
- 10
overwrite: true
table_type: gpt
fs_setup:
- device: ephemeral0.1
filesystem: ext4
overwrite: true
- device: ephemeral0.2
filesystem: ext4
overwrite: true
- device: ephemeral0.3
filesystem: ext4
overwrite: true
mounts:
- - ephemeral0.1
- /var/lib/mesos
- - ephemeral0.2
- /var/lib/docker
- - ephemeral0.3
- /var/tmp
runcmd: PREPROVISION_EXTENSION
- /usr/lib/apt/apt.systemd.daily
- echo 2dd1ce17-079e-403c-b352-a1921ee207ee > /sys/bus/vmbus/drivers/hv_util/unbind # mitigation for bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1676635
- sed -i "13i\echo 2dd1ce17-079e-403c-b352-a1921ee207ee > /sys/bus/vmbus/drivers/hv_util/unbind\n" /etc/rc.local # mitigation for bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1676635
- - ln
- -s
- /bin/rm
- /usr/bin/rm
- - ln
- -s
- /bin/mkdir
- /usr/bin/mkdir
- - ln
- -s
- /bin/tar
- /usr/bin/tar
- - ln
- -s
- /bin/ln
- /usr/bin/ln
- - ln
- -s
- /bin/cp
- /usr/bin/cp
- - ln
- -s
- /bin/systemctl
- /usr/bin/systemctl
- - ln
- -s
- /bin/mount
- /usr/bin/mount
- - ln
- -s
- /bin/bash
- /usr/bin/bash
- - ln
- -s
- /usr/sbin/useradd
- /usr/bin/useradd
- - systemctl
- disable
- --now
- resolvconf.service
- - systemctl
- mask
- --now
- lxc-net.service
- - systemctl
- disable
- --now
- unscd.service
- - systemctl
- stop
- --now
- unscd.service
- sed -i "s/^Port 22$/Port 22\nPort 2222/1" /etc/ssh/sshd_config
- service ssh restart
- /opt/azure/containers/setup_ephemeral_disk.sh
- - tar
- czf
- /etc/docker.tar.gz
- -C
- /tmp/xtoph
- .docker
- - rm
- -rf
- /tmp/xtoph
- /opt/azure/containers/provision.sh
- - cp
- -p
- /etc/resolv.conf
- /tmp/resolv.conf
- - rm
- -f
- /etc/resolv.conf
- - cp
- -p
- /tmp/resolv.conf
- /etc/resolv.conf
- - systemctl
- start
- dcos-docker-install.service
- - systemctl
- start
- dcos-config-writer.service
- - systemctl
- restart
- systemd-journald.service
- - systemctl
- restart
- docker.service
- - systemctl
- start
- dcos-link-env.service
- - systemctl
- enable
- dcos-setup.service
- - systemctl
- --no-block
- start
- dcos-setup.service
write_files:
- content: '{{{dcosRepositoryURL}}}
'
owner: root
path: /etc/mesosphere/setup-flags/repository-url
permissions: '0644'
- content: '["3dt--7847ebb24bf6756c3103902971b34c3f09c3afbd", "adminrouter--0493a6fdaed08e1971871818e194aa4607df4f09",
"avro-cpp--760c214063f6b038b522eaf4b768b905fed56ebc", "boost-libs--2015ccb58fb756f61c02ee6aa05cc1e27459a9ec",
"bootstrap--59a905ecee27e71168ed44cefda4481fb76b816d", "boto--6344d31eef082c7bd13259b17034ea7b5c34aedf",
"check-time--be7d0ba757ec87f9965378fee7c76a6ee5ae996d", "cni--e48337da39a8cd379414acfe0da52a9226a10d24",
"cosmos--20decef90f0623ed253a12ec4cf5c148b18d8249", "curl--fc3486c43f98e63f9b12675f1356e8fe842f26b0",
"dcos-config--setup_{{{dcosProviderPackageID}}}", "dcos-history--77b0e97d7b25c8bedf8f7da0689cac65b83e3813",
"dcos-image--bda6a02bcb2eb21c4218453a870cc584f921a800", "dcos-image-deps--83584fd868e5b470f7cf754424a9a75b328e9b68",
"dcos-integration-test--c28bcb2347799dca43083f55e4c7b28503176f9c", "dcos-log--4d630df863228f38c6333e44670b4c4b20a74832",
"dcos-metadata--setup_{{{dcosProviderPackageID}}}", "dcos-metrics--23ee2f89c58b1258bc959f1d0dd7debcbb3d79d2",
"dcos-oauth--0079529da183c0f23a06d2b069721b6fa6cc7b52", "dcos-signal--1bcd3b612cbdc379380dcba17cdf9a3b6652d9dc",
"dcos-ui--d4afd695796404a5b35950c3daddcae322481ac4", "dnspython--0f833eb9a8abeba3179b43f3a200a8cd42d3795a",
"docker-gc--59a98ed6446a084bf74e4ff4b8e3479f59ea8528", "dvdcli--5374dd4ffb519f1dcefdec89b2247e3404f2e2e3",
"erlang--a9ee2530357a3301e53056b36a93420847b339a3", "exhibitor--72d9d8f947e5411eda524d40dde1a58edeb158ed",
"flask--26d1bcdb2d1c3dcf1d2c03bc0d4f29c86d321b21", "java--cd5e921ce66b0d3303883c06d73a657314044304",
"libevent--208be855d2be29c9271a7bd6c04723ff79946e02", "libffi--83ce3bd7eda2ef089e57efd2bc16c144d5a1f094",
"libsodium--9ff915db08c6bba7d6738af5084e782b13c84bf8", "logrotate--7f7bc4416d3ad101d0c5218872858483b516be07",
"marathon--bfb24f7f90cb3cd52a1cb22a07caafa5013bba21", "mesos--aaedd03eee0d57f5c0d49c74ff1e5721862cad98",
"mesos-dns--0401501b2b5152d01bfa84ff6d007fdafe414b16", "mesos-modules--311849eaae42696b8a7eefe86b9ab3ebd9bd48f5",
"metronome--467e4c64f804dbd4cd8572516e111a3f9298c10d", "navstar--1128db0234105a64fb4be52f4453cd6aa895ff30",
"ncurses--d889894b71aa1a5b311bafef0e85479025b4dacb", "octarine--e86d3312691b12523280d56f6260216729aaa0ad",
"openssl--b01a32a42e3ccba52b417276e9509a441e1d4a82", "pkgpanda-api--541feb8a8be58bdde8fecf1d2e5bfa0515f5a7d0",
"pkgpanda-role--f8a749a4a821476ad2ef7e9dd9d12b6a8c4643a4", "pytest--78aee3e58a049cdab0d266af74f77d658b360b4f",
"python--b7a144a49577a223d37d447c568f51330ee95390", "python-azure-mgmt-resource--03c05550f43b0e7a4455c33fe43b0deb755d87f0",
"python-cryptography--4184767c68e48801dd394072cb370c610a05029d", "python-dateutil--fdc6ff929f65dd0918cf75a9ad56704683d31781",
"python-docopt--beba78faa13e5bf4c52393b4b82d81f3c391aa65", "python-gunicorn--a537f95661fb2689c52fe12510eb0d01cb83af60",
"python-isodate--40d378c688e6badfd16676dd8b51b742bfebc8d5", "python-jinja2--7450f5ae5a822f63f7a58c717207be0456df51ed",
"python-kazoo--cb7ce13a1068cd82dd84ea0de32b529a760a4bdd", "python-markupsafe--dd46d2a3c58611656a235f96d4adc51b2a7a590e",
"python-passlib--802ec3605c0b82428fedba60983b1bafaa036bb8", "python-pyyaml--81dd44cc4a24db7cefa7016c6586a131acf279c3",
"python-requests--1b2cadbd3811cc0c2ee235ce927e13ea1d6af41d", "python-retrying--eb7b8bac133f50492b1e1349cbe77c3e38bd02c3",
"python-tox--07244f8a939a10353634c952c6d88ec4a3c05736", "rexray--869621bb411c9f2a793ea42cdfeed489e1972aaa",
"six--f06424b68523c4dfa2a7c3e7475d479f3d361e42", "spartan--9cc57a3d55452b905d90e3201f56913140914ecc",
"strace--7d01796d64994451c1b2b82d161a335cbe90569b", "teamcity-messages--e623a4d86eb3a8d199cefcc240dd4c5460cb2962",
"toybox--f235594ab8ea9a2864ee72abe86723d76f92e848"]
'
owner: root
path: /etc/mesosphere/setup-flags/cluster-packages.json
permissions: '0644'
- content: |
[Journal]
MaxLevelConsole=warning
RateLimitInterval=1s
RateLimitBurst=20000
owner: root
path: /etc/systemd/journald.conf.d/dcos.conf
permissions: '0644'
- content: |
rexray:
loglevel: info
modules:
default-admin:
host: tcp://127.0.0.1:61003
default-docker:
disabled: true
path: /etc/rexray/config.yml
permissions: '0644'
- content: |
[Unit]
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
Environment=DEBIAN_FRONTEND=noninteractive
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/curl -fLsSv --retry 20 -Y 100000 -y 60 -o /var/tmp/d.deb https://az837203.vo.msecnd.net/dcos-deps/docker-engine_1.13.1-0-ubuntu-xenial_amd64.deb
ExecStart=/usr/bin/bash -c "try=1;until dpkg -D3 -i /var/tmp/d.deb || ((try>9));do echo retry $((try++));sleep $((try*try));done;systemctl --now start docker;systemctl restart docker.socket"
path: /etc/systemd/system/dcos-docker-install.service
permissions: '0644'
- content: |
[Service]
Restart=always
StartLimitInterval=0
RestartSec=15
LimitNOFILE=16384
ExecStartPre=-/sbin/ip link del docker0
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --storage-driver=overlay
path: /etc/systemd/system/docker.service.d/execstart.conf
permissions: '0644'
- content: |
[Unit]
PartOf=docker.service
[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker
ListenStream=2375
BindIPv6Only=both
[Install]
WantedBy=sockets.target
path: /etc/systemd/system/docker.socket
permissions: '0644'
content: |
[Unit]
Requires=dcos-setup.service
After=dcos-setup.service
[Service]
Type=oneshot
EnvironmentFile=/etc/environment
EnvironmentFile=/opt/mesosphere/environment
ExecStart=/usr/bin/bash -c "echo $(detect_ip) $(hostname) > /etc/hosts"
path: /etc/systemd/system/dcos-config-writer.service
permissions: '0644'
- content: |
"bound_values":
"adminrouter_auth_enabled": |-
{{{oauthEnabled}}}
"cluster_name": |-
{{{masterPublicIPAddressName}}}
"exhibitor_azure_account_key": |-
', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('masterStorageAccountExhibitorName')), '2015-06-15').key1, '
"exhibitor_azure_account_name": |-
{{{masterStorageAccountExhibitorName}}}
"exhibitor_azure_prefix": |-
{{{masterPublicIPAddressName}}}
"master_list": |-
["', DCOSCUSTOMDATAPUBLICIPSTR'"]
"oauth_enabled": |-
{{{oauthEnabled}}}
"late_bound_package_id": |-
dcos-provider-{{{dcosProviderPackageID}}}-azure--setup
owner: root
path: /etc/mesosphere/setup-flags/late-config.yaml
permissions: '0644'
- content: |
[Unit]
Before=dcos.target
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/mkdir -p /etc/profile.d
ExecStart=/usr/bin/ln -sf /opt/mesosphere/bin/add_dcos_path.sh /etc/profile.d/dcos.sh
path: /etc/systemd/system/dcos-link-env.service
permissions: '0644'
- content: |
[Unit]
Description=Pkgpanda: Download DC/OS to this host.
After=network-online.target
Wants=network-online.target
ConditionPathExists=!/opt/mesosphere/
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/curl --keepalive-time 2 -fLsSv --retry 20 -Y 100000 -y 60 -o //var/tmp/bootstrap.tar.xz {{{dcosBootstrapURL}}}
ExecStartPre=/usr/bin/mkdir -p /opt/mesosphere
ExecStart=/usr/bin/tar -axf //var/tmp/bootstrap.tar.xz -C /opt/mesosphere
ExecStartPost=-/usr/bin/rm -f //var/tmp/bootstrap.tar.xz
path: /etc/systemd/system/dcos-download.service
permissions: '0644'
- content: |
[Unit]
Description=Pkgpanda: Specialize DC/OS for this host.
Requires=dcos-download.service
After=dcos-download.service
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
EnvironmentFile=/opt/mesosphere/environment
ExecStart=/opt/mesosphere/bin/pkgpanda setup --no-block-systemd
[Install]
WantedBy=multi-user.target
path: /etc/systemd/system/dcos-setup.service
permissions: '0644'
- content: ''
path: /etc/mesosphere/roles/azure
- content: 'PROVISION_STR'
path: "/opt/azure/containers/provision.sh"
permissions: "0744"
owner: "root"
- path: /var/lib/dcos/mesos-slave-common
content: 'ATTRIBUTES_STR'
permissions: "0644"
owner: "root"
- content: '{ "auths": { "{{{registry}}}": { "auth" : "{{{registryKey}}}" } } }'
path: "/tmp/xtoph/.docker/config.json"
owner: "root"
- content: |
#!/bin/bash
# Check the partitions on /dev/sdb created by cloudinit and force a detach and
# reformat of the parition. After which, all will be remounted.
EPHEMERAL_DISK="/dev/sdb"
PARTITIONS=`fdisk -l $EPHEMERAL_DISK | grep "^$EPHEMERAL_DISK" | cut -d" " -f1 | sed "s~$EPHEMERAL_DISK~~"`
if [ -n "$PARTITIONS" ]; then
for f in $PARTITIONS; do
df -k | grep "/dev/sdb$f"
if [ $? -eq 0 ]; then
umount -f /dev/sdb$f
fi
mkfs.ext4 /dev/sdb$f
done
mount -a
fi
# If there is a /var/tmp partition on the ephemeral disk, create a symlink such
# that the /var/log/mesos and /var/log/journal placed on the ephemeral disk.
VAR_TMP_PARTITION=`df -P /var/tmp | tail -1 | cut -d" " -f 1`
echo $VAR_TMP_PARTITION | grep "^$EPHEMERAL_DISK"
if [ $? -eq 0 ]; then
# Handle the /var/log/mesos directory
mkdir -p /var/tmp/log/mesos
if [ -d "/var/log/mesos" ]; then
cp -rp /var/log/mesos/* /var/tmp/log/mesos/
rm -rf /var/log/mesos
fi
ln -s /var/tmp/log/mesos /var/log/mesos
# Handle the /var/log/journal direcotry
mkdir -p /var/tmp/log/journal
if [ -d "/var/log/journal" ]; then
cp -rp /var/log/journal/* /var/tmp/log/journal/
rm -rf /var/log/journal
fi
ln -s /var/tmp/log/journal /var/log/journal
fi
path: "/opt/azure/containers/setup_ephemeral_disk.sh"
permissions: "0744"
owner: "root"

Просмотреть файл

@ -1,357 +0,0 @@
bootcmd:
- bash -c "if [ ! -f /var/lib/sdb-gpt ];then echo DCOS-5890;parted -s /dev/sdb mklabel
gpt;touch /var/lib/sdb-gpt;fi"
disk_setup:
ephemeral0:
layout:
- 45
- 45
- 10
overwrite: true
table_type: gpt
fs_setup:
- device: ephemeral0.1
filesystem: ext4
overwrite: true
- device: ephemeral0.2
filesystem: ext4
overwrite: true
- device: ephemeral0.3
filesystem: ext4
overwrite: true
mounts:
- - ephemeral0.1
- /var/lib/mesos
- - ephemeral0.2
- /var/lib/docker
- - ephemeral0.3
- /var/tmp
runcmd: PREPROVISION_EXTENSION
- /usr/lib/apt/apt.systemd.daily
- echo 2dd1ce17-079e-403c-b352-a1921ee207ee > /sys/bus/vmbus/drivers/hv_util/unbind # mitigation for bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1676635
- sed -i "13i\echo 2dd1ce17-079e-403c-b352-a1921ee207ee > /sys/bus/vmbus/drivers/hv_util/unbind\n" /etc/rc.local # mitigation for bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1676635
- - ln
- -s
- /bin/rm
- /usr/bin/rm
- - ln
- -s
- /bin/mkdir
- /usr/bin/mkdir
- - ln
- -s
- /bin/tar
- /usr/bin/tar
- - ln
- -s
- /bin/ln
- /usr/bin/ln
- - ln
- -s
- /bin/cp
- /usr/bin/cp
- - ln
- -s
- /bin/systemctl
- /usr/bin/systemctl
- - ln
- -s
- /bin/mount
- /usr/bin/mount
- - ln
- -s
- /bin/bash
- /usr/bin/bash
- - ln
- -s
- /usr/sbin/useradd
- /usr/bin/useradd
- - systemctl
- disable
- --now
- resolvconf.service
- - systemctl
- mask
- --now
- lxc-net.service
- - systemctl
- disable
- --now
- unscd.service
- - systemctl
- stop
- --now
- unscd.service
- sed -i "s/^Port 22$/Port 22\nPort 2222/1" /etc/ssh/sshd_config
- service ssh restart
- /opt/azure/containers/setup_ephemeral_disk.sh
- - tar
- czf
- /etc/docker.tar.gz
- -C
- /tmp/xtoph
- .docker
- - rm
- -rf
- /tmp/xtoph
- /opt/azure/containers/provision.sh
- - cp
- -p
- /etc/resolv.conf
- /tmp/resolv.conf
- - rm
- -f
- /etc/resolv.conf
- - cp
- -p
- /tmp/resolv.conf
- /etc/resolv.conf
- - systemctl
- start
- dcos-docker-install.service
- - systemctl
- start
- dcos-config-writer.service
- - systemctl
- restart
- systemd-journald.service
- - systemctl
- restart
- docker.service
- - systemctl
- start
- dcos-link-env.service
- - systemctl
- enable
- dcos-setup.service
- - systemctl
- --no-block
- start
- dcos-setup.service
write_files:
- content: '{{{dcosRepositoryURL}}}
'
owner: root
path: /etc/mesosphere/setup-flags/repository-url
permissions: '0644'
- content: '["3dt--4eb6a10d16421bc87cb6e93ac97746f36aded925", "adminrouter--31f3f6390c8ef79a2774f42390d6340a24d67f08",
"avro-cpp--6194e9a67928c357c1c1b2bb409536ceef888e04", "boost-libs--2015ccb58fb756f61c02ee6aa05cc1e27459a9ec",
"bootstrap--d50592de9bf45937df7bcc7008e84a8739239c99", "boto--471853efd730e52e4ed7bfb890587432a576982a",
"check-time--be7d0ba757ec87f9965378fee7c76a6ee5ae996d", "cni--e48337da39a8cd379414acfe0da52a9226a10d24",
"cosmos--74e0339c91c278622d9f45b5fb0771872f443140", "curl--e7fd5880e4f94db05692d7e43279d8fe6348cb21",
"dcos-config--setup_{{{dcosProviderPackageID}}}", "dcos-history--787ce2fd81cb7469590c12951033f0482e879d2a",
"dcos-image--078703170a2f218447abea4b1be00b7431b340f1", "dcos-image-deps--5512ff49cdbba7f404759a5751a4ab1eae44c677",
"dcos-integration-test--bad12974ed31ace44432ad9a451c5b5dc3e20e81", "dcos-log--4d630df863228f38c6333e44670b4c4b20a74832",
"dcos-metadata--setup_{{{dcosProviderPackageID}}}", "dcos-metrics--e65d65e1b65335efdaa6bf7609a671f4288e7af9",
"dcos-oauth--23d8ca77549c1ac6087c11c9f7e8f8a4fddfc948", "dcos-signal--5633dc8da7e864cb34e3d29ed13e6756c7a6df94",
"dcos-ui--6f4af319cf4dd9bb8366de22ec37775beaa96747", "dnspython--1118f0ffaa60e6a779d4614f0ed692d215005f0e",
"docker-gc--9737ec72de5d1edc71175028762f06fe22c8a48c", "dvdcli--5374dd4ffb519f1dcefdec89b2247e3404f2e2e3",
"erlang--984871e11f69e37aeb76a471d4a4b90e93fdf355", "exhibitor--300da0c612afcf27541dbc681da5de3a6408de7e",
"flask--2936647fa917d16ee289d34e61fd1afcc49157b5", "java--091eb5a0f3dcbd7762a43e84c3e2d6aac8891111",
"libevent--468f4ae789f659e452e8356a9d2309c4f41135a8", "libffi--83ce3bd7eda2ef089e57efd2bc16c144d5a1f094",
"libsodium--9ff915db08c6bba7d6738af5084e782b13c84bf8", "logrotate--7f7bc4416d3ad101d0c5218872858483b516be07",
"marathon--99d0cbc65da6be31872878174f3a28fa63d0fa34", "mesos--0c992033b8d43e00dc69f0c548c826d573c82642",
"mesos-dns--ca591a18f9b010999106285fedddd010606c0d06", "mesos-modules--4c176c23a4fd3670d059fec55e2d4c8c7dbf1f6c",
"metronome--138ec50cd4da05bce74b6cd2c84ae873c2bd67ab", "navstar--fdf7e79fdf210548d183badfde00d60c1a540257",
"ncurses--d889894b71aa1a5b311bafef0e85479025b4dacb", "octarine--4e37c062d2f145f9c2ce01d30dadf72c2aac5c4a",
"openssl--ef04a6f76f6e5e194c783bc129fdabad16816aff", "pkgpanda-api--220e45fbd93403f8b4fd7f9c8c3d5178aff6e34b",
"pkgpanda-role--f8a749a4a821476ad2ef7e9dd9d12b6a8c4643a4", "pytest--63ab7e9520e4da70202b81076880fcdf2c1236cf",
"python--3c96ab7f21312f4d7d54a9b901cfe6382aa66b8a", "python-azure-mgmt-resource--2313114eec2adcb37ef61082cd2cfdceabf5c21e",
"python-cryptography--39ee7d59411569700f3343e64c32e9711a83decc", "python-dateutil--d098c1933ca6d754a90734afd366d556cc3107a8",
"python-docopt--85e7726dbb777584a9f5d4dd7bd58ed8ca5466d8", "python-gunicorn--bd425f55abd9236b5ead7e68a3c40c39b8d75bb7",
"python-isodate--9a15007db453e141892966ebf50a9175ee0ba08b", "python-jinja2--9fbc35d1405f06f1959c54629ab7d443cef79076",
"python-kazoo--050358610274815ebacabcdfca874729e53f4e0b", "python-markupsafe--09c65e6cdedd4783137a203cbc1b5a64ef3124eb",
"python-passlib--27056b95ad1a067b7992402e679c6260e673a554", "python-pyyaml--5be319fd73348558d69a03fb6dcb134e9b7f4c48",
"python-requests--63e1c3f4f03efc4607a4c20c5492026a9af7a9c7", "python-retrying--692b1a298d22436e25b2d14fc4f980be444adbe7",
"python-tox--7962137d89dae9eb45dd80b0ea59731fa3f5bbc9", "rexray--f07795e2c10f9a1a27de9d8e67ab171029db2e1d",
"six--9229b1a9d7d57bc086fa50f73fc9a753d9a4605d", "spartan--3dc1785bf698e65ceb2fecf26b2a439de219269f",
"strace--7d01796d64994451c1b2b82d161a335cbe90569b", "teamcity-messages--d13bc3f52ed0e30de3a71d86ff8718984b60b65f",
"toybox--c0e85790eb8aaeefe5037b053c2fcd140ab800a4"]
'
owner: root
path: /etc/mesosphere/setup-flags/cluster-packages.json
permissions: '0644'
- content: |
[Journal]
MaxLevelConsole=warning
RateLimitInterval=1s
RateLimitBurst=20000
owner: root
path: /etc/systemd/journald.conf.d/dcos.conf
permissions: '0644'
- content: |
rexray:
loglevel: info
modules:
default-admin:
host: tcp://127.0.0.1:61003
default-docker:
disabled: true
path: /etc/rexray/config.yml
permissions: '0644'
- content: |
[Unit]
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
Environment=DEBIAN_FRONTEND=noninteractive
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/curl -fLsSv --retry 20 -Y 100000 -y 60 -o /var/tmp/d.deb https://az837203.vo.msecnd.net/dcos-deps/docker-engine_1.13.1-0-ubuntu-xenial_amd64.deb
ExecStart=/usr/bin/bash -c "try=1;until dpkg -D3 -i /var/tmp/d.deb || ((try>9));do echo retry $((try++));sleep $((try*try));done;systemctl --now start docker;systemctl restart docker.socket"
path: /etc/systemd/system/dcos-docker-install.service
permissions: '0644'
- content: |
[Service]
Restart=always
StartLimitInterval=0
RestartSec=15
LimitNOFILE=16384
ExecStartPre=-/sbin/ip link del docker0
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --storage-driver=overlay
path: /etc/systemd/system/docker.service.d/execstart.conf
permissions: '0644'
- content: |
[Unit]
PartOf=docker.service
[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker
ListenStream=2375
BindIPv6Only=both
[Install]
WantedBy=sockets.target
path: /etc/systemd/system/docker.socket
permissions: '0644'
content: |
[Unit]
Requires=dcos-setup.service
After=dcos-setup.service
[Service]
Type=oneshot
EnvironmentFile=/etc/environment
EnvironmentFile=/opt/mesosphere/environment
ExecStart=/usr/bin/bash -c "echo $(detect_ip) $(hostname) > /etc/hosts"
path: /etc/systemd/system/dcos-config-writer.service
permissions: '0644'
- content: |
"bound_values":
"adminrouter_auth_enabled": |-
{{{oauthEnabled}}}
"cluster_name": |-
{{{masterPublicIPAddressName}}}
"exhibitor_azure_account_key": |-
', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('masterStorageAccountExhibitorName')), '2015-06-15').key1, '
"exhibitor_azure_account_name": |-
{{{masterStorageAccountExhibitorName}}}
"exhibitor_azure_prefix": |-
{{{masterPublicIPAddressName}}}
"master_list": |-
["', DCOSCUSTOMDATAPUBLICIPSTR'"]
"oauth_enabled": |-
{{{oauthEnabled}}}
"late_bound_package_id": |-
dcos-provider-{{{dcosProviderPackageID}}}-azure--setup
owner: root
path: /etc/mesosphere/setup-flags/late-config.yaml
permissions: '0644'
- content: |
[Unit]
Before=dcos.target
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/mkdir -p /etc/profile.d
ExecStart=/usr/bin/ln -sf /opt/mesosphere/bin/add_dcos_path.sh /etc/profile.d/dcos.sh
path: /etc/systemd/system/dcos-link-env.service
permissions: '0644'
- content: |
[Unit]
Description=Pkgpanda: Download DC/OS to this host.
After=network-online.target
Wants=network-online.target
ConditionPathExists=!/opt/mesosphere/
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
ExecStartPre=/usr/bin/curl --keepalive-time 2 -fLsSv --retry 20 -Y 100000 -y 60 -o //var/tmp/bootstrap.tar.xz {{{dcosBootstrapURL}}}
ExecStartPre=/usr/bin/mkdir -p /opt/mesosphere
ExecStart=/usr/bin/tar -axf //var/tmp/bootstrap.tar.xz -C /opt/mesosphere
ExecStartPost=-/usr/bin/rm -f //var/tmp/bootstrap.tar.xz
path: /etc/systemd/system/dcos-download.service
permissions: '0644'
- content: |
[Unit]
Description=Pkgpanda: Specialize DC/OS for this host.
Requires=dcos-download.service
After=dcos-download.service
[Service]
Type=oneshot
StandardOutput=journal+console
StandardError=journal+console
EnvironmentFile=/opt/mesosphere/environment
ExecStart=/opt/mesosphere/bin/pkgpanda setup --no-block-systemd
[Install]
WantedBy=multi-user.target
path: /etc/systemd/system/dcos-setup.service
permissions: '0644'
- content: ''
path: /etc/mesosphere/roles/azure
- content: 'PROVISION_STR'
path: "/opt/azure/containers/provision.sh"
permissions: "0744"
owner: "root"
- path: /var/lib/dcos/mesos-slave-common
content: 'ATTRIBUTES_STR'
permissions: "0644"
owner: "root"
- content: '{ "auths": { "{{{registry}}}": { "auth" : "{{{registryKey}}}" } } }'
path: "/tmp/xtoph/.docker/config.json"
owner: "root"
- content: |
#!/bin/bash
# Check the partitions on /dev/sdb created by cloudinit and force a detach and
# reformat of the parition. After which, all will be remounted.
EPHEMERAL_DISK="/dev/sdb"
PARTITIONS=`fdisk -l $EPHEMERAL_DISK | grep "^$EPHEMERAL_DISK" | cut -d" " -f1 | sed "s~$EPHEMERAL_DISK~~"`
if [ -n "$PARTITIONS" ]; then
for f in $PARTITIONS; do
df -k | grep "/dev/sdb$f"
if [ $? -eq 0 ]; then
umount -f /dev/sdb$f
fi
mkfs.ext4 /dev/sdb$f
done
mount -a
fi
# If there is a /var/tmp partition on the ephemeral disk, create a symlink such
# that the /var/log/mesos and /var/log/journal placed on the ephemeral disk.
VAR_TMP_PARTITION=`df -P /var/tmp | tail -1 | cut -d" " -f 1`
echo $VAR_TMP_PARTITION | grep "^$EPHEMERAL_DISK"
if [ $? -eq 0 ]; then
# Handle the /var/log/mesos directory
mkdir -p /var/tmp/log/mesos
if [ -d "/var/log/mesos" ]; then
cp -rp /var/log/mesos/* /var/tmp/log/mesos/
rm -rf /var/log/mesos
fi
ln -s /var/tmp/log/mesos /var/log/mesos
# Handle the /var/log/journal direcotry
mkdir -p /var/tmp/log/journal
if [ -d "/var/log/journal" ]; then
cp -rp /var/log/journal/* /var/tmp/log/journal/
rm -rf /var/log/journal
fi
ln -s /var/tmp/log/journal /var/log/journal
fi
path: "/opt/azure/containers/setup_ephemeral_disk.sh"
permissions: "0744"
owner: "root"

Просмотреть файл

@ -1,423 +0,0 @@
{{if .MasterProfile.IsManagedDisks}}
{
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
"location": "[variables('location')]",
"name": "[variables('masterAvailabilitySet')]",
"properties": {
"platformFaultDomainCount": 2,
"platformUpdateDomainCount": 3,
"managed": "true"
},
"type": "Microsoft.Compute/availabilitySets"
},
{{else if .MasterProfile.IsStorageAccount}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('masterStorageAccountName')]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('masterVMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('masterAvailabilitySet')]",
"properties": {},
"type": "Microsoft.Compute/availabilitySets"
},
{{end}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('masterStorageAccountExhibitorName')]",
"properties": {
"accountType": "Standard_LRS"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{if not .MasterProfile.IsCustomVNET}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
{{GetVNETSubnetDependencies}}
],
"location": "[variables('location')]",
"name": "[variables('virtualNetworkName')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
{{GetVNETAddressPrefixes}}
]
},
"subnets": [
{{GetVNETSubnets true}}
]
},
"type": "Microsoft.Network/virtualNetworks"
},
{{end}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('masterPublicIPAddressName')]",
"properties": {
"dnsSettings": {
"domainNameLabel": "[variables('masterEndpointDNSNamePrefix')]"
},
"publicIPAllocationMethod": "Dynamic"
},
"type": "Microsoft.Network/publicIPAddresses"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('masterLbName')]",
"properties": {
"backendAddressPools": [
{
"name": "[variables('masterLbBackendPoolName')]"
}
],
"frontendIPConfigurations": [
{
"name": "[variables('masterLbIPConfigName')]",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('masterPublicIPAddressName'))]"
}
}
}
]
{{if .MasterProfile.OAuthEnabled}}
,"loadBalancingRules": [
{
"name": "LBRule443",
"properties": {
"frontendIPConfiguration": {
"id": "[variables('masterLbIPConfigID')]"
},
"frontendPort": 443,
"backendPort": 443,
"enableFloatingIP": false,
"idleTimeoutInMinutes": 4,
"protocol": "Tcp",
"loadDistribution": "Default",
"backendAddressPool": {
"id": "[concat(variables('masterLbID'), '/backendAddressPools/', variables('masterLbBackendPoolName'))]"
},
"probe": {
"id": "[concat(variables('masterLbID'),'/probes/dcosMasterProbe')]"
}
}
},
{
"name": "LBRule80",
"properties": {
"frontendIPConfiguration": {
"id": "[variables('masterLbIPConfigID')]"
},
"frontendPort": 80,
"backendPort": 80,
"enableFloatingIP": false,
"idleTimeoutInMinutes": 4,
"protocol": "Tcp",
"loadDistribution": "Default",
"backendAddressPool": {
"id": "[concat(variables('masterLbID'), '/backendAddressPools/', variables('masterLbBackendPoolName'))]"
},
"probe": {
"id": "[concat(variables('masterLbID'),'/probes/dcosMasterProbe')]"
}
}
}
],
"probes": [
{
"name": "dcosMasterProbe",
"properties": {
"protocol": "Http",
"port": 5050,
"requestPath": "/health",
"intervalInSeconds": 5,
"numberOfProbes": 2
}
}
]
{{end}}
},
"type": "Microsoft.Network/loadBalancers"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"copy": {
"count": "[variables('masterCount')]",
"name": "masterLbLoopNode"
},
"dependsOn": [
"[variables('masterLbID')]"
],
"location": "[variables('location')]",
"name": "[concat(variables('masterLbName'), '/', 'SSH-', variables('masterVMNamePrefix'), copyIndex())]",
"properties": {
"backendPort": 22,
"enableFloatingIP": false,
"frontendIPConfiguration": {
"id": "[variables('masterLbIPConfigID')]"
},
"frontendPort": "[copyIndex(2200)]",
"protocol": "Tcp"
},
"type": "Microsoft.Network/loadBalancers/inboundNatRules"
},
{{if IsDCOS19}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[variables('masterLbID')]"
],
"location": "[resourceGroup().location]",
"name": "[concat(variables('masterLbName'), '/', 'SSHPort22-', variables('masterVMNamePrefix'), '0')]",
"properties": {
"backendPort": 2222,
"enableFloatingIP": false,
"frontendIPConfiguration": {
"id": "[variables('masterLbIPConfigID')]"
},
"frontendPort": "22",
"protocol": "Tcp"
},
"type": "Microsoft.Network/loadBalancers/inboundNatRules"
},
{{end}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('masterNSGName')]",
"properties": {
"securityRules": [
{{if IsDCOS19}}
{
"properties": {
"priority": 201,
"access": "Allow",
"direction": "Inbound",
"destinationPortRange": "2222",
"sourcePortRange": "*",
"destinationAddressPrefix": "*",
"protocol": "Tcp",
"description": "Allow SSH",
"sourceAddressPrefix": "*"
},
"name": "sshPort22"
},
{{if .MasterProfile.OAuthEnabled}}
{
"name": "http",
"properties": {
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "80",
"sourceAddressPrefix": "[variables('masterHttpSourceAddressPrefix')]",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 202,
"direction": "Inbound"
}
},
{
"name": "https",
"properties": {
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "443",
"sourceAddressPrefix": "[variables('masterHttpSourceAddressPrefix')]",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 203,
"direction": "Inbound"
}
},
{{end}}
{{end}}
{
"properties": {
"priority": 200,
"access": "Allow",
"direction": "Inbound",
"destinationPortRange": "22",
"sourcePortRange": "*",
"destinationAddressPrefix": "*",
"protocol": "Tcp",
"description": "Allow SSH",
"sourceAddressPrefix": "*"
},
"name": "ssh"
}
]
},
"type": "Microsoft.Network/networkSecurityGroups"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"copy": {
"count": "[variables('masterCount')]",
"name": "nicLoopNode"
},
"dependsOn": [
"[variables('masterNSGID')]",
{{if not .MasterProfile.IsCustomVNET}}
"[variables('vnetID')]",
{{end}}
"[variables('masterLbID')]",
{{if IsDCOS19}}
"[concat(variables('masterLbID'),'/inboundNatRules/SSHPort22-',variables('masterVMNamePrefix'),0)]",
{{end}}
"[concat(variables('masterLbID'),'/inboundNatRules/SSH-',variables('masterVMNamePrefix'),copyIndex())]"
],
"location": "[variables('location')]",
"name": "[concat(variables('masterVMNamePrefix'), 'nic-', copyIndex())]",
"properties": {
"ipConfigurations": [
{
"name": "ipConfigNode",
"properties": {
"loadBalancerBackendAddressPools": [
{
"id": "[concat(variables('masterLbID'), '/backendAddressPools/', variables('masterLbBackendPoolName'))]"
}
],
{{if IsDCOS19}}
"loadBalancerInboundNatRules": "[variables('masterLbInboundNatRules')[copyIndex()]]",
{{else}}
"loadBalancerInboundNatRules": [
{
"id": "[concat(variables('masterLbID'),'/inboundNatRules/SSH-',variables('masterVMNamePrefix'),copyIndex())]"
}
],
{{end}}
"privateIPAddress": "[concat(variables('masterFirstAddrPrefix'), copyIndex(int(variables('masterFirstAddrOctet4'))))]",
"privateIPAllocationMethod": "Static",
"subnet": {
"id": "[variables('masterVnetSubnetID')]"
}
}
}
]
,"networkSecurityGroup": {
"id": "[variables('masterNSGID')]"
}
},
"type": "Microsoft.Network/networkInterfaces"
},
{
{{if .MasterProfile.IsManagedDisks}}
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
{{else}}
"apiVersion": "[variables('apiVersionDefault')]",
{{end}}
"copy": {
"count": "[variables('masterCount')]",
"name": "vmLoopNode"
},
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('masterVMNamePrefix'), 'nic-', copyIndex())]",
"[concat('Microsoft.Compute/availabilitySets/',variables('masterAvailabilitySet'))]",
{{if .MasterProfile.IsStorageAccount}}
"[variables('masterStorageAccountName')]",
{{end}}
"[variables('masterStorageAccountExhibitorName')]"
],
"tags":
{
"creationSource" : "[concat('acsengine-', variables('masterVMNamePrefix'), copyIndex())]"
},
"location": "[variables('location')]",
"name": "[concat(variables('masterVMNamePrefix'), copyIndex())]",
"properties": {
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets',variables('masterAvailabilitySet'))]"
},
"hardwareProfile": {
"vmSize": "[variables('masterVMSize')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('masterVMNamePrefix'), 'nic-', copyIndex()))]"
}
]
},
"osProfile": {
"adminUsername": "[variables('adminUsername')]",
"computername": "[concat(variables('masterVMNamePrefix'), copyIndex())]",
{{GetDCOSMasterCustomData}}
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"keyData": "[variables('sshRSAPublicKey')]",
"path": "[variables('sshKeyPath')]"
}
]
}
}
{{if .LinuxProfile.HasSecrets}}
,
"secrets": "[variables('linuxProfileSecrets')]"
{{end}}
},
"storageProfile": {
"imageReference": {
"offer": "[variables('osImageOffer')]",
"publisher": "[variables('osImagePublisher')]",
"sku": "[variables('osImageSKU')]",
"version": "[variables('osImageVersion')]"
},
"osDisk": {
"caching": "ReadWrite"
,"createOption": "FromImage"
{{if .MasterProfile.IsStorageAccount}}
,"name": "[concat(variables('masterVMNamePrefix'), copyIndex(),'-osdisk')]"
,"vhd": {
"uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('masterStorageAccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'vhds/',variables('masterVMNamePrefix'),copyIndex(),'-osdisk.vhd')]"
}
{{end}}
{{if ne .MasterProfile.OSDiskSizeGB 0}}
,"diskSizeGB": {{.MasterProfile.OSDiskSizeGB}}
{{end}}
}
}
},
"type": "Microsoft.Compute/virtualMachines"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', variables('masterVMNamePrefix'), sub(variables('masterCount'), 1))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('masterVMNamePrefix'), sub(variables('masterCount'), 1), '/waitforleader')]",
"properties": {
"autoUpgradeMinorVersion": true,
"publisher": "Microsoft.OSTCExtensions",
"settings": {
"commandToExecute": "sh -c 'until ping -c1 leader.mesos;do echo waiting for leader.mesos;sleep 15;done;echo leader.mesos up'"
},
"type": "CustomScriptForLinux",
"typeHandlerVersion": "1.4"
},
"type": "Microsoft.Compute/virtualMachines/extensions"
}{{WriteLinkedTemplatesForExtensions}}

Просмотреть файл

@ -1,149 +0,0 @@
"adminUsername": "[parameters('linuxAdminUsername')]",
"targetEnvironment": "[parameters('targetEnvironment')]",
"maxVMsPerPool": 100,
"apiVersionDefault": "2016-03-30",
"apiVersionLinkDefault": "2015-01-01",
"singleQuote": "'",
"doubleSingleQuote": "''",
{{if .LinuxProfile.HasSecrets}}
"linuxProfileSecrets" :
[
{{range $vIndex, $vault := .LinuxProfile.Secrets}}
{{if $vIndex}} , {{end}}
{
"sourceVault":{
"id":"[parameters('linuxKeyVaultID{{$vIndex}}')]"
},
"vaultCertificates":[
{{range $cIndex, $cert := $vault.VaultCertificates}}
{{if $cIndex}} , {{end}}
{
"certificateUrl" :"[parameters('linuxKeyVaultID{{$vIndex}}CertificateURL{{$cIndex}}')]"
}
{{end}}
]
}
{{end}}
],
{{end}}
"orchestratorVersion": "{{.OrchestratorProfile.OrchestratorVersion}}",
{{if .HasWindows}}
"windowsAdminUsername": "[parameters('windowsAdminUsername')]",
"windowsAdminPassword": "[parameters('windowsAdminPassword')]",
"agentWindowsBackendPort": 3389,
"agentWindowsPublisher": "[parameters('agentWindowsPublisher')]",
"agentWindowsOffer": "[parameters('agentWindowsOffer')]",
"agentWindowsSku": "[parameters('agentWindowsSku')]",
"agentWindowsVersion": "[parameters('agentWindowsVersion')]",
"dcosWindowsBootstrapURL" : "[parameters('dcosWindowsBootstrapURL')]",
"windowsCustomScriptSuffix": " $inputFile = '%SYSTEMDRIVE%\\AzureData\\CustomData.bin' ; $outputFile = '%SYSTEMDRIVE%\\AzureData\\dcosWindowsProvision.ps1' ; $inputStream = New-Object System.IO.FileStream $inputFile, ([IO.FileMode]::Open), ([IO.FileAccess]::Read), ([IO.FileShare]::Read) ; $sr = New-Object System.IO.StreamReader(New-Object System.IO.Compression.GZipStream($inputStream, [System.IO.Compression.CompressionMode]::Decompress)) ; $sr.ReadToEnd() | Out-File($outputFile) ; Invoke-Expression('{0} {1}' -f $outputFile, $arguments) ; ",
"windowsMasterCustomScriptArguments": "[concat('$arguments = ', variables('singleQuote'),'-MasterCount ', variables('masterCount'), ' -firstMasterIP ', parameters('firstConsecutiveStaticIP'), variables('singleQuote'), ' ; ')]",
"windowsMasterCustomScript": "[concat('powershell.exe -ExecutionPolicy Unrestricted -command \"', variables('windowsMasterCustomScriptArguments'), variables('windowsCustomScriptSuffix'), '\" > %SYSTEMDRIVE%\\AzureData\\dcosWindowsProvision.log 2>&1')]",
{{end}}
"masterAvailabilitySet": "[concat(variables('orchestratorName'), '-master-availabilitySet-', variables('nameSuffix'))]",
"masterCount": {{.MasterProfile.Count}},
"masterEndpointDNSNamePrefix": "[tolower(parameters('masterEndpointDNSNamePrefix'))]",
"masterHttpSourceAddressPrefix": "{{.MasterProfile.HTTPSourceAddressPrefix}}",
"masterLbBackendPoolName": "[concat(variables('orchestratorName'), '-master-pool-', variables('nameSuffix'))]",
"masterLbID": "[resourceId('Microsoft.Network/loadBalancers',variables('masterLbName'))]",
"masterLbIPConfigID": "[concat(variables('masterLbID'),'/frontendIPConfigurations/', variables('masterLbIPConfigName'))]",
"masterLbIPConfigName": "[concat(variables('orchestratorName'), '-master-lbFrontEnd-', variables('nameSuffix'))]",
"masterLbName": "[concat(variables('orchestratorName'), '-master-lb-', variables('nameSuffix'))]",
"masterNSGID": "[resourceId('Microsoft.Network/networkSecurityGroups',variables('masterNSGName'))]",
"masterNSGName": "[concat(variables('orchestratorName'), '-master-nsg-', variables('nameSuffix'))]",
"masterPublicIPAddressName": "[concat(variables('orchestratorName'), '-master-ip-', variables('masterEndpointDNSNamePrefix'), '-', variables('nameSuffix'))]",
"apiVersionStorage": "2015-06-15",
"storageAccountBaseName": "[uniqueString(concat(variables('masterEndpointDNSNamePrefix'),variables('location'),variables('orchestratorName')))]",
"masterStorageAccountExhibitorName": "[concat(variables('storageAccountBaseName'), 'exhb0')]",
"storageAccountType": "Standard_LRS",
{{if .HasStorageAccountDisks}}
"maxVMsPerStorageAccount": 20,
"maxStorageAccountsPerAgent": "[div(variables('maxVMsPerPool'),variables('maxVMsPerStorageAccount'))]",
"dataStorageAccountPrefixSeed": 97,
"storageAccountPrefixes": [ "0", "6", "c", "i", "o", "u", "1", "7", "d", "j", "p", "v", "2", "8", "e", "k", "q", "w", "3", "9", "f", "l", "r", "x", "4", "a", "g", "m", "s", "y", "5", "b", "h", "n", "t", "z" ],
"storageAccountPrefixesCount": "[length(variables('storageAccountPrefixes'))]",
{{GetSizeMap}},
{{else}}
"storageAccountPrefixes": [],
{{end}}
{{if .HasManagedDisks}}
"apiVersionStorageManagedDisks": "2016-04-30-preview",
{{end}}
{{if .MasterProfile.IsStorageAccount}}
"masterStorageAccountName": "[concat(variables('storageAccountBaseName'), 'mstr0')]",
{{end}}
{{if .MasterProfile.IsCustomVNET}}
"masterVnetSubnetID": "[parameters('masterVnetSubnetID')]",
{{else}}
"masterSubnet": "[parameters('masterSubnet')]",
"masterSubnetName": "[concat(variables('orchestratorName'), '-masterSubnet')]",
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]",
"masterVnetSubnetID": "[concat(variables('vnetID'),'/subnets/',variables('masterSubnetName'))]",
"virtualNetworkName": "[concat(variables('orchestratorName'), '-vnet-', variables('nameSuffix'))]",
{{end}}
"masterFirstAddrOctets": "[split(parameters('firstConsecutiveStaticIP'),'.')]",
"masterFirstAddrOctet4": "[variables('masterFirstAddrOctets')[3]]",
"masterFirstAddrPrefix": "[concat(variables('masterFirstAddrOctets')[0],'.',variables('masterFirstAddrOctets')[1],'.',variables('masterFirstAddrOctets')[2],'.')]",
"masterVMNamePrefix": "[concat(variables('orchestratorName'), '-master-', variables('nameSuffix'), '-')]",
"masterVMNic": [
"[concat(variables('masterVMNamePrefix'), 'nic-0')]",
"[concat(variables('masterVMNamePrefix'), 'nic-1')]",
"[concat(variables('masterVMNamePrefix'), 'nic-2')]",
"[concat(variables('masterVMNamePrefix'), 'nic-3')]",
"[concat(variables('masterVMNamePrefix'), 'nic-4')]",
"[concat(variables('masterVMNamePrefix'), 'nic-5')]",
"[concat(variables('masterVMNamePrefix'), 'nic-6')]"
],
"masterVMSize": "[parameters('masterVMSize')]",
"nameSuffix": "[parameters('nameSuffix')]",
"oauthEnabled": "{{.MasterProfile.OAuthEnabled}}",
"orchestratorName": "dcos",
"osImageOffer": "[parameters('osImageOffer')]",
"osImagePublisher": "[parameters('osImagePublisher')]",
"osImageSKU": "[parameters('osImageSKU')]",
"osImageVersion": "[parameters('osImageVersion')]",
"sshKeyPath": "[concat('/home/', variables('adminUsername'), '/.ssh/authorized_keys')]",
"sshRSAPublicKey": "[parameters('sshRSAPublicKey')]",
"locations": [
"[resourceGroup().location]",
"[parameters('location')]"
],
"location": "[variables('locations')[mod(add(2,length(parameters('location'))),add(1,length(parameters('location'))))]]",
{{if IsDCOS19}}
"masterSshInboundNatRuleIdPrefix": "[concat(variables('masterLbID'),'/inboundNatRules/SSH-',variables('masterVMNamePrefix'))]",
"masterSshPort22InboundNatRuleIdPrefix": "[concat(variables('masterLbID'),'/inboundNatRules/SSHPort22-',variables('masterVMNamePrefix'))]",
"masterLbInboundNatRules": [
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'0')]"
},
{
"id": "[concat(variables('masterSshPort22InboundNatRuleIdPrefix'),'0')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'1')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'2')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'3')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'4')]"
}
]
],
{{end}}
"dcosBootstrapURL": "[parameters('dcosBootstrapURL')]"

Просмотреть файл

@ -1,35 +0,0 @@
"dcosBootstrapURL": {
"defaultValue": "https://dcosio.azureedge.net/dcos/stable/bootstrap/58fd0833ce81b6244fc73bf65b5deb43217b0bd7.bootstrap.tar.xz",
"metadata": {
"description": "The default mesosphere bootstrap package."
},
"type": "string"
},
"dcosWindowsBootstrapURL": {
"defaultValue": "http://dcos-win.westus.cloudapp.azure.com/dcos-windows/stable/",
"metadata": {
"description": "The default mesosphere bootstrap package location for windows."
},
"type": "string"
},
"dcosRepositoryURL": {
"defaultValue": "https://dcosio.azureedge.net/dcos/stable",
"metadata": {
"description": "The repository URL"
},
"type": "string"
},
"dcosClusterPackageListID": {
"defaultValue": "77282d8864a5bf36db345b54a0d1de3674a0e937",
"metadata": {
"description": "The default cluster package list IDs."
},
"type": "string"
},
"dcosProviderPackageID": {
"defaultValue": "",
"metadata": {
"description": "The guid for provider dcos-provider package."
},
"type": "string"
},

Просмотреть файл

@ -1,49 +0,0 @@
#!/bin/bash
MESOSDIR=/var/lib/mesos/dl
mkdir $MESOSDIR
# load the env vars
. /etc/mesosphere/setup-flags/dcos-deploy-environment
# default dc/os component download address (Azure CDN)
DOCKER_ENGINE_DOWNLOAD_URL=https://mesosphere.blob.core.windows.net/dcos-deps/docker-engine_1.13.1-0-ubuntu-xenial_amd64.deb
LIBIPSET_DOWNLOAD_URL=https://az837203.vo.msecnd.net/dcos-deps/libipset3_6.29-1_amd64.deb
IPSET_DOWNLOAD_URL=https://az837203.vo.msecnd.net/dcos-deps/ipset_6.29-1_amd64.deb
UNZIP_DOWNLOAD_URL=https://az837203.vo.msecnd.net/dcos-deps/unzip_6.0-20ubuntu1_amd64.deb
LIBLTDL_DOWNLOAD_URL=https://az837203.vo.msecnd.net/dcos-deps/libltdl7_2.4.6-0.1_amd64.deb
case $DCOS_ENVIRONMENT in
# because of Chinese GreatWall Firewall, the default packages on Azure CDN is blocked. So the following Chinese local mirror url should be used instead.
AzureChinaCloud)
DOCKER_ENGINE_DOWNLOAD_URL=http://acsengine.blob.core.chinacloudapi.cn/dcos/docker-engine_1.11.2-0~xenial_amd64.deb
LIBIPSET_DOWNLOAD_URL=http://acsengine.blob.core.chinacloudapi.cn/dcos/libipset3_6.29-1_amd64.deb
IPSET_DOWNLOAD_URL=http://acsengine.blob.core.chinacloudapi.cn/dcos/ipset_6.29-1_amd64.deb
UNZIP_DOWNLOAD_URL=http://acsengine.blob.core.chinacloudapi.cn/dcos/unzip_6.0-20ubuntu1_amd64.deb
LIBLTDL_DOWNLOAD_URL=http://acsengine.blob.core.chinacloudapi.cn/dcos/libltdl7_2.4.6-0.1_amd64.deb
;;
esac
curl -fLsSv --retry 20 -Y 100000 -y 60 -o $MESOSDIR/d.deb $DOCKER_ENGINE_DOWNLOAD_URL &
curl -fLsSv --retry 20 -Y 100000 -y 60 -o $MESOSDIR/1.deb $LIBIPSET_DOWNLOAD_URL &
curl -fLsSv --retry 20 -Y 100000 -y 60 -o $MESOSDIR/2.deb $IPSET_DOWNLOAD_URL &
curl -fLsSv --retry 20 -Y 100000 -y 60 -o $MESOSDIR/3.deb $UNZIP_DOWNLOAD_URL &
curl -fLsSv --retry 20 -Y 100000 -y 60 -o $MESOSDIR/4.deb $LIBLTDL_DOWNLOAD_URL &
wait
for i in {1..300}; do
dpkg -i $MESOSDIR/{1,2,3,4}.deb
if [ "$?" = "0" ]
then
echo "succeeded"
break
fi
sleep 1
done
ROLESFILECONTENTS
# add Azure update domain and fault domain attributes
ud=$( curl -H Metadata:true "http://169.254.169.254/metadata/instance/compute/platformUpdateDomain?api-version=2017-04-02&format=text" )
fd=$( curl -H Metadata:true "http://169.254.169.254/metadata/instance/compute/platformFaultDomain?api-version=2017-04-02&format=text" )
echo ";azure.faultdomain:$fd;azure.updatedomain:$ud" >> /var/lib/dcos/mesos-slave-common

Просмотреть файл

@ -1,58 +0,0 @@
function retry_download() {
retries=$1; wait_sleep=$2; timeout=$3; url=$4; path=$5 checksum=$6
for i in $(seq 1 $retries); do
rm -f $path
timeout $timeout curl -fsSL $url -o $path
if [ $? -ne 0 ]; then
echo "retry_download[$i] Error: Failed to execute curl -fsSL $url -o $path"
sleep $wait_sleep
continue
fi
if [ ! -z "${checksum:-}" ]; then
actual=$(sha1sum -b $path | cut -f 1 -d " ")
if [ $? -ne 0 ]; then
echo "retry_download[$i] Error: Failed to execute sha1sum -b $path (per $url)"
sleep $wait_sleep
continue
fi
if [ "$checksum" != "$actual" ]; then
echo "retry_download[$i] Error: sha1sum mismatch for $url"
sleep $wait_sleep
continue
fi
fi
return 0
done
return 1
}
function retrycmd_if_failure() {
retries=$1; wait_sleep=$2; timeout=$3; shift && shift && shift
for i in $(seq 1 $retries); do
timeout $timeout ${@}
[ $? -eq 0 ] && break || \
if [ $i -eq $retries ]; then
echo "Error: Failed to execute \"$@\" after $i attempts"
return 1
else
sleep $wait_sleep
fi
done
echo Executed \"$@\" $i times;
}
function retry_get_install_deb() {
retries=$1; wait_sleep=$2; timeout=$3; url=$4; checksum=$5
deb=$(mktemp)
trap "rm -f $deb" RETURN
retry_download $retries $wait_sleep $timeout $url $deb $checksum
if [ $? -ne 0 ]; then
echo "Error: Failed to download $url"
return 1
fi
retrycmd_if_failure $retries $wait_sleep $timeout dpkg -i $deb
if [ $? -ne 0 ]; then
echo "Error: Failed to install $url"
return 1
fi
}

Просмотреть файл

@ -1,214 +0,0 @@
############################################################
# Script adapted from
# https://raw.githubusercontent.com/Microsoft/Virtualization-Documentation/master/windows-server-container-tools/Install-ContainerHost/Install-ContainerHost.ps1
<#
.NOTES
Copyright (c) Microsoft Corporation. All rights reserved.
Use of this sample source code is subject to the terms of the Microsoft
license agreement under which you licensed this sample source code. If
you did not accept the terms of the license agreement, you are not
authorized to use this sample source code. For the terms of the license,
please see the license agreement between you and Microsoft or, if applicable,
see the LICENSE.RTF on your install media or the root of your tools installation.
THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
.SYNOPSIS
Installs the prerequisites for creating Windows containers
Opens TCP ports (80,443,2375,8080) in Windows Firewall.
Connects Docker to a swarm master.
.DESCRIPTION
Installs the prerequisites for creating Windows containers
Opens TCP ports (80,443,2375,8080) in Windows Firewall.
Connects Docker to a swarm master.
.PARAMETER SwarmMasterIP
IP Address of Docker Swarm Master
.EXAMPLE
.\Install-ContainerHost.ps1 -SwarmMasterIP 192.168.255.5
#>
#Requires -Version 5.0
[CmdletBinding(DefaultParameterSetName="Standard")]
param(
[string]
[ValidateNotNullOrEmpty()]
$SwarmMasterIP = "172.16.0.5"
)
$global:DockerServiceName = "Docker"
$global:HNSServiceName = "hns"
filter Timestamp {"$(Get-Date -Format o): $_"}
function Write-Log($message)
{
$msg = $message | Timestamp
Write-Output $msg
}
function
Start-Docker()
{
Write-Log "Starting $global:DockerServiceName..."
$startTime = Get-Date
while (-not $dockerReady)
{
try
{
Start-Service -Name $global:DockerServiceName -ea Stop
$dockerReady = $true
}
catch
{
$timeElapsed = $(Get-Date) - $startTime
if ($($timeElapsed).TotalMinutes -ge 5)
{
Write-Log "Docker Daemon did not start successfully within 5 minutes."
break
}
$errorStr = $_.Exception.Message
Write-Log "Starting Service failed: $errorStr"
Write-Log "sleeping for 10 seconds..."
Start-Sleep -sec 10
}
}
}
function
Stop-Docker()
{
Write-Log "Stopping $global:DockerServiceName..."
try
{
Stop-Service -Name $global:DockerServiceName -ea Stop
}
catch
{
Write-Log "Failed to stop Docker"
}
}
function
Update-DockerServiceRecoveryPolicy()
{
$dockerReady = $false
$startTime = Get-Date
# wait until the service exists
while (-not $dockerReady)
{
if (Get-Service $global:DockerServiceName -ErrorAction SilentlyContinue)
{
$dockerReady = $true
}
else
{
$timeElapsed = $(Get-Date) - $startTime
if ($($timeElapsed).TotalMinutes -ge 5)
{
Write-Log "Unable to find service $global:DockerServiceName within 5 minutes."
break
}
Write-Log "failed to find $global:DockerServiceName, sleeping for 5 seconds"
Start-Sleep -sec 5
}
}
Write-Log "Updating docker restart policy, to ensure it restarts on error"
$services = Get-WMIObject win32_service | Where-Object {$_.name -imatch $global:DockerServiceName}
foreach ($service in $services)
{
sc.exe failure $service.name reset= 86400 actions= restart/5000
}
}
# Open Windows Firewall Ports Needed
function Open-FirewallPorts()
{
$ports = @(80,443,2375,8080)
foreach ($port in $ports)
{
$netsh = "netsh advfirewall firewall add rule name='Open Port $port' dir=in action=allow protocol=TCP localport=$port"
Write-Log "enabling port with command $netsh"
Invoke-Expression -Command:$netsh
}
}
# Update Docker Config to have cluster-store=consul:// address configured for Swarm cluster.
function Write-DockerDaemonJson()
{
$dataDir = $env:ProgramData
# create the target directory
$targetDir = $dataDir + '\docker\config'
if(!(Test-Path -Path $targetDir )){
New-Item -ItemType directory -Path $targetDir
}
Write-Log "Delete key file, so that this node is unique to swarm"
$keyFileName = "$targetDir\key.json"
Write-Log "Removing $($keyFileName)"
if (Test-Path $keyFileName) {
Remove-Item $keyFileName
}
$ipAddress = Get-IPAddress
Write-Log "Advertise $($ipAddress) to consul://$($SwarmMasterIP):8500"
$OutFile = @"
{
"hosts": ["tcp://0.0.0.0:2375", "npipe://"],
"cluster-store": "consul://$($SwarmMasterIP):8500",
"cluster-advertise": "$($ipAddress):2375"
}
"@
$OutFile | Out-File -encoding ASCII -filepath "$targetDir\daemon.json"
}
# Get Node IPV4 Address
function Get-IPAddress()
{
return (Get-NetIPAddress | where {$_.IPAddress -Like '10.*' -and $_.AddressFamily -eq 'IPV4'})[0].IPAddress
}
try
{
Write-Log "Provisioning $global:DockerServiceName... with Swarm IP $SwarmMasterIP"
Write-Log "Stop Docker"
Stop-Docker
Write-Log "Opening firewall ports"
Open-FirewallPorts
Write-Log "Write Docker Configuration"
Write-DockerDaemonJson
Write-Log "Update Docker restart policy"
Update-DockerServiceRecoveryPolicy
Write-Log "Start Docker"
Start-Docker
#remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Wininit" Headless
#Write-Log "shutdown /r /f /t 60"
#shutdown /r /f /t 60
Write-Log "Setup Complete"
}
catch
{
Write-Error $_
}

Просмотреть файл

@ -1,335 +0,0 @@
############################################################
# Script adapted from
# https://raw.githubusercontent.com/Microsoft/Virtualization-Documentation/master/windows-server-container-tools/Install-ContainerHost/Install-ContainerHost.ps1
<#
.NOTES
Copyright (c) Microsoft Corporation. All rights reserved.
Use of this sample source code is subject to the terms of the Microsoft
license agreement under which you licensed this sample source code. If
you did not accept the terms of the license agreement, you are not
authorized to use this sample source code. For the terms of the license,
please see the license agreement between you and Microsoft or, if applicable,
see the LICENSE.RTF on your install media or the root of your tools installation.
THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
.SYNOPSIS
Installs the prerequisites for creating Windows containers
Opens TCP ports (80,443,2375,8080) in Windows Firewall.
Connects Docker to a Swarm Mode master.
.DESCRIPTION
Installs the prerequisites for creating Windows containers
Opens TCP ports (80,443,2375,8080) in Windows Firewall.
Connects Docker to a Swarm Mode master.
.PARAMETER SwarmMasterIP
IP Address of Docker Swarm Mode Master
.EXAMPLE
.\Join-SwarmMode-cluster.ps1 -SwarmMasterIP 192.168.255.5
#>
#Requires -Version 5.0
[CmdletBinding(DefaultParameterSetName="Standard")]
param(
[string]
[ValidateNotNullOrEmpty()]
$SwarmMasterIP = "172.16.0.5"
)
$global:DockerServiceName = "Docker"
$global:DockerBinariesURL = "https://acsengine.blob.core.windows.net/swarmm/docker.zip"
$global:DockerExePath = "C:\Program Files\Docker"
$global:IsNewDockerVersion = $false
filter Timestamp {"$(Get-Date -Format o): $_"}
function Write-Log($message)
{
$msg = $message | Timestamp
Write-Output $msg
}
function Start-Docker()
{
Write-Log "Starting $global:DockerServiceName..."
$startTime = Get-Date
while (-not $dockerReady)
{
try
{
Start-Service -Name $global:DockerServiceName -ea Stop
$dockerReady = $true
}
catch
{
$timeElapsed = $(Get-Date) - $startTime
if ($($timeElapsed).TotalMinutes -ge 5)
{
Write-Log "Docker Daemon did not start successfully within 5 minutes."
break
}
$errorStr = $_.Exception.Message
Write-Log "Starting Service failed: $errorStr"
Write-Log "sleeping for 10 seconds..."
Start-Sleep -sec 10
}
}
}
function Stop-Docker()
{
Write-Log "Stopping $global:DockerServiceName..."
try
{
Stop-Service -Name $global:DockerServiceName -ea Stop
}
catch
{
Write-Log "Failed to stop Docker"
}
}
function Expand-ZIPFile($file, $destination)
{
$shell = new-object -com shell.application
$zip = $shell.NameSpace($file)
foreach($item in $zip.items())
{
$shell.Namespace($destination).copyhere($item, 0x14)
}
}
function Install-DockerBinaries()
{
if( $global:IsNewDockerVersion)
{
Write-Log "Skipping installation of new Docker binaries because latest is already installed."
return
}
$currentRetry = 0;
$success = $false;
$zipfile = "c:\swarmm.zip"
do {
try
{
Write-Log "Downloading and installing Docker binaries...."
Invoke-WebRequest -Uri $global:DockerBinariesURL -OutFile $zipfile
$success = $true;
Write-Log "Successfully downloaded Docker binaries. Number of retries: $currentRetry";
}
catch [System.Exception]
{
$message = 'Exception occurred while trying to download binaries:' + $_.Exception.ToString();
Write-Log $message;
if ($currentRetry -gt 5) {
$message = "Could not download Docker binaries, aborting install. Error: " + $_.Exception.ToString();
throw $message;
} else {
Write-Log "Sleeping before retry number: $currentRetry to download binaries.";
Start-Sleep -sec 5;
}
$currentRetry = $currentRetry + 1;
}
} while (!$success);
Write-Log "Expanding zip file at destination: $global:DockerExePath"
Expand-ZIPFile -File $zipfile -Destination $global:DockerExePath
Write-Log "Deleting zip file at: $zipfile"
Remove-Item $zipfile
}
function Update-DockerServiceRecoveryPolicy()
{
$dockerReady = $false
$startTime = Get-Date
# wait until the service exists
while (-not $dockerReady)
{
if (Get-Service $global:DockerServiceName -ErrorAction SilentlyContinue)
{
$dockerReady = $true
}
else
{
$timeElapsed = $(Get-Date) - $startTime
if ($($timeElapsed).TotalMinutes -ge 5)
{
Write-Log "Unable to find service $global:DockerServiceName within 5 minutes."
break
}
Write-Log "failed to find $global:DockerServiceName, sleeping for 5 seconds"
Start-Sleep -sec 5
}
}
Write-Log "Updating docker restart policy, to ensure it restarts on error"
$services = Get-WMIObject win32_service | Where-Object {$_.name -imatch $global:DockerServiceName}
foreach ($service in $services)
{
sc.exe failure $service.name reset= 86400 actions= restart/5000
}
}
# Open Windows Firewall Ports Needed
function Open-FirewallPorts()
{
$tcpports = @(80,443,2375,8080,2377,7946,4789)
foreach ($tcpport in $tcpports)
{
$netsh = "netsh advfirewall firewall add rule name='Open Port $tcpport' dir=in action=allow protocol=TCP localport=$tcpport"
Write-Log "enabling port with command $netsh"
Invoke-Expression -Command:$netsh
}
$udpports = @(7946,4789)
foreach ($udpport in $udpports)
{
$netsh = "netsh advfirewall firewall add rule name='Open Port $udpport' dir=in action=allow protocol=UDP localport=$udpport"
Write-Log "enabling port with command $netsh"
Invoke-Expression -Command:$netsh
}
}
# Update Docker Config to have cluster-store=consul:// address configured for Swarm cluster.
function Write-DockerDaemonJson()
{
$dataDir = $env:ProgramData
# create the target directory
$targetDir = $dataDir + '\docker\config'
if(!(Test-Path -Path $targetDir )){
New-Item -ItemType directory -Path $targetDir
}
Write-Log "Delete key file, so that this node is unique to swarm"
$keyFileName = "$targetDir\key.json"
Write-Log "Removing $($keyFileName)"
if (Test-Path $keyFileName) {
Remove-Item $keyFileName
}
Write-Log "Configure Docker Engine to accept incoming connections on port 2375"
$OutFile = @"
{
"hosts": ["tcp://0.0.0.0:2375", "npipe://"]
}
"@
$OutFile | Out-File -encoding ASCII -filepath "$targetDir\daemon.json"
}
function Join-Swarm()
{
$currentRetry = 0;
$success = $false;
$getTokenCommand = "docker -H $($SwarmMasterIP):2375 swarm join-token -q worker"
$swarmmodetoken;
do {
try
{
Write-Log "Executing [$getTokenCommand] command...."
<#& $swarmmodetoken#>
$swarmmodetoken = Invoke-Expression -Command:$getTokenCommand
$success = $true;
Write-Log "Successfully executed [$getTokenCommand] command. Number of entries: $currentRetry. Token: [$swarmmodetoken]";
}
catch [System.Exception]
{
$message = 'Exception occurred while trying to execute command [$swarmmodetoken]:' + $_.Exception.ToString();
Write-Log $message;
if ($currentRetry -gt 120) {
$message = "Agent couldn't join Swarm, aborting install. Error: " + $_.Exception.ToString();
throw $message;
} else {
Write-Log "Sleeping before $currentRetry retry of [$getTokenCommand] command";
Start-Sleep -sec 5;
}
$currentRetry = $currentRetry + 1;
}
} while (!$success);
$joinSwarmCommand = "docker swarm join --token $($swarmmodetoken) $($SwarmMasterIP):2377"
Write-Log "Joining Swarm. Command [$joinSwarmCommand]...."
Invoke-Expression -Command:$joinSwarmCommand
}
function Confirm-DockerVersion()
{
$dockerServerVersionCmd = "docker version --format '{{.Server.Version}}'"
Write-Log "Running command: $dockerServerVersionCmd"
$dockerServerVersion = Invoke-Expression -Command:$dockerServerVersionCmd
$dockerClientVersionCmd = "docker version --format '{{.Client.Version}}'"
Write-Log "Running command: $dockerClientVersionCmd"
$dockerClientVersion = Invoke-Expression -Command:$dockerClientVersionCmd
Write-Log "Docker Server version: $dockerServerVersion, Docker Client verison: $dockerClientVersion"
$serverVersionData = $dockerServerVersion.Split(".")
$isNewServerVersion = $false;
if(($serverVersionData[0] -ge 1) -and ($serverVersionData[1] -ge 13)){
$isNewServerVersion = $true;
Write-Log "Setting isNewServerVersion to $isNewServerVersion"
}
$clientVersionData = $dockerClientVersion.Split(".")
$isNewClientVersion = $false;
if(($clientVersionData[0] -ge 1) -and ($clientVersionData[1] -ge 13)){
$isNewClientVersion = $true;
Write-Log "Setting isNewClientVersion to $isNewClientVersion"
}
if($isNewServerVersion -and $isNewClientVersion)
{
$global:IsNewDockerVersion = $true;
Write-Log "Setting IsNewDockerVersion to $global:IsNewDockerVersion"
}
}
try
{
Write-Log "Provisioning $global:DockerServiceName... with Swarm IP $SwarmMasterIP"
Write-Log "Checking Docker version"
Confirm-DockerVersion
Write-Log "Stop Docker"
Stop-Docker
Write-Log "Installing Docker binaries"
Install-DockerBinaries
Write-Log "Opening firewall ports"
Open-FirewallPorts
Write-Log "Write Docker Configuration"
Write-DockerDaemonJson
Write-Log "Update Docker restart policy"
Update-DockerServiceRecoveryPolicy
Write-Log "Start Docker"
Start-Docker
Write-Log "Join existing Swarm"
Join-Swarm
Write-Log "Setup Complete"
}
catch
{
Write-Error $_
}

Просмотреть файл

@ -1,294 +0,0 @@
#!/bin/bash
set -x
echo "starting swarm cluster configuration"
date
ps ax
#############
# Parameters
#############
SWARM_VERSION=${1}
DOCKER_COMPOSE_VERSION=${2}
MASTERCOUNT=${3}
MASTERPREFIX=${4}
MASTERFIRSTADDR=${5}
AZUREUSER=${6}
POSTINSTALLSCRIPTURI=${7}
BASESUBNET=${8}
DOCKERENGINEDOWNLOADREPO=${9}
DOCKERCOMPOSEDOWNLOADURL=${10}
DOCKER_CE_VERSION=17.03.*
VMNAME=`hostname`
VMNUMBER=`echo $VMNAME | sed 's/.*[^0-9]\([0-9]\+\)*$/\1/'`
VMPREFIX=`echo $VMNAME | sed 's/\(.*[^0-9]\)*[0-9]\+$/\1/'`
echo "Master Count: $MASTERCOUNT"
echo "Master Prefix: $MASTERPREFIX"
echo "Master First Addr: $MASTERFIRSTADDR"
echo "vmname: $VMNAME"
echo "VMNUMBER: $VMNUMBER, VMPREFIX: $VMPREFIX"
echo "BASESUBNET: $BASESUBNET"
echo "AZUREUSER: $AZUREUSER"
###################
# Common Functions
###################
ensureAzureNetwork()
{
# ensure the network works
networkHealthy=1
for i in {1..12}; do
wget -O/dev/null http://bing.com
if [ $? -eq 0 ]
then
# hostname has been found continue
networkHealthy=0
echo "the network is healthy"
break
fi
sleep 10
done
if [ $networkHealthy -ne 0 ]
then
echo "the network is not healthy, aborting install"
ifconfig
ip a
exit 1
fi
# ensure the host ip can resolve
networkHealthy=1
for i in {1..120}; do
hostname -i
if [ $? -eq 0 ]
then
# hostname has been found continue
networkHealthy=0
echo "the network is healthy"
break
fi
sleep 1
done
# attempt to fix hostname, in case dns is not resolving Azure IPs (but can resolve public ips)
if [ $networkHealthy -ne 0 ]
then
HOSTNAME=`hostname`
HOSTADDR=`ip address show dev eth0 | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*'`
echo $HOSTADDR $HOSTNAME >> /etc/hosts
hostname -i
if [ $? -eq 0 ]
then
# hostname has been found continue
networkHealthy=0
echo "the network is healthy by updating /etc/hosts"
fi
fi
if [ $networkHealthy -ne 0 ]
then
echo "the network is not healthy, cannot resolve ip address, aborting install"
ifconfig
ip a
exit 2
fi
}
ensureAzureNetwork
HOSTADDR=`hostname -i`
# apply all Canonical security updates during provisioning
/usr/lib/apt/apt.systemd.daily
ismaster ()
{
if [ "$MASTERPREFIX" == "$VMPREFIX" ]
then
return 0
else
return 1
fi
}
if ismaster ; then
echo "this node is a master"
fi
isagent()
{
if ismaster ; then
return 1
else
return 0
fi
}
if isagent ; then
echo "this node is an agent"
fi
consulstr()
{
consulargs=""
for i in `seq 0 $((MASTERCOUNT-1))` ;
do
MASTEROCTET=`expr $MASTERFIRSTADDR + $i`
IPADDR="${BASESUBNET}${MASTEROCTET}"
if [ "$VMNUMBER" -eq "0" ]
then
consulargs="${consulargs}-bootstrap-expect $MASTERCOUNT "
fi
if [ "$VMNUMBER" -eq "$i" ]
then
consulargs="${consulargs}-advertise $IPADDR "
else
consulargs="${consulargs}-retry-join $IPADDR "
fi
done
echo $consulargs
}
consulargs=$(consulstr)
MASTER0IPADDR="${BASESUBNET}${MASTERFIRSTADDR}"
######################
# resolve self in DNS
######################
echo "$HOSTADDR $VMNAME" | sudo tee -a /etc/hosts
################
# Install Docker
################
echo "Installing and configuring docker"
# simple general command retry function
retrycmd_if_failure() { for i in 1 2 3 4 5; do $@; [ $? -eq 0 ] && break || sleep 5; done ; }
installDocker()
{
for i in {1..10}; do
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl --max-time 60 -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
apt-get install -y docker-ce=${DOCKER_CE_VERSION}
if [ $? -eq 0 ]
then
# hostname has been found continue
echo "Docker installed successfully"
break
fi
sleep 10
done
}
time installDocker
sudo usermod -aG docker $AZUREUSER
if isagent ; then
# Start Docker and listen on :2375 (no auth, but in vnet)
echo 'DOCKER_OPTS="-H unix:///var/run/docker.sock -H 0.0.0.0:2375 --cluster-store=consul://'$MASTER0IPADDR:8500 --cluster-advertise=$HOSTADDR:2375'"' | sudo tee -a /etc/default/docker
fi
echo "Installing docker compose"
installDockerCompose()
{
for i in {1..10}; do
wget --tries 4 --retry-connrefused --waitretry=15 -qO- $DOCKERCOMPOSEDOWNLOADURL/$DOCKER_COMPOSE_VERSION/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
if [ $? -eq 0 ]
then
# hostname has been found continue
echo "docker-compose installed successfully"
break
fi
sleep 10
done
}
time installDockerCompose
chmod +x /usr/local/bin/docker-compose
sudo service docker restart
ensureDocker()
{
# ensure that docker is healthy
dockerHealthy=1
for i in {1..3}; do
sudo docker info
if [ $? -eq 0 ]
then
# hostname has been found continue
dockerHealthy=0
echo "Docker is healthy"
sudo docker ps -a
break
fi
sleep 10
done
if [ $dockerHealthy -ne 0 ]
then
echo "Docker is not healthy"
fi
}
ensureDocker
##############################################
# configure init rules restart all processes
##############################################
if ismaster ; then
mkdir -p /data/consul
echo "consul:
image: \"progrium/consul\"
command: -server -node $VMNAME $consulargs
ports:
- \"8500:8500\"
- \"8300:8300\"
- \"8301:8301\"
- \"8301:8301/udp\"
- \"8302:8302\"
- \"8302:8302/udp\"
- \"8400:8400\"
volumes:
- \"/data/consul:/data\"
restart: \"always\"
swarm:
image: \"$SWARM_VERSION\"
command: manage --replication --advertise $HOSTADDR:2375 --discovery-opt kv.path=docker/nodes consul://$MASTER0IPADDR:8500
ports:
- \"2375:2375\"
links:
- \"consul\"
volumes:
- \"/etc/docker:/etc/docker\"
restart: \"always\"
" > /opt/azure/containers/docker-compose.yml
pushd /opt/azure/containers/
docker-compose up -d
popd
echo "completed starting docker swarm on the master"
fi
if ismaster ; then
echo "Having ssh listen to port 2222 as well as 22"
sudo sed -i "s/^Port 22$/Port 22\nPort 2222/1" /etc/ssh/sshd_config
fi
if [ $POSTINSTALLSCRIPTURI != "disabled" ]
then
echo "downloading, and kicking off post install script"
/bin/bash -c "wget --tries 20 --retry-connrefused --waitretry=15 -qO- $POSTINSTALLSCRIPTURI | nohup /bin/bash >> /var/log/azure/cluster-bootstrap-postinstall.log 2>&1 &"
fi
echo "processes at end of script"
ps ax
date
echo "completed Swarm cluster configuration"
echo "restart system to install any remaining software"
if isagent ; then
shutdown -r now
else
# wait 1 minute to restart master
/bin/bash -c "shutdown -r 1 &"
fi

Просмотреть файл

@ -1,374 +0,0 @@
#!/bin/bash
###########################################################
# Configure Swarm Mode One Box
#
# This installs the following components
# - Docker
# - Docker Compose
# - Swarm Mode masters
# - Swarm Mode agents
###########################################################
set -x
echo "starting Swarm Mode cluster configuration"
date
ps ax
#############
# Parameters
#############
DOCKER_CE_VERSION=${1}
DOCKER_COMPOSE_VERSION=${2}
MASTERCOUNT=${3}
MASTERPREFIX=${4}
MASTERFIRSTADDR=${5}
AZUREUSER=${6}
POSTINSTALLSCRIPTURI=${7}
BASESUBNET=${8}
DOCKERENGINEDOWNLOADREPO=${9}
DOCKERCOMPOSEDOWNLOADURL=${10}
VMNAME=`hostname`
VMNUMBER=`echo $VMNAME | sed 's/.*[^0-9]\([0-9]\+\)*$/\1/'`
VMPREFIX=`echo $VMNAME | sed 's/\(.*[^0-9]\)*[0-9]\+$/\1/'`
OS="$(. /etc/os-release; echo $ID)"
echo "Master Count: $MASTERCOUNT"
echo "Master Prefix: $MASTERPREFIX"
echo "Master First Addr: $MASTERFIRSTADDR"
echo "vmname: $VMNAME"
echo "VMNUMBER: $VMNUMBER, VMPREFIX: $VMPREFIX"
echo "BASESUBNET: $BASESUBNET"
echo "AZUREUSER: $AZUREUSER"
echo "OS ID: $OS"
###################
# Common Functions
###################
isUbuntu()
{
if [ "$OS" == "ubuntu" ]
then
return 0
else
return 1
fi
}
isRHEL()
{
if [ "$OS" == "rhel" ]
then
return 0
else
return 1
fi
}
ensureAzureNetwork()
{
# ensure the network works
networkHealthy=1
for i in {1..12}; do
wget -O/dev/null http://bing.com
if [ $? -eq 0 ]
then
# hostname has been found continue
networkHealthy=0
echo "the network is healthy"
break
fi
sleep 10
done
if [ $networkHealthy -ne 0 ]
then
echo "the network is not healthy, aborting install"
ifconfig
ip a
exit 1
fi
# ensure the host ip can resolve
networkHealthy=1
for i in {1..120}; do
hostname -i
if [ $? -eq 0 ]
then
# hostname has been found continue
networkHealthy=0
echo "the network is healthy"
break
fi
sleep 1
done
# attempt to fix hostname, in case dns is not resolving Azure IPs (but can resolve public ips)
if [ $networkHealthy -ne 0 ]
then
HOSTNAME=`hostname`
HOSTADDR=`ip address show dev eth0 | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*'`
echo $HOSTADDR $HOSTNAME >> /etc/hosts
hostname -i
if [ $? -eq 0 ]
then
# hostname has been found continue
networkHealthy=0
echo "the network is healthy by updating /etc/hosts"
fi
fi
if [ $networkHealthy -ne 0 ]
then
echo "the network is not healthy, cannot resolve ip address, aborting install"
ifconfig
ip a
exit 2
fi
}
ensureAzureNetwork
HOSTADDR=`hostname -i`
# apply all Canonical security updates during provisioning
/usr/lib/apt/apt.systemd.daily
ismaster ()
{
if [ "$MASTERPREFIX" == "$VMPREFIX" ]
then
return 0
else
return 1
fi
}
if ismaster ; then
echo "this node is a master"
fi
isagent()
{
if ismaster ; then
return 1
else
return 0
fi
}
if isagent ; then
echo "this node is an agent"
fi
MASTER0IPADDR="${BASESUBNET}${MASTERFIRSTADDR}"
######################
# resolve self in DNS
######################
if [ -z "$(grep "$HOSTADDR $VMNAME" /etc/hosts)" ]; then
echo "$HOSTADDR $VMNAME" | sudo tee -a /etc/hosts
fi
################
# Install Docker
################
echo "Installing and configuring Docker"
installDockerUbuntu()
{
for i in {1..10}; do
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl --max-time 60 -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
apt-get install -y docker-ce=${DOCKER_CE_VERSION}
if [ $? -eq 0 ]
then
systemctl restart docker
# hostname has been found continue
echo "Docker installed successfully"
break
fi
sleep 10
done
}
installDockerRHEL()
{
for i in {1..10}; do
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum makecache fast
yum -y install docker-ce
if [ $? -eq 0 ]
then
systemctl enable docker
systemctl start docker
echo "Docker installed successfully"
break
fi
sleep 10
done
}
installDocker()
{
if isUbuntu ; then
installDockerUbuntu
elif isRHEL ; then
installDockerRHEL
else
echo "OS not supported, aborting install"
exit 5
fi
}
time installDocker
sudo usermod -aG docker $AZUREUSER
echo "Updating Docker daemon options"
updateDockerDaemonOptions()
{
sudo mkdir -p /etc/systemd/system/docker.service.d
# Start Docker and listen on :2375 (no auth, but in vnet) and
# also have it bind to the unix socket at /var/run/docker.sock
sudo bash -c 'echo "[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
" > /etc/systemd/system/docker.service.d/override.conf'
}
time updateDockerDaemonOptions
echo "Installing Docker Compose"
installDockerCompose()
{
# sudo -i
for i in {1..10}; do
wget --tries 4 --retry-connrefused --waitretry=15 -qO- $DOCKERCOMPOSEDOWNLOADURL/$DOCKER_COMPOSE_VERSION/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
if [ $? -eq 0 ]
then
# hostname has been found continue
echo "docker-compose installed successfully"
break
fi
sleep 10
done
}
time installDockerCompose
chmod +x /usr/local/bin/docker-compose
if ismaster && isRHEL ; then
echo "Opening Docker ports"
firewall-cmd --add-port=2375/tcp --permanent
firewall-cmd --add-port=2377/tcp --permanent
firewall-cmd --reload
fi
echo "Restarting Docker"
sudo systemctl daemon-reload
sudo service docker restart
ensureDocker()
{
# ensure that docker is healthy
dockerHealthy=1
for i in {1..3}; do
sudo docker info
if [ $? -eq 0 ]
then
# hostname has been found continue
dockerHealthy=0
echo "Docker is healthy"
sudo docker ps -a
break
fi
sleep 10
done
if [ $dockerHealthy -ne 0 ]
then
echo "Docker is not healthy"
fi
}
ensureDocker
##############################################
# configure init rules restart all processes
##############################################
if ismaster ; then
if [ "$HOSTADDR" = "$MASTER0IPADDR" ]; then
echo "Creating a new Swarm on first master"
docker swarm init --advertise-addr $(hostname -i):2377 --listen-addr $(hostname -i):2377
else
echo "Secondary master attempting to join an existing Swarm"
swarmmodetoken=""
swarmmodetokenAcquired=1
for i in {1..120}; do
swarmmodetoken=$(docker -H $MASTER0IPADDR:2375 swarm join-token -q manager)
if [ $? -eq 0 ]; then
swarmmodetokenAcquired=0
break
fi
sleep 5
done
if [ $swarmmodetokenAcquired -ne 0 ]
then
echo "Secondary master couldn't connect to Swarm, aborting install"
exit 3
fi
docker swarm join --token $swarmmodetoken $MASTER0IPADDR:2377
fi
fi
if ismaster ; then
echo "Having ssh listen to port 2222 as well as 22"
sudo sed -i "s/^Port 22$/Port 22\nPort 2222/1" /etc/ssh/sshd_config
fi
if ismaster ; then
echo "Setting availability of master node: '$VMNAME' to pause"
docker node update --availability pause $VMNAME
fi
if isagent ; then
echo "Agent attempting to join an existing Swarm"
swarmmodetoken=""
swarmmodetokenAcquired=1
for i in {1..120}; do
swarmmodetoken=$(docker -H $MASTER0IPADDR:2375 swarm join-token -q worker)
if [ $? -eq 0 ]; then
swarmmodetokenAcquired=0
break
fi
sleep 5
done
if [ $swarmmodetokenAcquired -ne 0 ]
then
echo "Agent couldn't join Swarm, aborting install"
exit 4
fi
docker swarm join --token $swarmmodetoken $MASTER0IPADDR:2377
fi
if [ $POSTINSTALLSCRIPTURI != "disabled" ]
then
echo "downloading, and kicking off post install script"
/bin/bash -c "wget --tries 20 --retry-connrefused --waitretry=15 -qO- $POSTINSTALLSCRIPTURI | nohup /bin/bash >> /var/log/azure/cluster-bootstrap-postinstall.log 2>&1 &"
fi
# mitigation for bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1676635
echo 2dd1ce17-079e-403c-b352-a1921ee207ee > /sys/bus/vmbus/drivers/hv_util/unbind
sed -i "13i\echo 2dd1ce17-079e-403c-b352-a1921ee207ee > /sys/bus/vmbus/drivers/hv_util/unbind\n" /etc/rc.local
echo "processes at end of script"
ps ax
date
echo "completed Swarm Mode cluster configuration"
echo "restart system to install any remaining software"
if isagent ; then
shutdown -r now
else
# wait 1 minute to restart master
/bin/bash -c "shutdown -r 1 &"
fi

Просмотреть файл

@ -1,258 +0,0 @@
{
"apiVersion": "[variables('apiVersionDefault')]",
"copy": {
"count": "[variables('{{.Name}}Count')]",
"name": "loop"
},
"dependsOn": [
{{if not .IsCustomVNET}}
"[variables('vnetID')]"
{{end}}
{{if IsPublic .Ports}}
,"[variables('{{.Name}}LbID')]"
{{end}}
],
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), 'nic-', copyIndex(variables('{{.Name}}Offset')))]",
"properties": {
"ipConfigurations": [
{
"name": "ipConfigNode",
"properties": {
{{if IsPublic .Ports}}
"loadBalancerBackendAddressPools": [
{
"id": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/loadBalancers/', variables('{{.Name}}LbName'), '/backendAddressPools/',variables('{{.Name}}LbBackendPoolName'))]"
}
],
{{end}}
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[variables('{{.Name}}VnetSubnetID')]"
}
}
}
]
},
"type": "Microsoft.Network/networkInterfaces"
},
{{if .IsManagedDisks}}
{
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}AvailabilitySet')]",
"properties": {
"platformFaultDomainCount": 2,
"platformUpdateDomainCount": 3,
"managed": "true"
},
"type": "Microsoft.Compute/availabilitySets"
},
{{else if .IsStorageAccount}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"copy": {
"count": "[variables('{{.Name}}StorageAccountsCount')]",
"name": "vmLoopNode"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{if .HasDisks}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"copy": {
"count": "[variables('{{.Name}}StorageAccountsCount')]",
"name": "datadiskLoop"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(variables('dataStorageAccountPrefixSeed')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(variables('dataStorageAccountPrefixSeed')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}DataAccountName'))]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{end}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}AvailabilitySet')]",
"properties": {},
"type": "Microsoft.Compute/availabilitySets"
},
{{end}}
{{if IsPublic .Ports}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}IPAddressName')]",
"properties": {
"dnsSettings": {
"domainNameLabel": "[variables('{{.Name}}EndpointDNSNamePrefix')]"
},
"publicIPAllocationMethod": "Dynamic"
},
"type": "Microsoft.Network/publicIPAddresses"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('{{.Name}}IPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('{{.Name}}LbName')]",
"properties": {
"backendAddressPools": [
{
"name": "[variables('{{.Name}}LbBackendPoolName')]"
}
],
"frontendIPConfigurations": [
{
"name": "[variables('{{.Name}}LbIPConfigName')]",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('{{.Name}}IPAddressName'))]"
}
}
}
],
"inboundNatRules": [],
"loadBalancingRules": [
{{(GetLBRules .Name .Ports)}}
],
"probes": [
{{(GetProbes .Ports)}}
]
},
"type": "Microsoft.Network/loadBalancers"
},
{{end}}
{
{{if .IsManagedDisks}}
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
{{else}}
"apiVersion": "[variables('apiVersionDefault')]",
{{end}}
"copy": {
"count": "[variables('{{.Name}}Count')]",
"name": "vmLoopNode"
},
"dependsOn": [
{{if .IsStorageAccount}}
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
{{if .HasDisks}}
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('dataStorageAccountPrefixSeed')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('dataStorageAccountPrefixSeed')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}DataAccountName'))]",
{{end}}
{{end}}
"[concat('Microsoft.Network/networkInterfaces/', variables('{{.Name}}VMNamePrefix'), 'nic-', copyIndex(variables('{{.Name}}Offset')))]",
"[concat('Microsoft.Compute/availabilitySets/', variables('{{.Name}}AvailabilitySet'))]"
],
"tags":
{
"creationSource" : "[concat('acsengine-', variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')))]"
},
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')))]",
"properties": {
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets',variables('{{.Name}}AvailabilitySet'))]"
},
"hardwareProfile": {
"vmSize": "[variables('{{.Name}}VMSize')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('{{.Name}}VMNamePrefix'), 'nic-', copyIndex(variables('{{.Name}}Offset'))))]"
}
]
},
"osProfile": {
"adminUsername": "[variables('adminUsername')]",
"computername": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')))]",
{{if IsSwarmMode}}
{{if not .IsRHEL}}
{{GetAgentSwarmModeCustomData .}}
{{end}}
{{else}}
{{GetAgentSwarmCustomData .}}
{{end}}
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"keyData": "[parameters('sshRSAPublicKey')]",
"path": "[variables('sshKeyPath')]"
}
]
}
}
{{if HasLinuxSecrets}}
,
"secrets": "[variables('linuxProfileSecrets')]"
{{end}}
},
"storageProfile": {
{{GetDataDisks .}}
"imageReference": {
"offer": "[variables('{{.Name}}OSImageOffer')]",
"publisher": "[variables('{{.Name}}OSImagePublisher')]",
"sku": "[variables('{{.Name}}OSImageSKU')]",
"version": "[variables('{{.Name}}OSImageVersion')]"
}
,"osDisk": {
"caching": "ReadOnly"
,"createOption": "FromImage"
{{if .IsStorageAccount}}
,"name": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')),'-osdisk')]"
,"vhd": {
"uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'osdisk/', variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')), '-osdisk.vhd')]"
}
{{end}}
{{if ne .OSDiskSizeGB 0}}
,"diskSizeGB": {{.OSDiskSizeGB}}
{{end}}
}
}
},
"type": "Microsoft.Compute/virtualMachines"
}
{{if .IsRHEL}}
,{
"apiVersion": "[variables('apiVersionDefault')]",
"copy": {
"count": "[variables('{{.Name}}Count')]",
"name": "vmLoopNode"
},
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset'))))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')), '/configureagent')]",
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"settings": {
"commandToExecute": "[variables('agentCustomScript')]",
"fileUris": [
"[concat('{{ GetConfigurationScriptRootURL }}', variables('configureClusterScriptFile'))]"
]
},
"type": "CustomScript",
"typeHandlerVersion": "2.0"
},
"type": "Microsoft.Compute/virtualMachines/extensions"
}
{{end}}

Просмотреть файл

@ -1,206 +0,0 @@
{{if .IsStorageAccount}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"copy": {
"count": "[variables('{{.Name}}StorageAccountsCount')]",
"name": "vmLoopNode"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{end}}
{{if IsPublic .Ports}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}IPAddressName')]",
"properties": {
"dnsSettings": {
"domainNameLabel": "[variables('{{.Name}}EndpointDNSNamePrefix')]"
},
"publicIPAllocationMethod": "Dynamic"
},
"type": "Microsoft.Network/publicIPAddresses"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('{{.Name}}IPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('{{.Name}}LbName')]",
"properties": {
"backendAddressPools": [
{
"name": "[variables('{{.Name}}LbBackendPoolName')]"
}
],
"frontendIPConfigurations": [
{
"name": "[variables('{{.Name}}LbIPConfigName')]",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('{{.Name}}IPAddressName'))]"
}
}
}
],
"inboundNatRules": [],
"loadBalancingRules": [
{{(GetLBRules .Name .Ports)}}
],
"probes": [
{{(GetProbes .Ports)}}
]
},
"type": "Microsoft.Network/loadBalancers"
},
{{end}}
{
{{if .IsManagedDisks}}
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
{{else}}
"apiVersion": "[variables('apiVersionDefault')]",
{{end}}
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
{{if .IsStorageAccount}}
,"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]"
{{end}}
{{if not .IsCustomVNET}}
,"[variables('vnetID')]"
{{end}}
{{if IsPublic .Ports}}
,"[variables('{{.Name}}LbID')]"
{{end}}
],
"tags":
{
"creationSource" : "[concat('acsengine-', variables('{{.Name}}VMNamePrefix'), '-vmss')]"
},
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), '-vmss')]",
"properties": {
"upgradePolicy": {
"mode": "Automatic"
},
"virtualMachineProfile": {
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "nic",
"properties": {
"ipConfigurations": [
{
"name": "nicipconfig",
"properties": {
{{if IsPublic .Ports}}
"loadBalancerBackendAddressPools": [
{
"id": "[concat(variables('{{.Name}}LbID'), '/backendAddressPools/', variables('{{.Name}}LbBackendPoolName'))]"
}
],
{{end}}
"subnet": {
"id": "[variables('{{.Name}}VnetSubnetID')]"
}
}
}
],
"primary": "true"
}
}
]
},
"osProfile": {
"adminUsername": "[variables('adminUsername')]",
"computerNamePrefix": "[variables('{{.Name}}VMNamePrefix')]",
{{if IsSwarmMode}}
{{if not .IsRHEL}}
{{GetAgentSwarmModeCustomData .}}
{{end}}
{{else}}
{{GetAgentSwarmCustomData .}}
{{end}}
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"keyData": "[parameters('sshRSAPublicKey')]",
"path": "[variables('sshKeyPath')]"
}
]
}
}
{{if HasLinuxSecrets}}
,
"secrets": "[variables('linuxProfileSecrets')]"
{{end}}
},
"storageProfile": {
"imageReference": {
"offer": "[variables('{{.Name}}OSImageOffer')]",
"publisher": "[variables('{{.Name}}OSImagePublisher')]",
"sku": "[variables('{{.Name}}OSImageSKU')]",
"version": "[variables('{{.Name}}OSImageVersion')]"
},
{{GetDataDisks .}}
"osDisk": {
"caching": "ReadWrite"
,"createOption": "FromImage"
{{if .IsStorageAccount}}
,"name": "vmssosdisk"
,"vhdContainers": [
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')), variables('apiVersionStorage') ).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]"
]
{{end}}
{{if ne .OSDiskSizeGB 0}}
,"diskSizeGB": {{.OSDiskSizeGB}}
{{end}}
}
}
{{if .IsRHEL}}
,"extensionProfile": {
"extensions": [
{
"name": "configure{{.Name}}",
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"settings": {
"commandToExecute": "[variables('agentCustomScript')]",
"fileUris": [
"[concat('{{ GetConfigurationScriptRootURL }}', variables('configureClusterScriptFile'))]"
]
},
"type": "CustomScript",
"typeHandlerVersion": "2.0"
}
}
]
}
{{end}}
}
},
"sku": {
"capacity": "[variables('{{.Name}}Count')]",
"name": "[variables('{{.Name}}VMSize')]",
"tier": "[variables('{{.Name}}VMSizeTier')]"
},
"type": "Microsoft.Compute/virtualMachineScaleSets"
}

Просмотреть файл

@ -1,51 +0,0 @@
{{if not .IsRHEL}}
"{{.Name}}RunCmd": "[concat('runcmd:\n {{GetSwarmAgentPreprovisionExtensionCommands .}} \n- [ /bin/bash, /opt/azure/containers/install-cluster.sh ]\n\n')]",
"{{.Name}}RunCmdFile": "[concat(' - content: |\n #!/bin/bash\n ','sudo mkdir -p /var/log/azure\n ',variables('agentCustomScript'),'\n path: /opt/azure/containers/install-cluster.sh\n permissions: \"0744\"\n')]",
{{end}}
{{if IsSwarmMode }}
"{{.Name}}OSImageOffer": {{GetAgentOSImageOffer .}},
"{{.Name}}OSImagePublisher": {{GetAgentOSImagePublisher .}},
"{{.Name}}OSImageSKU": {{GetAgentOSImageSKU .}},
"{{.Name}}OSImageVersion": {{GetAgentOSImageVersion .}},
{{else}}
"{{.Name}}OSImageOffer": "[variables('osImageOffer')]",
"{{.Name}}OSImagePublisher": "[variables('osImagePublisher')]",
"{{.Name}}OSImageSKU": "[variables('osImageSKU')]",
"{{.Name}}OSImageVersion": "[variables('osImageVersion')]",
{{end}}
"{{.Name}}Count": "[parameters('{{.Name}}Count')]",
"{{.Name}}VMNamePrefix": "[concat(variables('orchestratorName'), '-{{.Name}}-', variables('nameSuffix'))]",
"{{.Name}}VMSize": "[parameters('{{.Name}}VMSize')]",
"{{.Name}}VMSizeTier": "[split(parameters('{{.Name}}VMSize'),'_')[0]]",
{{if .IsAvailabilitySets}}
{{if .IsStorageAccount}}
"{{.Name}}StorageAccountsCount": "[add(div(variables('{{.Name}}Count'), variables('maxVMsPerStorageAccount')), mod(add(mod(variables('{{.Name}}Count'), variables('maxVMsPerStorageAccount')),2), add(mod(variables('{{.Name}}Count'), variables('maxVMsPerStorageAccount')),1)))]",
"{{.Name}}StorageAccountOffset": "[mul(variables('maxStorageAccountsPerAgent'),variables('{{.Name}}Index'))]",
{{end}}
"{{.Name}}AvailabilitySet": "[concat('{{.Name}}-availabilitySet-', variables('nameSuffix'))]",
"{{.Name}}Offset": "[parameters('{{.Name}}Offset')]",
{{else}}
{{if .IsStorageAccount}}
"{{.Name}}StorageAccountsCount": "[variables('maxStorageAccountsPerAgent')]",
{{end}}
{{end}}
{{if .IsCustomVNET}}
"{{.Name}}VnetSubnetID": "[parameters('{{.Name}}VnetSubnetID')]",
{{else}}
"{{.Name}}Subnet": "[parameters('{{.Name}}Subnet')]",
"{{.Name}}SubnetName": "[concat(variables('orchestratorName'), '-{{.Name}}subnet')]",
"{{.Name}}VnetSubnetID": "[concat(variables('vnetID'),'/subnets/',variables('{{.Name}}SubnetName'))]",
{{end}}
{{if IsPublic .Ports}}
"{{.Name}}EndpointDNSNamePrefix": "[tolower(parameters('{{.Name}}EndpointDNSNamePrefix'))]",
"{{.Name}}IPAddressName": "[concat(variables('orchestratorName'), '-agent-ip-', variables('{{.Name}}EndpointDNSNamePrefix'), '-', variables('nameSuffix'))]",
"{{.Name}}LbBackendPoolName": "[concat(variables('orchestratorName'), '-{{.Name}}-', variables('nameSuffix'))]",
"{{.Name}}LbID": "[resourceId('Microsoft.Network/loadBalancers',variables('{{.Name}}LbName'))]",
"{{.Name}}LbIPConfigID": "[concat(variables('{{.Name}}LbID'),'/frontendIPConfigurations/', variables('{{.Name}}LbIPConfigName'))]",
"{{.Name}}LbIPConfigName": "[concat(variables('orchestratorName'), '-{{.Name}}-', variables('nameSuffix'))]",
"{{.Name}}LbName": "[concat(variables('orchestratorName'), '-{{.Name}}-', variables('nameSuffix'))]",
{{if .IsWindows}}
"{{.Name}}WindowsRDPNatRangeStart": 3389,
"{{.Name}}WindowsRDPEndRangeStop": "[add(variables('{{.Name}}WindowsRDPNatRangeStart'), add(variables('{{.Name}}Count'),variables('{{.Name}}Count')))]",
{{end}}
{{end}}

Просмотреть файл

@ -1,50 +0,0 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
{{range .AgentPoolProfiles}}{{template "agentparams.t" .}},{{end}}
{{if .HasWindows}}
{{template "windowsparams.t"}},
{{end}}
{{template "masterparams.t" .}}
{{template "swarm/swarmparams.t" .}}
},
"variables": {
{{range $index, $agent := .AgentPoolProfiles}}
"{{.Name}}Index": {{$index}},
{{template "swarm/swarmagentvars.t" .}}
{{if .IsStorageAccount}}
"{{.Name}}StorageAccountOffset": "[mul(variables('maxStorageAccountsPerAgent'),{{$index}})]",
"{{.Name}}AccountName": "[concat(variables('storageAccountBaseName'), 'agnt{{$index}}')]",
{{if .HasDisks}}
"{{.Name}}DataAccountName": "[concat(variables('storageAccountBaseName'), 'data{{$index}}')]",
{{end}}
{{end}}
{{end}}
{{template "swarm/swarmmastervars.t" .}}
},
"resources": [
{{range .AgentPoolProfiles}}
{{if .IsWindows}}
{{if .IsAvailabilitySets}}
{{template "swarm/swarmwinagentresourcesvmas.t" .}},
{{else}}
{{template "swarm/swarmwinagentresourcesvmss.t" .}},
{{end}}
{{else}}
{{if .IsAvailabilitySets}}
{{template "swarm/swarmagentresourcesvmas.t" .}},
{{else}}
{{template "swarm/swarmagentresourcesvmss.t" .}},
{{end}}
{{end}}
{{end}}
{{template "swarm/swarmmasterresources.t" .}}
],
"outputs": {
{{range .AgentPoolProfiles}}{{template "agentoutputs.t" .}}
{{end}}
{{template "masteroutputs.t" .}}
}
}

Просмотреть файл

@ -1,287 +0,0 @@
{{if not .MasterProfile.IsCustomVNET}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('virtualNetworkName')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
{{GetVNETAddressPrefixes}}
]
},
"subnets": [
{{GetVNETSubnets false}}
]
},
"type": "Microsoft.Network/virtualNetworks"
},
{{end}}
{{if .MasterProfile.IsManagedDisks}}
{
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
"location": "[variables('location')]",
"name": "[variables('masterAvailabilitySet')]",
"properties": {
"platformFaultDomainCount": 2,
"platformUpdateDomainCount": 3,
"managed": "true"
},
"type": "Microsoft.Compute/availabilitySets"
},
{{else if .MasterProfile.IsStorageAccount}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('masterAvailabilitySet')]",
"properties": {},
"type": "Microsoft.Compute/availabilitySets"
},
{
"apiVersion": "[variables('apiVersionStorage')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('masterStorageAccountName')]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('masterVMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{end}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('masterPublicIPAddressName')]",
"properties": {
"dnsSettings": {
"domainNameLabel": "[variables('masterEndpointDNSNamePrefix')]"
},
"publicIPAllocationMethod": "Dynamic"
},
"type": "Microsoft.Network/publicIPAddresses"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('masterLbName')]",
"properties": {
"backendAddressPools": [
{
"name": "[variables('masterLbBackendPoolName')]"
}
],
"frontendIPConfigurations": [
{
"name": "[variables('masterLbIPConfigName')]",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('masterPublicIPAddressName'))]"
}
}
}
]
},
"type": "Microsoft.Network/loadBalancers"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"copy": {
"count": "[variables('masterCount')]",
"name": "masterLbLoopNode"
},
"dependsOn": [
"[variables('masterLbID')]"
],
"location": "[variables('location')]",
"name": "[concat(variables('masterLbName'), '/', 'SSH-', variables('masterVMNamePrefix'), copyIndex())]",
"properties": {
"backendPort": 22,
"enableFloatingIP": false,
"frontendIPConfiguration": {
"id": "[variables('masterLbIPConfigID')]"
},
"frontendPort": "[copyIndex(2200)]",
"protocol": "Tcp"
},
"type": "Microsoft.Network/loadBalancers/inboundNatRules"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[variables('masterLbID')]"
],
"location": "[variables('location')]",
"name": "[concat(variables('masterSshPort22InboundNatRuleNamePrefix'), '0')]",
"properties": {
"backendPort": 2222,
"enableFloatingIP": false,
"frontendIPConfiguration": {
"id": "[variables('masterLbIPConfigID')]"
},
"frontendPort": "22",
"protocol": "Tcp"
},
"type": "Microsoft.Network/loadBalancers/inboundNatRules"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"copy": {
"count": "[variables('masterCount')]",
"name": "nicLoopNode"
},
"dependsOn": [
{{if not .MasterProfile.IsCustomVNET}}
"[variables('vnetID')]",
{{end}}
"[variables('masterLbID')]",
"[concat(variables('masterSshPort22InboundNatRuleIdPrefix'),'0')]",
"[concat(variables('masterSshInboundNatRuleIdPrefix'),copyIndex())]"
],
"location": "[variables('location')]",
"name": "[concat(variables('masterVMNamePrefix'), 'nic-', copyIndex())]",
"properties": {
"ipConfigurations": [
{
"name": "ipConfigNode",
"properties": {
"loadBalancerBackendAddressPools": [
{
"id": "[concat(variables('masterLbID'), '/backendAddressPools/', variables('masterLbBackendPoolName'))]"
}
],
"loadBalancerInboundNatRules": "[variables('masterLbInboundNatRules')[copyIndex()]]",
"privateIPAddress": "[concat(variables('masterFirstAddrPrefix'), copyIndex(int(variables('masterFirstAddrOctet4'))))]",
"privateIPAllocationMethod": "Static",
"subnet": {
"id": "[variables('masterVnetSubnetID')]"
}
}
}
]
},
"type": "Microsoft.Network/networkInterfaces"
},
{
{{if .MasterProfile.IsManagedDisks}}
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
{{else}}
"apiVersion": "[variables('apiVersionDefault')]",
{{end}}
"copy": {
"count": "[variables('masterCount')]",
"name": "vmLoopNode"
},
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('masterVMNamePrefix'), 'nic-', copyIndex())]",
"[concat('Microsoft.Compute/availabilitySets/',variables('masterAvailabilitySet'))]"
{{if .MasterProfile.IsStorageAccount}}
,"[variables('masterStorageAccountName')]"
{{end}}
],
"tags":
{
"creationSource" : "[concat('acsengine-', variables('masterVMNamePrefix'), copyIndex())]"
},
"location": "[variables('location')]",
"name": "[concat(variables('masterVMNamePrefix'), copyIndex())]",
"properties": {
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets',variables('masterAvailabilitySet'))]"
},
"hardwareProfile": {
"vmSize": "[variables('masterVMSize')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('masterVMNamePrefix'), 'nic-', copyIndex()))]"
}
]
},
"osProfile": {
"adminUsername": "[variables('adminUsername')]",
"computername": "[concat(variables('masterVMNamePrefix'), copyIndex())]",
{{if .OrchestratorProfile.IsSwarmMode}}
{{if not .MasterProfile.IsRHEL}}
{{GetMasterSwarmModeCustomData}}
{{end}}
{{else}}
{{GetMasterSwarmCustomData}}
{{end}}
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"keyData": "[variables('sshRSAPublicKey')]",
"path": "[variables('sshKeyPath')]"
}
]
}
}
{{if .LinuxProfile.HasSecrets}}
,
"secrets": "[variables('linuxProfileSecrets')]"
{{end}}
},
"storageProfile": {
"imageReference": {
{{if .OrchestratorProfile.IsSwarmMode}}
"offer": "[variables('masterOSImageOffer')]",
"publisher": "[variables('masterOSImagePublisher')]",
"sku": "[variables('masterOSImageSKU')]",
"version": "[variables('masterOSImageVersion')]"
{{else}}
"offer": "[variables('osImageOffer')]",
"publisher": "[variables('osImagePublisher')]",
"sku": "[variables('osImageSKU')]",
"version": "[variables('osImageVersion')]"
{{end}}
},
"osDisk": {
"caching": "ReadWrite"
,"createOption": "FromImage"
{{if .MasterProfile.IsStorageAccount}}
,"name": "[concat(variables('masterVMNamePrefix'), copyIndex(),'-osdisk')]"
,"vhd": {
"uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('masterStorageAccountName')), variables('apiVersionStorage')).primaryEndpoints.blob, 'vhds/', variables('masterVMNamePrefix'), copyIndex(), '-osdisk.vhd')]"
}
{{end}}
{{if ne .MasterProfile.OSDiskSizeGB 0}}
,"diskSizeGB": {{.MasterProfile.OSDiskSizeGB}}
{{end}}
}
}
},
"type": "Microsoft.Compute/virtualMachines"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"copy": {
"count": "[variables('masterCount')]",
"name": "vmLoopNode"
},
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', concat(variables('masterVMNamePrefix'), copyIndex()))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('masterVMNamePrefix'), copyIndex(), '/configuremaster')]",
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"settings": {
"commandToExecute": "[variables('masterCustomScript')]",
"fileUris": [
{{if .MasterProfile.IsRHEL}}
"[concat('{{ GetConfigurationScriptRootURL }}', variables('configureClusterScriptFile'))]"
{{end}}
]
},
"type": "CustomScript",
"typeHandlerVersion": "2.0"
},
"type": "Microsoft.Compute/virtualMachines/extensions"
}

Просмотреть файл

@ -1,178 +0,0 @@
"adminUsername": "[parameters('linuxAdminUsername')]",
"maxVMsPerPool": 100,
"apiVersionDefault": "2016-03-30",
{{if .OrchestratorProfile.IsSwarmMode}}
"configureClusterScriptFile": "configure-swarmmode-cluster.sh",
{{else}}
"configureClusterScriptFile": "configure-swarm-cluster.sh",
{{end}}
{{if .MasterProfile.IsRHEL}}
"agentCustomScript": "[concat('/usr/bin/nohup /bin/bash -c \"/bin/bash ',variables('configureClusterScriptFile'), ' ',variables('clusterInstallParameters'),' >> /var/log/azure/cluster-bootstrap.log 2>&1 &\" &')]",
{{else}}
"agentCustomScript": "[concat('/usr/bin/nohup /bin/bash -c \"/bin/bash /opt/azure/containers/',variables('configureClusterScriptFile'), ' ',variables('clusterInstallParameters'),' >> /var/log/azure/cluster-bootstrap.log 2>&1 &\" &')]",
{{end}}
"agentMaxVMs": 100,
"clusterInstallParameters": "[concat(variables('orchestratorVersion'), ' ',variables('dockerComposeVersion'), ' ',variables('masterCount'), ' ',variables('masterVMNamePrefix'), ' ',variables('masterFirstAddrOctet4'), ' ',variables('adminUsername'),' ',variables('postInstallScriptURI'),' ',variables('masterFirstAddrPrefix'),' ', parameters('dockerEngineDownloadRepo'), ' ', parameters('dockerComposeDownloadURL'))]",
{{if .LinuxProfile.HasSecrets}}
"linuxProfileSecrets" :
[
{{range $vIndex, $vault := .LinuxProfile.Secrets}}
{{if $vIndex}} , {{end}}
{
"sourceVault":{
"id":"[parameters('linuxKeyVaultID{{$vIndex}}')]"
},
"vaultCertificates":[
{{range $cIndex, $cert := $vault.VaultCertificates}}
{{if $cIndex}} , {{end}}
{
"certificateUrl" :"[parameters('linuxKeyVaultID{{$vIndex}}CertificateURL{{$cIndex}}')]"
}
{{end}}
]
}
{{end}}
],
{{end}}
"masterAvailabilitySet": "[concat(variables('orchestratorName'), '-master-availabilitySet-', variables('nameSuffix'))]",
"masterCount": {{.MasterProfile.Count}},
{{if .MasterProfile.IsRHEL}}
"masterCustomScript": "[concat('/bin/bash -c \"/bin/bash ',variables('configureClusterScriptFile'), ' ',variables('clusterInstallParameters'),' >> /var/log/azure/cluster-bootstrap.log 2>&1\"')]",
{{else}}
"masterCustomScript": "[concat('/bin/bash -c \"/bin/bash /opt/azure/containers/',variables('configureClusterScriptFile'), ' ',variables('clusterInstallParameters'),' >> /var/log/azure/cluster-bootstrap.log 2>&1\"')]",
{{end}}
"masterEndpointDNSNamePrefix": "[tolower(parameters('masterEndpointDNSNamePrefix'))]",
"masterLbBackendPoolName": "[concat(variables('orchestratorName'), '-master-pool-', variables('nameSuffix'))]",
"masterLbID": "[resourceId('Microsoft.Network/loadBalancers',variables('masterLbName'))]",
"masterLbIPConfigID": "[concat(variables('masterLbID'),'/frontendIPConfigurations/', variables('masterLbIPConfigName'))]",
"masterLbIPConfigName": "[concat(variables('orchestratorName'), '-master-lbFrontEnd-', variables('nameSuffix'))]",
"masterLbName": "[concat(variables('orchestratorName'), '-master-lb-', variables('nameSuffix'))]",
"masterPublicIPAddressName": "[concat(variables('orchestratorName'), '-master-ip-', variables('masterEndpointDNSNamePrefix'), '-', variables('nameSuffix'))]",
{{if .MasterProfile.IsCustomVNET}}
"masterVnetSubnetID": "[parameters('masterVnetSubnetID')]",
{{else}}
"masterSubnet": "[parameters('masterSubnet')]",
"masterSubnetName": "[concat(variables('orchestratorName'), '-masterSubnet')]",
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]",
"masterVnetSubnetID": "[concat(variables('vnetID'),'/subnets/',variables('masterSubnetName'))]",
"virtualNetworkName": "[concat(variables('orchestratorName'), '-vnet-', variables('nameSuffix'))]",
{{end}}
"masterFirstAddrOctets": "[split(parameters('firstConsecutiveStaticIP'),'.')]",
"masterFirstAddrOctet4": "[variables('masterFirstAddrOctets')[3]]",
"masterFirstAddrPrefix": "[concat(variables('masterFirstAddrOctets')[0],'.',variables('masterFirstAddrOctets')[1],'.',variables('masterFirstAddrOctets')[2],'.')]",
"masterVMNamePrefix": "[concat(variables('orchestratorName'), '-master-', variables('nameSuffix'), '-')]",
"masterVMSize": "[parameters('masterVMSize')]",
"nameSuffix": "[parameters('nameSuffix')]",
"masterSshInboundNatRuleIdPrefix": "[concat(variables('masterLbID'),'/inboundNatRules/SSH-',variables('masterVMNamePrefix'))]",
"masterSshPort22InboundNatRuleNamePrefix": "[concat(variables('masterLbName'),'/SSHPort22-',variables('masterVMNamePrefix'))]",
"masterSshPort22InboundNatRuleIdPrefix": "[concat(variables('masterLbID'),'/inboundNatRules/SSHPort22-',variables('masterVMNamePrefix'))]",
"masterLbInboundNatRules":[
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'0')]"
},
{
"id": "[concat(variables('masterSshPort22InboundNatRuleIdPrefix'),'0')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'1')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'2')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'3')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'4')]"
}
]
],
{{if .OrchestratorProfile.IsSwarmMode}}
"orchestratorName": "swarmm",
"masterOSImageOffer": {{GetMasterOSImageOffer}},
"masterOSImagePublisher": {{GetMasterOSImagePublisher}},
"masterOSImageSKU": {{GetMasterOSImageSKU}},
"masterOSImageVersion": {{GetMasterOSImageVersion}},
{{GetSwarmModeVersions}}
{{else}}
"orchestratorName": "swarm",
"osImageOffer": "[parameters('osImageOffer')]",
"osImagePublisher": "[parameters('osImagePublisher')]",
"osImageSKU": "14.04.5-LTS",
"osImageVersion": "14.04.201706190",
{{getSwarmVersions}}
{{end}}
"locations": [
"[resourceGroup().location]",
"[parameters('location')]"
],
"location": "[variables('locations')[mod(add(2,length(parameters('location'))),add(1,length(parameters('location'))))]]",
"postInstallScriptURI": "disabled",
"sshKeyPath": "[concat('/home/', variables('adminUsername'), '/.ssh/authorized_keys')]",
{{if .HasStorageAccountDisks}}
"apiVersionStorage": "2015-06-15",
"maxVMsPerStorageAccount": 20,
"maxStorageAccountsPerAgent": "[div(variables('maxVMsPerPool'),variables('maxVMsPerStorageAccount'))]",
"dataStorageAccountPrefixSeed": 97,
"storageAccountPrefixes": [ "0", "6", "c", "i", "o", "u", "1", "7", "d", "j", "p", "v", "2", "8", "e", "k", "q", "w", "3", "9", "f", "l", "r", "x", "4", "a", "g", "m", "s", "y", "5", "b", "h", "n", "t", "z" ],
"storageAccountPrefixesCount": "[length(variables('storageAccountPrefixes'))]",
"vmsPerStorageAccount": 20,
"storageAccountBaseName": "[uniqueString(concat(variables('masterEndpointDNSNamePrefix'),variables('location')))]",
{{GetSizeMap}},
{{else}}
"storageAccountPrefixes": [],
"storageAccountBaseName": "",
{{end}}
{{if .HasManagedDisks}}
"apiVersionStorageManagedDisks": "2016-04-30-preview",
{{end}}
{{if .MasterProfile.IsStorageAccount}}
"masterStorageAccountName": "[concat(variables('storageAccountBaseName'), '0')]",
{{end}}
"sshRSAPublicKey": "[parameters('sshRSAPublicKey')]"
{{if .HasWindows}}
,"windowsAdminUsername": "[parameters('windowsAdminUsername')]",
"windowsAdminPassword": "[parameters('windowsAdminPassword')]",
"agentWindowsPublisher": "[parameters('agentWindowsPublisher')]",
"agentWindowsOffer": "[parameters('agentWindowsOffer')]",
"agentWindowsSku": "[parameters('agentWindowsSku')]",
"agentWindowsVersion": "[parameters('agentWindowsVersion')]",
"singleQuote": "'",
"windowsCustomScriptArguments": "[concat('$arguments = ', variables('singleQuote'),'-SwarmMasterIP ', variables('masterFirstAddrPrefix'), variables('masterFirstAddrOctet4'), variables('singleQuote'), ' ; ')]",
"windowsCustomScriptSuffix": " $inputFile = '%SYSTEMDRIVE%\\AzureData\\CustomData.bin' ; $outputFile = '%SYSTEMDRIVE%\\AzureData\\CustomDataSetupScript.ps1' ; $inputStream = New-Object System.IO.FileStream $inputFile, ([IO.FileMode]::Open), ([IO.FileAccess]::Read), ([IO.FileShare]::Read) ; $sr = New-Object System.IO.StreamReader(New-Object System.IO.Compression.GZipStream($inputStream, [System.IO.Compression.CompressionMode]::Decompress)) ; $sr.ReadToEnd() | Out-File($outputFile) ; Invoke-Expression('{0} {1}' -f $outputFile, $arguments) ; ",
"windowsCustomScript": "[concat('powershell.exe -ExecutionPolicy Unrestricted -command \"', variables('windowsCustomScriptArguments'), variables('windowsCustomScriptSuffix'), '\" > %SYSTEMDRIVE%\\AzureData\\CustomDataSetupScript.log 2>&1')]",
"agentWindowsBackendPort": 3389
{{if .WindowsProfile.HasSecrets}}
,
"windowsProfileSecrets" :
[
{{range $vIndex, $vault := .LinuxProfile.Secrets}}
{{if $vIndex}} , {{end}}
{
"sourceVault":{
"id":"[parameters('windowsKeyVaultID{{$vIndex}}')]"
},
"vaultCertificates":[
{{range $cIndex, $cert := $vault.VaultCertificates}}
{{if $cIndex}} , {{end}}
{
"certificateUrl" :"[parameters('windowsKeyVaultID{{$vIndex}}CertificateURL{{$cIndex}}')]",
"certificateStore" :"[parameters('windowsKeyVaultID{{$vIndex}}CertificateStore{{$cIndex}}')]"
}
{{end}}
]
}
{{end}}
]
{{end}}
{{end}}

Просмотреть файл

@ -1,15 +0,0 @@
,
"dockerEngineDownloadRepo": {
"defaultValue": "",
"metadata": {
"description": "Docker engine download repo."
},
"type": "string"
},
"dockerComposeDownloadURL": {
"defaultValue": "",
"metadata": {
"description": "Docker compose download URL."
},
"type": "string"
}

Просмотреть файл

@ -1,259 +0,0 @@
{
"apiVersion": "[variables('apiVersionDefault')]",
"copy": {
"count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]",
"name": "loop"
},
"dependsOn": [
{{if not .IsCustomVNET}}
"[variables('vnetID')]"
{{end}}
{{if IsPublic .Ports}}
,"[variables('{{.Name}}LbID')]"
{{end}}
],
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), 'nic-', copyIndex(variables('{{.Name}}Offset')))]",
"properties": {
"ipConfigurations": [
{
"name": "ipConfigNode",
"properties": {
{{if IsPublic .Ports}}
"loadBalancerBackendAddressPools": [
{
"id": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/loadBalancers/', variables('{{.Name}}LbName'), '/backendAddressPools/',variables('{{.Name}}LbBackendPoolName'))]"
}
],
"loadBalancerInboundNatPools": [
{
"id": "[concat(variables('{{.Name}}LbID'), '/inboundNatPools/', 'RDP-', variables('{{.Name}}VMNamePrefix'))]"
}
],
{{end}}
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[variables('{{.Name}}VnetSubnetID')]"
}
}
}
]
},
"type": "Microsoft.Network/networkInterfaces"
},
{{if .IsManagedDisks}}
{
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}AvailabilitySet')]",
"properties": {
"platformFaultDomainCount": 2,
"platformUpdateDomainCount": 3,
"managed": "true"
},
"type": "Microsoft.Compute/availabilitySets"
},
{{else if .IsStorageAccount}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"copy": {
"count": "[variables('{{.Name}}StorageAccountsCount')]",
"name": "vmLoopNode"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{if .HasDisks}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"copy": {
"count": "[variables('{{.Name}}StorageAccountsCount')]",
"name": "datadiskLoop"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(variables('dataStorageAccountPrefixSeed')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(variables('dataStorageAccountPrefixSeed')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}DataAccountName'))]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{end}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}AvailabilitySet')]",
"properties": {},
"type": "Microsoft.Compute/availabilitySets"
},
{{end}}
{{if IsPublic .Ports}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}IPAddressName')]",
"properties": {
"dnsSettings": {
"domainNameLabel": "[variables('{{.Name}}EndpointDNSNamePrefix')]"
},
"publicIPAllocationMethod": "Dynamic"
},
"type": "Microsoft.Network/publicIPAddresses"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('{{.Name}}IPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('{{.Name}}LbName')]",
"properties": {
"backendAddressPools": [
{
"name": "[variables('{{.Name}}LbBackendPoolName')]"
}
],
"frontendIPConfigurations": [
{
"name": "[variables('{{.Name}}LbIPConfigName')]",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('{{.Name}}IPAddressName'))]"
}
}
}
],
"inboundNatPools": [
{
"name": "[concat('RDP-', variables('{{.Name}}VMNamePrefix'))]",
"properties": {
"frontendIPConfiguration": {
"id": "[variables('{{.Name}}LbIPConfigID')]"
},
"protocol": "Tcp",
"frontendPortRangeStart": "[variables('{{.Name}}WindowsRDPNatRangeStart')]",
"frontendPortRangeEnd": "[variables('{{.Name}}WindowsRDPEndRangeStop')]",
"backendPort": "[variables('agentWindowsBackendPort')]"
}
}
],
"loadBalancingRules": [
{{(GetLBRules .Name .Ports)}}
],
"probes": [
{{(GetProbes .Ports)}}
]
},
"type": "Microsoft.Network/loadBalancers"
},
{{end}}
{
{{if .IsManagedDisks}}
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
{{else}}
"apiVersion": "[variables('apiVersionDefault')]",
{{end}}
"copy": {
"count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]",
"name": "vmLoopNode"
},
"dependsOn": [
{{if .IsStorageAccount}}
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
{{if .HasDisks}}
"[concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('dataStorageAccountPrefixSeed')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('dataStorageAccountPrefixSeed')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}DataAccountName'))]",
{{end}}
{{end}}
"[concat('Microsoft.Network/networkInterfaces/', variables('{{.Name}}VMNamePrefix'), 'nic-', copyIndex(variables('{{.Name}}Offset')))]",
"[concat('Microsoft.Compute/availabilitySets/', variables('{{.Name}}AvailabilitySet'))]"
],
"tags":
{
"creationSource" : "[concat('acsengine-', variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')))]"
},
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')))]",
"properties": {
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets',variables('{{.Name}}AvailabilitySet'))]"
},
"hardwareProfile": {
"vmSize": "[variables('{{.Name}}VMSize')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('{{.Name}}VMNamePrefix'), 'nic-', copyIndex(variables('{{.Name}}Offset'))))]"
}
]
},
"osProfile": {
"computername": "[concat(substring(variables('nameSuffix'), 0, 5), 'acs', copyIndex(variables('{{.Name}}Offset')), add(900,variables('{{.Name}}Index')))]",
"adminUsername": "[variables('windowsAdminUsername')]",
"adminPassword": "[variables('windowsAdminPassword')]",
{{if IsSwarmMode}}
{{GetWinAgentSwarmModeCustomData}}
{{else}}
{{GetWinAgentSwarmCustomData}}
{{end}}
{{if HasWindowsSecrets}}
,
"secrets": "[variables('windowsProfileSecrets')]"
{{end}}
},
"storageProfile": {
{{GetDataDisks .}}
"imageReference": {
"publisher": "[variables('agentWindowsPublisher')]",
"offer": "[variables('agentWindowsOffer')]",
"sku": "[variables('agentWindowsSku')]",
"version": "[variables('agentWindowsVersion')]"
}
,"osDisk": {
"caching": "ReadOnly"
,"createOption": "FromImage"
{{if .IsStorageAccount}}
,"name": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')),'-osdisk')]"
,"vhd": {
"uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(div(copyIndex(variables('{{.Name}}Offset')),variables('maxVMsPerStorageAccount')),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')),variables('apiVersionStorage')).primaryEndpoints.blob,'osdisk/', variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')), '-osdisk.vhd')]"
}
{{end}}
{{if ne .OSDiskSizeGB 0}}
,"diskSizeGB": {{.OSDiskSizeGB}}
{{end}}
}
}
},
"type": "Microsoft.Compute/virtualMachines"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"copy": {
"count": "[sub(variables('{{.Name}}Count'), variables('{{.Name}}Offset'))]",
"name": "vmLoopNode"
},
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), copyIndex(variables('{{.Name}}Offset')), '/cse')]",
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.8",
"autoUpgradeMinorVersion": true,
"settings": {
"commandToExecute": "[variables('windowsCustomScript')]"
}
},
"type": "Microsoft.Compute/virtualMachines/extensions"
}

Просмотреть файл

@ -1,208 +0,0 @@
{{if .IsStorageAccount}}
{
"apiVersion": "[variables('apiVersionStorage')]",
"copy": {
"count": "[variables('{{.Name}}StorageAccountsCount')]",
"name": "vmLoopNode"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(),variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('{{.Name}}VMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{{end}}
{{if IsPublic .Ports}}
{
"apiVersion": "[variables('apiVersionDefault')]",
"location": "[variables('location')]",
"name": "[variables('{{.Name}}IPAddressName')]",
"properties": {
"dnsSettings": {
"domainNameLabel": "[variables('{{.Name}}EndpointDNSNamePrefix')]"
},
"publicIPAllocationMethod": "Dynamic"
},
"type": "Microsoft.Network/publicIPAddresses"
},
{
"apiVersion": "[variables('apiVersionDefault')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('{{.Name}}IPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('{{.Name}}LbName')]",
"properties": {
"backendAddressPools": [
{
"name": "[variables('{{.Name}}LbBackendPoolName')]"
}
],
"frontendIPConfigurations": [
{
"name": "[variables('{{.Name}}LbIPConfigName')]",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('{{.Name}}IPAddressName'))]"
}
}
}
],
"inboundNatRules": [],
"loadBalancingRules": [
{{(GetLBRules .Name .Ports)}}
],
"probes": [
{{(GetProbes .Ports)}}
],
"inboundNatPools": [
{
"name": "[concat('RDP-', variables('{{.Name}}VMNamePrefix'))]",
"properties": {
"frontendIPConfiguration": {
"id": "[variables('{{.Name}}LbIPConfigID')]"
},
"protocol": "Tcp",
"frontendPortRangeStart": "[variables('{{.Name}}WindowsRDPNatRangeStart')]",
"frontendPortRangeEnd": "[variables('{{.Name}}WindowsRDPEndRangeStop')]",
"backendPort": "[variables('agentWindowsBackendPort')]"
}
}
]
},
"type": "Microsoft.Network/loadBalancers"
},
{{end}}
{
{{if .IsManagedDisks}}
"apiVersion": "[variables('apiVersionStorageManagedDisks')]",
{{else}}
"apiVersion": "[variables('apiVersionDefault')]",
{{end}}
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
{{if .IsStorageAccount}}
,"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName'))]"
{{end}}
{{if not .IsCustomVNET}}
,"[variables('vnetID')]"
{{end}}
{{if IsPublic .Ports}}
,"[variables('{{.Name}}LbID')]"
{{end}}
],
"tags":
{
"creationSource" : "[concat('acsengine-', variables('{{.Name}}VMNamePrefix'), '-vmss')]"
},
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), '-vmss')]",
"properties": {
"upgradePolicy": {
"mode": "Automatic"
},
"virtualMachineProfile": {
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "nic",
"properties": {
"ipConfigurations": [
{
"name": "nicipconfig",
"properties": {
{{if IsPublic .Ports}}
"loadBalancerBackendAddressPools": [
{
"id": "[concat(variables('{{.Name}}LbID'), '/backendAddressPools/', variables('{{.Name}}LbBackendPoolName'))]"
}
],
"loadBalancerInboundNatPools": [
{
"id": "[concat(variables('{{.Name}}LbID'), '/inboundNatPools/', 'RDP-', variables('{{.Name}}VMNamePrefix'))]"
}
],
{{end}}
"subnet": {
"id": "[variables('{{.Name}}VnetSubnetID')]"
}
}
}
],
"primary": "true"
}
}
]
},
"osProfile": {
"computerNamePrefix": "[concat(substring(variables('nameSuffix'), 0, 5), 'acs')]",
"adminUsername": "[variables('windowsAdminUsername')]",
"adminPassword": "[variables('windowsAdminPassword')]",
{{if IsSwarmMode}}
{{GetWinAgentSwarmModeCustomData}}
{{else}}
{{GetWinAgentSwarmCustomData}}
{{end}}
{{if HasWindowsSecrets}}
,
"secrets": "[variables('windowsProfileSecrets')]"
{{end}}
},
"storageProfile": {
"imageReference": {
"publisher": "[variables('agentWindowsPublisher')]",
"offer": "[variables('agentWindowsOffer')]",
"sku": "[variables('agentWindowsSku')]",
"version": "[variables('agentWindowsVersion')]"
},
"osDisk": {
"caching": "ReadWrite"
,"createOption": "FromImage"
{{if .IsStorageAccount}}
,"name": "vmssosdisk"
,"vhdContainers": [
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(0,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')), variables('apiVersionStorage') ).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(1,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(2,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(3,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(4,variables('{{.Name}}StorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('{{.Name}}AccountName')), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]"
]
{{end}}
{{if ne .OSDiskSizeGB 0}}
,"diskSizeGB": {{.OSDiskSizeGB}}
{{end}}
}
},
"extensionProfile": {
"extensions": [
{
"name": "vmssCustomScriptExtension",
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.8",
"autoUpgradeMinorVersion": true,
"settings": {
"commandToExecute": "[variables('windowsCustomScript')]"
}
}
}
]
}
}
},
"sku": {
"capacity": "[variables('{{.Name}}Count')]",
"name": "[variables('{{.Name}}VMSize')]",
"tier": "[variables('{{.Name}}VMSizeTier')]"
},
"type": "Microsoft.Compute/virtualMachineScaleSets"
}

Просмотреть файл

@ -3,37 +3,14 @@
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"`
@ -109,24 +86,6 @@ var (
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",
@ -210,11 +169,8 @@ var (
//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",
@ -237,9 +193,7 @@ var (
//AzureGermanCloudSpec is the German cloud config.
AzureGermanCloudSpec = AzureEnvironmentSpecConfig{
CloudName: AzureGermanCloud,
DockerSpecConfig: DefaultDockerSpecConfig,
KubernetesSpecConfig: DefaultKubernetesSpecConfig,
DCOSSpecConfig: DefaultDCOSSpecConfig,
EndpointConfig: AzureEndpointConfig{
ResourceManagerVMDNSSuffix: "cloudapp.microsoftazure.de",
},
@ -259,9 +213,7 @@ var (
//AzureUSGovernmentCloudSpec is the US government config.
AzureUSGovernmentCloudSpec = AzureEnvironmentSpecConfig{
CloudName: AzureUSGovernmentCloud,
DockerSpecConfig: DefaultDockerSpecConfig,
KubernetesSpecConfig: DefaultKubernetesSpecConfig,
DCOSSpecConfig: DefaultDCOSSpecConfig,
EndpointConfig: AzureEndpointConfig{
ResourceManagerVMDNSSuffix: "cloudapp.usgovcloudapi.net",
},
@ -281,11 +233,6 @@ var (
//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/",
@ -308,12 +255,6 @@ var (
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",

Просмотреть файл

@ -13,9 +13,6 @@ func TestURLForAzureChinaCloud(t *testing.T) {
var azureChinaCloudMirror = "azk8s.cn"
g := NewGomegaWithT(t)
g.Expect(AzureChinaCloudSpec.DockerSpecConfig.DockerEngineRepo).To(ContainSubstring(azureChinaCloudMirror))
g.Expect(AzureChinaCloudSpec.DockerSpecConfig.DockerComposeDownloadURL).To(ContainSubstring(azureChinaCloudMirror))
g.Expect(AzureChinaCloudSpec.KubernetesSpecConfig.KubernetesImageBase).To(ContainSubstring(azureChinaCloudMirror))
g.Expect(AzureChinaCloudSpec.KubernetesSpecConfig.ACIConnectorImageBase).To(ContainSubstring(azureChinaCloudMirror))
g.Expect(AzureChinaCloudSpec.KubernetesSpecConfig.NVIDIAImageBase).To(ContainSubstring(azureChinaCloudMirror))

Просмотреть файл

@ -5,16 +5,8 @@ package common
// the orchestrators supported
const (
// Mesos is the string constant for MESOS orchestrator type
Mesos string = "Mesos"
// DCOS is the string constant for DCOS orchestrator type and defaults to DCOS188
DCOS string = "DCOS"
// Swarm is the string constant for the Swarm orchestrator type
Swarm string = "Swarm"
// Kubernetes is the string constant for the Kubernetes orchestrator type
Kubernetes string = "Kubernetes"
// SwarmMode is the string constant for the Swarm Mode orchestrator type
SwarmMode string = "SwarmMode"
)
// validation values
@ -76,55 +68,6 @@ const (
const LegacyControlPlaneVMPrefix string = "k8s-master"
const (
// DCOSVersion1Dot11Dot2 is the major.minor.patch string for 1.11.0 versions of DCOS
DCOSVersion1Dot11Dot2 string = "1.11.2"
// DCOSVersion1Dot11Dot0 is the major.minor.patch string for 1.11.0 versions of DCOS
DCOSVersion1Dot11Dot0 string = "1.11.0"
// DCOSVersion1Dot10Dot0 is the major.minor.patch string for 1.10.0 versions of DCOS
DCOSVersion1Dot10Dot0 string = "1.10.0"
// DCOSVersion1Dot9Dot0 is the major.minor.patch string for 1.9.0 versions of DCOS
DCOSVersion1Dot9Dot0 string = "1.9.0"
// DCOSVersion1Dot9Dot8 is the major.minor.patch string for 1.9.8 versions of DCOS
DCOSVersion1Dot9Dot8 string = "1.9.8"
// DCOSVersion1Dot8Dot8 is the major.minor.patch string for 1.8.8 versions of DCOS
DCOSVersion1Dot8Dot8 string = "1.8.8"
// DCOSDefaultVersion is the default major.minor.patch version for DCOS
DCOSDefaultVersion string = DCOSVersion1Dot11Dot0
)
// AllDCOSSupportedVersions maintain a list of available dcos versions in aks-engine
var AllDCOSSupportedVersions = []string{
DCOSVersion1Dot11Dot2,
DCOSVersion1Dot11Dot0,
DCOSVersion1Dot10Dot0,
DCOSVersion1Dot9Dot8,
DCOSVersion1Dot9Dot0,
DCOSVersion1Dot8Dot8,
}
const (
// SwarmVersion is the Swarm orchestrator version
SwarmVersion = "swarm:1.1.0"
// DockerCEVersion is the DockerCE orchestrator version
DockerCEVersion = "17.03.*"
)
// GetAllSupportedDCOSVersions returns a slice of all supported DCOS versions.
func GetAllSupportedDCOSVersions() []string {
return AllDCOSSupportedVersions
}
// GetAllSupportedSwarmVersions returns a slice of all supported Swarm versions.
func GetAllSupportedSwarmVersions() []string {
return []string{SwarmVersion}
}
// GetAllSupportedDockerCEVersions returns a slice of all supported Docker CE versions.
func GetAllSupportedDockerCEVersions() []string {
return []string{DockerCEVersion}
}
// MinCloudProviderQPSToBucketFactor defines the minimum ratio between QPS and Bucket size for cloudprovider rate limiting
const MinCloudProviderQPSToBucketFactor float64 = 0.1

Просмотреть файл

@ -466,8 +466,6 @@ func GetSupportedVersions(orchType string, isUpdate, hasWindows bool, isAzureSta
switch orchType {
case Kubernetes:
return GetAllSupportedKubernetesVersions(isUpdate, hasWindows, isAzureStackCloud), GetDefaultKubernetesVersion(hasWindows, isAzureStackCloud)
case DCOS:
return AllDCOSSupportedVersions, DCOSDefaultVersion
default:
return nil, ""
}

Просмотреть файл

@ -412,7 +412,7 @@ func Test_GetValidPatchVersion(t *testing.T) {
t.Errorf("It is not the default Kubernetes version")
}
v = GetValidPatchVersion(Mesos, "1.6.0", false, false, false)
v = GetValidPatchVersion("BogusOrchestrator", "1.6.0", false, false, false)
if v != "" {
t.Errorf("Expected empty version for unsupported orchType")
}
@ -445,7 +445,7 @@ func Test_GetValidPatchVersion(t *testing.T) {
t.Errorf("It is not the default Kubernetes version")
}
v = GetValidPatchVersion(Mesos, "1.6.0", false, false, true)
v = GetValidPatchVersion("BogusOrchestrator", "1.6.0", false, false, true)
if v != "" {
t.Errorf("Expected empty version for unsupported orchType")
}

Просмотреть файл

@ -5,16 +5,8 @@ package api
// the orchestrators supported by vlabs
const (
// Mesos is the string constant for MESOS orchestrator type
Mesos string = "Mesos"
// DCOS is the string constant for DCOS orchestrator type and defaults to DCOS188
DCOS string = "DCOS"
// Swarm is the string constant for the Swarm orchestrator type
Swarm string = "Swarm"
// Kubernetes is the string constant for the Kubernetes orchestrator type
Kubernetes string = "Kubernetes"
// SwarmMode is the string constant for the Swarm Mode orchestrator type
SwarmMode string = "SwarmMode"
)
// the OSTypes supported by vlabs
@ -39,14 +31,6 @@ const (
)
const (
// SwarmVersion is the Swarm orchestrator version
SwarmVersion = "swarm:1.1.0"
// SwarmDockerComposeVersion is the Docker Compose version
SwarmDockerComposeVersion = "1.6.2"
// DockerCEVersion is the DockerCE orchestrator version
DockerCEVersion = "17.03.*"
// DockerCEDockerComposeVersion is the Docker Compose version
DockerCEDockerComposeVersion = "1.14.0"
// KubernetesWindowsDockerVersion is the default version for docker on Windows nodes in kubernetes
KubernetesWindowsDockerVersion = "19.03.11"
// KubernetesDefaultWindowsSku is the default SKU for Windows VMs in kubernetes
@ -126,9 +110,6 @@ const (
Ephemeral = "Ephemeral"
)
// To identify programmatically generated public agent pools
const publicAgentPoolSuffix = "-public"
const (
// DefaultTillerAddonEnabled determines the aks-engine provided default for enabling tiller addon
DefaultTillerAddonEnabled = false
@ -329,11 +310,6 @@ const (
)
const (
//AzureEdgeDCOSBootstrapDownloadURL is the azure edge CDN download url
AzureEdgeDCOSBootstrapDownloadURL = "https://dcosio.azureedge.net/dcos/%s/bootstrap/%s.bootstrap.tar.xz"
//AzureChinaCloudDCOSBootstrapDownloadURL is the China specific DCOS package download url.
AzureChinaCloudDCOSBootstrapDownloadURL = "https://acsengine.blob.core.chinacloudapi.cn/dcos/%s.bootstrap.tar.xz"
//AzureEdgeDCOSWindowsBootstrapDownloadURL
DefaultMicrosoftAptRepositoryURL = "https://packages.microsoft.com"
)
@ -356,20 +332,6 @@ const (
)
const (
// DefaultMasterSubnet specifies the default master subnet for DCOS or Swarm
DefaultMasterSubnet = "172.16.0.0/24"
// DefaultFirstConsecutiveStaticIP specifies the static IP address on master 0 for DCOS or Swarm
DefaultFirstConsecutiveStaticIP = "172.16.0.5"
// DefaultSwarmWindowsMasterSubnet specifies the default master subnet for a Swarm Windows cluster
DefaultSwarmWindowsMasterSubnet = "192.168.255.0/24"
// DefaultSwarmWindowsFirstConsecutiveStaticIP specifies the static IP address on master 0 for a Swarm WIndows cluster
DefaultSwarmWindowsFirstConsecutiveStaticIP = "192.168.255.5"
// DefaultDCOSMasterSubnet specifies the default master subnet for a DCOS cluster
DefaultDCOSMasterSubnet = "192.168.255.0/24"
// DefaultDCOSFirstConsecutiveStaticIP specifies the static IP address on master 0 for a DCOS cluster
DefaultDCOSFirstConsecutiveStaticIP = "192.168.255.5"
// DefaultDCOSBootstrapStaticIP specifies the static IP address on bootstrap for a DCOS cluster
DefaultDCOSBootstrapStaticIP = "192.168.255.240"
// DefaultKubernetesMasterSubnet specifies the default subnet for masters and agents.
// Except when master VMSS is used, this specifies the default subnet for masters.
DefaultKubernetesMasterSubnet = "10.240.0.0/16"

Просмотреть файл

@ -46,12 +46,6 @@ func ConvertOrchestratorVersionProfileToVLabs(api *OrchestratorVersionProfile) *
switch api.OrchestratorType {
case Kubernetes:
vlabsProfile.OrchestratorType = vlabs.Kubernetes
case DCOS:
vlabsProfile.OrchestratorType = vlabs.DCOS
case Swarm:
vlabsProfile.OrchestratorType = vlabs.Swarm
case SwarmMode:
vlabsProfile.OrchestratorType = vlabs.SwarmMode
}
vlabsProfile.OrchestratorVersion = api.OrchestratorVersion
vlabsProfile.Default = api.Default
@ -242,41 +236,6 @@ func convertOrchestratorProfileToVLabs(api *OrchestratorProfile, o *vlabs.Orches
o.KubernetesConfig = &vlabs.KubernetesConfig{}
convertKubernetesConfigToVLabs(api.KubernetesConfig, o.KubernetesConfig)
}
if api.DcosConfig != nil {
o.DcosConfig = &vlabs.DcosConfig{}
convertDcosConfigToVLabs(api.DcosConfig, o.DcosConfig)
}
}
func convertDcosConfigToVLabs(api *DcosConfig, vl *vlabs.DcosConfig) {
vl.DcosBootstrapURL = api.DcosBootstrapURL
vl.DcosWindowsBootstrapURL = api.DcosWindowsBootstrapURL
if api.Registry != "" {
vl.Registry = api.Registry
}
if api.RegistryUser != "" {
vl.RegistryUser = api.RegistryUser
}
if api.RegistryPass != "" {
vl.RegistryPass = api.RegistryPass
}
vl.DcosRepositoryURL = api.DcosRepositoryURL
vl.DcosClusterPackageListID = api.DcosClusterPackageListID
vl.DcosProviderPackageID = api.DcosProviderPackageID
if api.BootstrapProfile != nil {
vl.BootstrapProfile = &vlabs.BootstrapProfile{
VMSize: api.BootstrapProfile.VMSize,
OSDiskSizeGB: api.BootstrapProfile.OSDiskSizeGB,
OAuthEnabled: api.BootstrapProfile.OAuthEnabled,
StaticIP: api.BootstrapProfile.StaticIP,
Subnet: api.BootstrapProfile.Subnet,
}
}
}
func convertKubernetesConfigToVLabs(apiCfg *KubernetesConfig, vlabsCfg *vlabs.KubernetesConfig) {
@ -747,22 +706,6 @@ func convertTelemetryProfileToVLabs(api *TelemetryProfile, vlabstp *vlabs.Teleme
func convertAzureEnvironmentSpecConfigToVLabs(api *AzureEnvironmentSpecConfig, vlabses *vlabs.AzureEnvironmentSpecConfig) {
vlabses.CloudName = api.CloudName
vlabses.DCOSSpecConfig = vlabs.DCOSSpecConfig{
DCOS188BootstrapDownloadURL: api.DCOSSpecConfig.DCOS188BootstrapDownloadURL,
DCOS190BootstrapDownloadURL: api.DCOSSpecConfig.DCOS190BootstrapDownloadURL,
DCOS198BootstrapDownloadURL: api.DCOSSpecConfig.DCOS198BootstrapDownloadURL,
DCOS110BootstrapDownloadURL: api.DCOSSpecConfig.DCOS110BootstrapDownloadURL,
DCOS111BootstrapDownloadURL: api.DCOSSpecConfig.DCOS111BootstrapDownloadURL,
DCOSWindowsBootstrapDownloadURL: api.DCOSSpecConfig.DCOSWindowsBootstrapDownloadURL,
DcosRepositoryURL: api.DCOSSpecConfig.DcosRepositoryURL,
DcosClusterPackageListID: api.DCOSSpecConfig.DcosClusterPackageListID,
DcosProviderPackageID: api.DCOSSpecConfig.DcosProviderPackageID,
}
vlabses.DockerSpecConfig = vlabs.DockerSpecConfig{
DockerEngineRepo: api.DockerSpecConfig.DockerEngineRepo,
DockerComposeDownloadURL: api.DockerSpecConfig.DockerComposeDownloadURL,
}
vlabses.EndpointConfig = vlabs.AzureEndpointConfig{
ResourceManagerVMDNSSuffix: api.EndpointConfig.ResourceManagerVMDNSSuffix,
}

Просмотреть файл

@ -183,11 +183,6 @@ func TestConvertAzureEnvironmentSpecConfigToVLabs(t *testing.T) {
AuthenticationMethod: ClientCertificateAuthMethod,
AzureEnvironmentSpecConfig: &AzureEnvironmentSpecConfig{
CloudName: "AzureStackCloud",
//DockerSpecConfig specify the docker engine download repo
DockerSpecConfig: DockerSpecConfig{
DockerEngineRepo: "DockerEngineRepo",
DockerComposeDownloadURL: "DockerComposeDownloadURL",
},
//KubernetesSpecConfig - Due to Chinese firewall issue, the default containers from google is blocked, use the Chinese local mirror instead
KubernetesSpecConfig: KubernetesSpecConfig{
AzureTelemetryPID: "AzureTelemetryPID",
@ -209,17 +204,6 @@ func TestConvertAzureEnvironmentSpecConfigToVLabs(t *testing.T) {
WindowsPauseImageURL: "WindowsPauseImageURL",
AlwaysPullWindowsPauseImage: true,
},
DCOSSpecConfig: DCOSSpecConfig{
DCOS188BootstrapDownloadURL: "DCOS188BootstrapDownloadURL",
DCOS190BootstrapDownloadURL: "DCOS190BootstrapDownloadURL",
DCOS198BootstrapDownloadURL: "DCOS198BootstrapDownloadURL",
DCOS110BootstrapDownloadURL: "DCOS110BootstrapDownloadURL",
DCOS111BootstrapDownloadURL: "DCOS111BootstrapDownloadURL",
DCOSWindowsBootstrapDownloadURL: "DCOSWindowsBootstrapDownloadURL",
DcosRepositoryURL: "DcosRepositoryURL",
DcosClusterPackageListID: "DcosClusterPackageListID",
DcosProviderPackageID: "DcosProviderPackageID",
},
EndpointConfig: AzureEndpointConfig{
ResourceManagerVMDNSSuffix: "ResourceManagerVMDNSSuffix",
},
@ -303,43 +287,6 @@ func TestConvertAzureEnvironmentSpecConfigToVLabs(t *testing.T) {
t.Errorf("incorrect AlwaysPullWindowsPauseImage, expect: '%t', actual: '%t'", csSpec.KubernetesSpecConfig.AlwaysPullWindowsPauseImage, vlabscsSpec.KubernetesSpecConfig.AlwaysPullWindowsPauseImage)
}
//DockerSpecConfig
if vlabscsSpec.DockerSpecConfig.DockerComposeDownloadURL != csSpec.DockerSpecConfig.DockerComposeDownloadURL {
t.Errorf("incorrect DockerComposeDownloadURL, expect: '%s', actual: '%s'", csSpec.DockerSpecConfig.DockerComposeDownloadURL, vlabscsSpec.DockerSpecConfig.DockerComposeDownloadURL)
}
if vlabscsSpec.DockerSpecConfig.DockerEngineRepo != csSpec.DockerSpecConfig.DockerEngineRepo {
t.Errorf("incorrect DockerEngineRepo, expect: '%s', actual: '%s'", csSpec.DockerSpecConfig.DockerEngineRepo, vlabscsSpec.DockerSpecConfig.DockerEngineRepo)
}
//DCOSSpecConfig
if vlabscsSpec.DCOSSpecConfig.DCOS188BootstrapDownloadURL != csSpec.DCOSSpecConfig.DCOS188BootstrapDownloadURL {
t.Errorf("incorrect DCOS188BootstrapDownloadURL, expect: '%s', actual: '%s'", csSpec.DCOSSpecConfig.DCOS188BootstrapDownloadURL, vlabscsSpec.DCOSSpecConfig.DCOS188BootstrapDownloadURL)
}
if vlabscsSpec.DCOSSpecConfig.DCOS190BootstrapDownloadURL != csSpec.DCOSSpecConfig.DCOS190BootstrapDownloadURL {
t.Errorf("incorrect DCOS190BootstrapDownloadURL, expect: '%s', actual: '%s'", csSpec.DCOSSpecConfig.DCOS190BootstrapDownloadURL, vlabscsSpec.DCOSSpecConfig.DCOS190BootstrapDownloadURL)
}
if vlabscsSpec.DCOSSpecConfig.DCOS198BootstrapDownloadURL != csSpec.DCOSSpecConfig.DCOS198BootstrapDownloadURL {
t.Errorf("incorrect DCOS198BootstrapDownloadURL, expect: '%s', actual: '%s'", csSpec.DCOSSpecConfig.DCOS198BootstrapDownloadURL, vlabscsSpec.DCOSSpecConfig.DCOS198BootstrapDownloadURL)
}
if vlabscsSpec.DCOSSpecConfig.DCOS110BootstrapDownloadURL != csSpec.DCOSSpecConfig.DCOS110BootstrapDownloadURL {
t.Errorf("incorrect DCOS110BootstrapDownloadURL, expect: '%s', actual: '%s'", csSpec.DCOSSpecConfig.DCOS110BootstrapDownloadURL, vlabscsSpec.DCOSSpecConfig.DCOS110BootstrapDownloadURL)
}
if vlabscsSpec.DCOSSpecConfig.DCOS111BootstrapDownloadURL != csSpec.DCOSSpecConfig.DCOS111BootstrapDownloadURL {
t.Errorf("incorrect DCOS111BootstrapDownloadURL, expect: '%s', actual: '%s'", csSpec.DCOSSpecConfig.DCOS111BootstrapDownloadURL, vlabscsSpec.DCOSSpecConfig.DCOS111BootstrapDownloadURL)
}
if vlabscsSpec.DCOSSpecConfig.DCOSWindowsBootstrapDownloadURL != csSpec.DCOSSpecConfig.DCOSWindowsBootstrapDownloadURL {
t.Errorf("incorrect DCOSWindowsBootstrapDownloadURL, expect: '%s', actual: '%s'", csSpec.DCOSSpecConfig.DCOSWindowsBootstrapDownloadURL, vlabscsSpec.DCOSSpecConfig.DCOSWindowsBootstrapDownloadURL)
}
if vlabscsSpec.DCOSSpecConfig.DcosRepositoryURL != csSpec.DCOSSpecConfig.DcosRepositoryURL {
t.Errorf("incorrect DcosRepositoryURL, expect: '%s', actual: '%s'", csSpec.DCOSSpecConfig.DcosRepositoryURL, vlabscsSpec.DCOSSpecConfig.DcosRepositoryURL)
}
if vlabscsSpec.DCOSSpecConfig.DcosClusterPackageListID != csSpec.DCOSSpecConfig.DcosClusterPackageListID {
t.Errorf("incorrect DcosClusterPackageListID, expect: '%s', actual: '%s'", csSpec.DCOSSpecConfig.DcosClusterPackageListID, vlabscsSpec.DCOSSpecConfig.DcosClusterPackageListID)
}
if vlabscsSpec.DCOSSpecConfig.DcosProviderPackageID != csSpec.DCOSSpecConfig.DcosProviderPackageID {
t.Errorf("incorrect DcosProviderPackageID, expect: '%s', actual: '%s'", csSpec.DCOSSpecConfig.DcosProviderPackageID, vlabscsSpec.DCOSSpecConfig.DcosProviderPackageID)
}
//EndpointConfig
if vlabscsSpec.EndpointConfig.ResourceManagerVMDNSSuffix != csSpec.EndpointConfig.ResourceManagerVMDNSSuffix {
t.Errorf("incorrect ResourceManagerVMDNSSuffix, expect: '%s', actual: '%s'", csSpec.EndpointConfig.ResourceManagerVMDNSSuffix, vlabscsSpec.EndpointConfig.ResourceManagerVMDNSSuffix)
@ -497,23 +444,7 @@ func getDefaultContainerService() *ContainerService {
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "Kubernetes",
OrchestratorVersion: "1.11.6",
DcosConfig: &DcosConfig{
DcosBootstrapURL: "SampleDcosBootstrapURL",
DcosWindowsBootstrapURL: "SampleWindowsDcosBootstrapURL",
Registry: "SampleRegistry",
RegistryPass: "SampleRegistryPass",
RegistryUser: "SampleRegistryUser",
DcosClusterPackageListID: "SampleDcosClusterPackageListID",
DcosProviderPackageID: "SampleDcosProviderPackageID",
BootstrapProfile: &BootstrapProfile{
VMSize: "Standard_Ds1_v1",
OSDiskSizeGB: 256,
OAuthEnabled: true,
StaticIP: "172.0.0.1",
Subnet: "255.255.255.0",
},
},
KubernetesConfig: &KubernetesConfig{},
KubernetesConfig: &KubernetesConfig{},
},
MasterProfile: &MasterProfile{
Count: 1,

Просмотреть файл

@ -248,54 +248,11 @@ func convertVLabsOrchestratorProfile(vp *vlabs.Properties, api *OrchestratorProf
isUpdate,
vp.HasWindows(),
vp.IsAzureStackCloud())
case DCOS:
if vlabscs.DcosConfig != nil {
api.DcosConfig = &DcosConfig{}
convertVLabsDcosConfig(vlabscs.DcosConfig, api.DcosConfig)
}
api.OrchestratorVersion = common.RationalizeReleaseAndVersion(
vlabscs.OrchestratorType,
vlabscs.OrchestratorRelease,
vlabscs.OrchestratorVersion,
isUpdate,
false,
false)
}
return nil
}
func convertVLabsDcosConfig(vlabs *vlabs.DcosConfig, api *DcosConfig) {
api.DcosBootstrapURL = vlabs.DcosBootstrapURL
api.DcosWindowsBootstrapURL = vlabs.DcosWindowsBootstrapURL
if len(vlabs.Registry) > 0 {
api.Registry = vlabs.Registry
}
if len(vlabs.RegistryUser) > 0 {
api.RegistryUser = vlabs.RegistryUser
}
if len(vlabs.RegistryPass) > 0 {
api.RegistryPass = vlabs.RegistryPass
}
api.DcosRepositoryURL = vlabs.DcosRepositoryURL
api.DcosClusterPackageListID = vlabs.DcosClusterPackageListID
api.DcosProviderPackageID = vlabs.DcosProviderPackageID
if vlabs.BootstrapProfile != nil {
api.BootstrapProfile = &BootstrapProfile{
VMSize: vlabs.BootstrapProfile.VMSize,
OSDiskSizeGB: vlabs.BootstrapProfile.OSDiskSizeGB,
OAuthEnabled: vlabs.BootstrapProfile.OAuthEnabled,
StaticIP: vlabs.BootstrapProfile.StaticIP,
Subnet: vlabs.BootstrapProfile.Subnet,
}
}
}
func convertVLabsKubernetesConfig(vlabs *vlabs.KubernetesConfig, api *KubernetesConfig) {
api.KubernetesImageBase = vlabs.KubernetesImageBase
api.KubernetesImageBaseType = vlabs.KubernetesImageBaseType
@ -749,30 +706,6 @@ func convertVLabsAADProfile(vlabs *vlabs.AADProfile, api *AADProfile) {
api.Authenticator = OIDC
}
func addDCOSPublicAgentPool(api *Properties) {
publicPool := &AgentPoolProfile{}
// tag this agent pool with a known suffix string
publicPool.Name = api.AgentPoolProfiles[0].Name + publicAgentPoolSuffix
// move DNS prefix to public pool
publicPool.DNSPrefix = api.AgentPoolProfiles[0].DNSPrefix
api.AgentPoolProfiles[0].DNSPrefix = ""
publicPool.VMSize = api.AgentPoolProfiles[0].VMSize // - use same VMsize for public pool
publicPool.OSType = api.AgentPoolProfiles[0].OSType // - use same OSType for public pool
api.AgentPoolProfiles[0].Ports = nil
for _, port := range [3]int{80, 443, 8080} {
publicPool.Ports = append(publicPool.Ports, port)
}
// - VM Count for public agents is based on the following:
// 1 master => 1 VM
// 3, 5 master => 3 VMsize
if api.MasterProfile.Count == 1 {
publicPool.Count = 1
} else {
publicPool.Count = 3
}
api.AgentPoolProfiles = append(api.AgentPoolProfiles, publicPool)
}
func convertVLabsCustomCloudProfile(vlabs *vlabs.CustomCloudProfile, api *CustomCloudProfile) {
if vlabs.Environment != nil {
api.Environment = &azure.Environment{}
@ -824,22 +757,6 @@ func convertVLabsTelemetryProfile(vlabs *vlabs.TelemetryProfile, api *TelemetryP
func convertAzureEnvironmentSpecConfig(vlabses *vlabs.AzureEnvironmentSpecConfig, api *AzureEnvironmentSpecConfig) {
api.CloudName = vlabses.CloudName
api.DCOSSpecConfig = DCOSSpecConfig{
DCOS188BootstrapDownloadURL: vlabses.DCOSSpecConfig.DCOS188BootstrapDownloadURL,
DCOS190BootstrapDownloadURL: vlabses.DCOSSpecConfig.DCOS190BootstrapDownloadURL,
DCOS198BootstrapDownloadURL: vlabses.DCOSSpecConfig.DCOS198BootstrapDownloadURL,
DCOS110BootstrapDownloadURL: vlabses.DCOSSpecConfig.DCOS110BootstrapDownloadURL,
DCOS111BootstrapDownloadURL: vlabses.DCOSSpecConfig.DCOS111BootstrapDownloadURL,
DCOSWindowsBootstrapDownloadURL: vlabses.DCOSSpecConfig.DCOSWindowsBootstrapDownloadURL,
DcosRepositoryURL: vlabses.DCOSSpecConfig.DcosRepositoryURL,
DcosClusterPackageListID: vlabses.DCOSSpecConfig.DcosClusterPackageListID,
DcosProviderPackageID: vlabses.DCOSSpecConfig.DcosProviderPackageID,
}
api.DockerSpecConfig = DockerSpecConfig{
DockerEngineRepo: vlabses.DockerSpecConfig.DockerEngineRepo,
DockerComposeDownloadURL: vlabses.DockerSpecConfig.DockerComposeDownloadURL,
}
api.EndpointConfig = AzureEndpointConfig{
ResourceManagerVMDNSSuffix: vlabses.EndpointConfig.ResourceManagerVMDNSSuffix,
}

Просмотреть файл

@ -17,74 +17,6 @@ import (
"github.com/google/go-cmp/cmp"
)
func TestAddDCOSPublicAgentPool(t *testing.T) {
expectedNumPools := 2
for _, masterCount := range [2]int{1, 3} {
profiles := []*AgentPoolProfile{}
profile := makeAgentPoolProfile(1, "agentprivate", "test-dcos-pool", "Standard_D2_v2", Linux)
profiles = append(profiles, profile)
master := makeMasterProfile(masterCount, "test-dcos", "Standard_D2_v2")
props := getProperties(profiles, master)
expectedPublicPoolName := props.AgentPoolProfiles[0].Name + publicAgentPoolSuffix
expectedPublicDNSPrefix := props.AgentPoolProfiles[0].DNSPrefix
expectedPrivateDNSPrefix := ""
expectedPublicOSType := props.AgentPoolProfiles[0].OSType
expectedPublicVMSize := props.AgentPoolProfiles[0].VMSize
addDCOSPublicAgentPool(props)
if len(props.AgentPoolProfiles) != expectedNumPools {
t.Fatalf("incorrect agent pools count. expected=%d actual=%d", expectedNumPools, len(props.AgentPoolProfiles))
}
if props.AgentPoolProfiles[1].Name != expectedPublicPoolName {
t.Fatalf("incorrect public pool name. expected=%s actual=%s", expectedPublicPoolName, props.AgentPoolProfiles[1].Name)
}
if props.AgentPoolProfiles[1].DNSPrefix != expectedPublicDNSPrefix {
t.Fatalf("incorrect public pool DNS prefix. expected=%s actual=%s", expectedPublicDNSPrefix, props.AgentPoolProfiles[1].DNSPrefix)
}
if props.AgentPoolProfiles[0].DNSPrefix != expectedPrivateDNSPrefix {
t.Fatalf("incorrect private pool DNS prefix. expected=%s actual=%s", expectedPrivateDNSPrefix, props.AgentPoolProfiles[0].DNSPrefix)
}
if props.AgentPoolProfiles[1].OSType != expectedPublicOSType {
t.Fatalf("incorrect public pool OS type. expected=%s actual=%s", expectedPublicOSType, props.AgentPoolProfiles[1].OSType)
}
if props.AgentPoolProfiles[1].VMSize != expectedPublicVMSize {
t.Fatalf("incorrect public pool VM size. expected=%s actual=%s", expectedPublicVMSize, props.AgentPoolProfiles[1].VMSize)
}
for i, port := range [3]int{80, 443, 8080} {
if props.AgentPoolProfiles[1].Ports[i] != port {
t.Fatalf("incorrect public pool port assignment. expected=%d actual=%d", port, props.AgentPoolProfiles[1].Ports[i])
}
}
if props.AgentPoolProfiles[1].Count != masterCount {
t.Fatalf("incorrect public pool VM size. expected=%d actual=%d", masterCount, props.AgentPoolProfiles[1].Count)
}
}
}
func makeAgentPoolProfile(count int, name, dNSPrefix, vMSize string, oSType OSType) *AgentPoolProfile {
return &AgentPoolProfile{
Name: name,
Count: count,
DNSPrefix: dNSPrefix,
OSType: oSType,
VMSize: vMSize,
}
}
func makeMasterProfile(count int, dNSPrefix, vMSize string) *MasterProfile {
return &MasterProfile{
Count: count,
DNSPrefix: dNSPrefix,
VMSize: vMSize,
}
}
func getProperties(profiles []*AgentPoolProfile, master *MasterProfile) *Properties {
return &Properties{
AgentPoolProfiles: profiles,
MasterProfile: master,
}
}
func TestKubernetesOrchestratorVersionFailWhenInvalid(t *testing.T) {
vlabscs := &vlabs.ContainerService{
Properties: &vlabs.Properties{
@ -356,11 +288,6 @@ func TestConvertAzureEnvironmentSpecConfig(t *testing.T) {
AuthenticationMethod: ClientSecretAuthMethod,
AzureEnvironmentSpecConfig: &vlabs.AzureEnvironmentSpecConfig{
CloudName: "AzureStackCloud",
//DockerSpecConfig specify the docker engine download repo
DockerSpecConfig: vlabs.DockerSpecConfig{
DockerEngineRepo: "DockerEngineRepo",
DockerComposeDownloadURL: "DockerComposeDownloadURL",
},
//KubernetesSpecConfig - Due to Chinese firewall issue, the default containers from google is blocked, use the Chinese local mirror instead
KubernetesSpecConfig: vlabs.KubernetesSpecConfig{
AzureTelemetryPID: "AzureTelemetryPID",
@ -383,17 +310,6 @@ func TestConvertAzureEnvironmentSpecConfig(t *testing.T) {
WindowsPauseImageURL: "WindowsPauseImageURL",
AlwaysPullWindowsPauseImage: true,
},
DCOSSpecConfig: vlabs.DCOSSpecConfig{
DCOS188BootstrapDownloadURL: "DCOS188BootstrapDownloadURL",
DCOS190BootstrapDownloadURL: "DCOS190BootstrapDownloadURL",
DCOS198BootstrapDownloadURL: "DCOS198BootstrapDownloadURL",
DCOS110BootstrapDownloadURL: "DCOS110BootstrapDownloadURL",
DCOS111BootstrapDownloadURL: "DCOS111BootstrapDownloadURL",
DCOSWindowsBootstrapDownloadURL: "DCOSWindowsBootstrapDownloadURL",
DcosRepositoryURL: "DcosRepositoryURL",
DcosClusterPackageListID: "DcosClusterPackageListID",
DcosProviderPackageID: "DcosProviderPackageID",
},
EndpointConfig: vlabs.AzureEndpointConfig{
ResourceManagerVMDNSSuffix: "ResourceManagerVMDNSSuffix",
},
@ -481,43 +397,6 @@ func TestConvertAzureEnvironmentSpecConfig(t *testing.T) {
t.Errorf("incorrect AlwaysPullWindowsPauseImage, expect: '%t', actual: '%t'", vlabscsSpec.KubernetesSpecConfig.AlwaysPullWindowsPauseImage, csSpec.KubernetesSpecConfig.AlwaysPullWindowsPauseImage)
}
//DockerSpecConfig
if csSpec.DockerSpecConfig.DockerComposeDownloadURL != vlabscsSpec.DockerSpecConfig.DockerComposeDownloadURL {
t.Errorf("incorrect DockerComposeDownloadURL, expect: '%s', actual: '%s'", vlabscsSpec.DockerSpecConfig.DockerComposeDownloadURL, csSpec.DockerSpecConfig.DockerComposeDownloadURL)
}
if csSpec.DockerSpecConfig.DockerEngineRepo != vlabscsSpec.DockerSpecConfig.DockerEngineRepo {
t.Errorf("incorrect DockerEngineRepo, expect: '%s', actual: '%s'", vlabscsSpec.DockerSpecConfig.DockerEngineRepo, csSpec.DockerSpecConfig.DockerEngineRepo)
}
//DCOSSpecConfig
if csSpec.DCOSSpecConfig.DCOS188BootstrapDownloadURL != vlabscsSpec.DCOSSpecConfig.DCOS188BootstrapDownloadURL {
t.Errorf("incorrect DCOS188BootstrapDownloadURL, expect: '%s', actual: '%s'", vlabscsSpec.DCOSSpecConfig.DCOS188BootstrapDownloadURL, csSpec.DCOSSpecConfig.DCOS188BootstrapDownloadURL)
}
if csSpec.DCOSSpecConfig.DCOS190BootstrapDownloadURL != vlabscsSpec.DCOSSpecConfig.DCOS190BootstrapDownloadURL {
t.Errorf("incorrect DCOS190BootstrapDownloadURL, expect: '%s', actual: '%s'", vlabscsSpec.DCOSSpecConfig.DCOS190BootstrapDownloadURL, csSpec.DCOSSpecConfig.DCOS190BootstrapDownloadURL)
}
if csSpec.DCOSSpecConfig.DCOS198BootstrapDownloadURL != vlabscsSpec.DCOSSpecConfig.DCOS198BootstrapDownloadURL {
t.Errorf("incorrect DCOS198BootstrapDownloadURL, expect: '%s', actual: '%s'", vlabscsSpec.DCOSSpecConfig.DCOS198BootstrapDownloadURL, csSpec.DCOSSpecConfig.DCOS198BootstrapDownloadURL)
}
if csSpec.DCOSSpecConfig.DCOS110BootstrapDownloadURL != vlabscsSpec.DCOSSpecConfig.DCOS110BootstrapDownloadURL {
t.Errorf("incorrect DCOS110BootstrapDownloadURL, expect: '%s', actual: '%s'", vlabscsSpec.DCOSSpecConfig.DCOS110BootstrapDownloadURL, csSpec.DCOSSpecConfig.DCOS110BootstrapDownloadURL)
}
if csSpec.DCOSSpecConfig.DCOS111BootstrapDownloadURL != vlabscsSpec.DCOSSpecConfig.DCOS111BootstrapDownloadURL {
t.Errorf("incorrect DCOS111BootstrapDownloadURL, expect: '%s', actual: '%s'", vlabscsSpec.DCOSSpecConfig.DCOS111BootstrapDownloadURL, csSpec.DCOSSpecConfig.DCOS111BootstrapDownloadURL)
}
if csSpec.DCOSSpecConfig.DCOSWindowsBootstrapDownloadURL != vlabscsSpec.DCOSSpecConfig.DCOSWindowsBootstrapDownloadURL {
t.Errorf("incorrect DCOSWindowsBootstrapDownloadURL, expect: '%s', actual: '%s'", vlabscsSpec.DCOSSpecConfig.DCOSWindowsBootstrapDownloadURL, csSpec.DCOSSpecConfig.DCOSWindowsBootstrapDownloadURL)
}
if csSpec.DCOSSpecConfig.DcosRepositoryURL != vlabscsSpec.DCOSSpecConfig.DcosRepositoryURL {
t.Errorf("incorrect DcosRepositoryURL, expect: '%s', actual: '%s'", vlabscsSpec.DCOSSpecConfig.DcosRepositoryURL, csSpec.DCOSSpecConfig.DcosRepositoryURL)
}
if csSpec.DCOSSpecConfig.DcosClusterPackageListID != vlabscsSpec.DCOSSpecConfig.DcosClusterPackageListID {
t.Errorf("incorrect DcosClusterPackageListID, expect: '%s', actual: '%s'", vlabscsSpec.DCOSSpecConfig.DcosClusterPackageListID, csSpec.DCOSSpecConfig.DcosClusterPackageListID)
}
if csSpec.DCOSSpecConfig.DcosProviderPackageID != vlabscsSpec.DCOSSpecConfig.DcosProviderPackageID {
t.Errorf("incorrect DcosProviderPackageID, expect: '%s', actual: '%s'", vlabscsSpec.DCOSSpecConfig.DcosProviderPackageID, csSpec.DCOSSpecConfig.DcosProviderPackageID)
}
//EndpointConfig
if csSpec.EndpointConfig.ResourceManagerVMDNSSuffix != vlabscsSpec.EndpointConfig.ResourceManagerVMDNSSuffix {
t.Errorf("incorrect ResourceManagerVMDNSSuffix, expect: '%s', actual: '%s'", vlabscsSpec.EndpointConfig.ResourceManagerVMDNSSuffix, csSpec.EndpointConfig.ResourceManagerVMDNSSuffix)
@ -560,23 +439,7 @@ func TestConvertVLabsContainerService(t *testing.T) {
Properties: &vlabs.Properties{
ProvisioningState: vlabs.Succeeded,
OrchestratorProfile: &vlabs.OrchestratorProfile{
OrchestratorType: DCOS,
DcosConfig: &vlabs.DcosConfig{
DcosBootstrapURL: "SampleDcosBootstrapURL",
DcosWindowsBootstrapURL: "SampleWindowsDcosBootstrapURL",
Registry: "SampleRegistry",
RegistryPass: "SampleRegistryPass",
RegistryUser: "SampleRegistryUser",
DcosClusterPackageListID: "SampleDcosClusterPackageListID",
DcosProviderPackageID: "SampleDcosProviderPackageID",
BootstrapProfile: &vlabs.BootstrapProfile{
VMSize: "Standard_Ds1_v1",
OSDiskSizeGB: 256,
OAuthEnabled: true,
StaticIP: "172.0.0.1",
Subnet: "255.255.255.0",
},
},
OrchestratorType: Kubernetes,
},
WindowsProfile: &vlabs.WindowsProfile{
AdminUsername: "sampleAdminUsername",
@ -704,7 +567,6 @@ func TestConvertVLabsContainerService(t *testing.T) {
//Test Vlabs with Kubernetes Orchestrator
vlabsCS.Properties.OrchestratorProfile.OrchestratorType = Kubernetes
vlabsCS.Properties.OrchestratorProfile.DcosConfig = nil
vlabsCS.Properties.OrchestratorProfile.KubernetesConfig = &vlabs.KubernetesConfig{
Addons: []vlabs.KubernetesAddon{
{
@ -779,23 +641,7 @@ func TestTelemetryEnabled(t *testing.T) {
Properties: &vlabs.Properties{
ProvisioningState: vlabs.Succeeded,
OrchestratorProfile: &vlabs.OrchestratorProfile{
OrchestratorType: DCOS,
DcosConfig: &vlabs.DcosConfig{
DcosBootstrapURL: "SampleDcosBootstrapURL",
DcosWindowsBootstrapURL: "SampleWindowsDcosBootstrapURL",
Registry: "SampleRegistry",
RegistryPass: "SampleRegistryPass",
RegistryUser: "SampleRegistryUser",
DcosClusterPackageListID: "SampleDcosClusterPackageListID",
DcosProviderPackageID: "SampleDcosProviderPackageID",
BootstrapProfile: &vlabs.BootstrapProfile{
VMSize: "Standard_Ds1_v1",
OSDiskSizeGB: 256,
OAuthEnabled: true,
StaticIP: "172.0.0.1",
Subnet: "255.255.255.0",
},
},
OrchestratorType: Kubernetes,
},
WindowsProfile: &vlabs.WindowsProfile{
AdminUsername: "sampleAdminUsername",

Просмотреть файл

@ -177,12 +177,6 @@ func (p *Properties) SetCustomCloudSpec(params AzureCustomCloudSpecParams) error
ascc := p.CustomCloudProfile.AzureEnvironmentSpecConfig
azureCustomCloudSpec.CloudName = helpers.EnsureString(ascc.CloudName, azureCustomCloudSpec.CloudName)
// DockerSpecConfig
asccDockerSpecConfig := ascc.DockerSpecConfig
azsDockerSpecConfig := azureCustomCloudSpec.DockerSpecConfig
azureCustomCloudSpec.DockerSpecConfig.DockerComposeDownloadURL = helpers.EnsureString(asccDockerSpecConfig.DockerComposeDownloadURL, azsDockerSpecConfig.DockerComposeDownloadURL)
azureCustomCloudSpec.DockerSpecConfig.DockerEngineRepo = helpers.EnsureString(asccDockerSpecConfig.DockerEngineRepo, azsDockerSpecConfig.DockerComposeDownloadURL)
//KubernetesSpecConfig
asccKubernetesSpecConfig := ascc.KubernetesSpecConfig
azsKubernetesSpecConfig := azureCustomCloudSpec.KubernetesSpecConfig

Просмотреть файл

@ -17,7 +17,6 @@ import (
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute"
"github.com/Azure/go-autorest/autorest/to"
"github.com/blang/semver"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
@ -53,7 +52,7 @@ func (cs *ContainerService) SetPropertiesDefaults(params PropertiesDefaultsParam
// Set master profile defaults if this cluster configuration includes master node(s)
if cs.Properties.MasterProfile != nil {
properties.setMasterProfileDefaults(params.IsUpgrade)
properties.setMasterProfileDefaults()
}
properties.setAgentProfileDefaults(params.IsUpgrade, params.IsScale)
@ -652,28 +651,6 @@ func (cs *ContainerService) setOrchestratorDefaults(isUpgrade, isScale bool) {
cs.setComponentsConfig(isUpgrade)
// Configure Linux kernel runtime values via sysctl.d
cs.setSysctlDConfig()
case DCOS:
if o.DcosConfig == nil {
o.DcosConfig = &DcosConfig{}
}
dcosSemVer, _ := semver.Make(o.OrchestratorVersion)
dcosBootstrapSemVer, _ := semver.Make(common.DCOSVersion1Dot11Dot0)
if !dcosSemVer.LT(dcosBootstrapSemVer) {
if o.DcosConfig.BootstrapProfile == nil {
o.DcosConfig.BootstrapProfile = &BootstrapProfile{}
}
if len(o.DcosConfig.BootstrapProfile.VMSize) == 0 {
o.DcosConfig.BootstrapProfile.VMSize = "Standard_D2s_v3"
}
}
if !cs.Properties.MasterProfile.IsCustomVNET() {
if cs.Properties.OrchestratorProfile.DcosConfig != nil && cs.Properties.OrchestratorProfile.DcosConfig.BootstrapProfile != nil {
if !isUpgrade || len(cs.Properties.OrchestratorProfile.DcosConfig.BootstrapProfile.StaticIP) == 0 {
cs.Properties.OrchestratorProfile.DcosConfig.BootstrapProfile.StaticIP = DefaultDCOSBootstrapStaticIP
}
}
}
}
}
@ -688,7 +665,7 @@ func (p *Properties) setExtensionDefaults() {
}
}
func (p *Properties) setMasterProfileDefaults(isUpgrade bool) {
func (p *Properties) setMasterProfileDefaults() {
// set default to VMAS for now
if p.MasterProfile.AvailabilityProfile == "" {
p.MasterProfile.AvailabilityProfile = AvailabilitySet
@ -709,31 +686,6 @@ func (p *Properties) setMasterProfileDefaults(isUpgrade bool) {
}
}
if !p.OrchestratorProfile.IsKubernetes() {
p.MasterProfile.Distro = Ubuntu
if !p.MasterProfile.IsCustomVNET() {
if p.OrchestratorProfile.OrchestratorType == DCOS {
p.MasterProfile.Subnet = DefaultDCOSMasterSubnet
// FirstConsecutiveStaticIP is not reset if it is upgrade and some value already exists
if !isUpgrade || len(p.MasterProfile.FirstConsecutiveStaticIP) == 0 {
p.MasterProfile.FirstConsecutiveStaticIP = DefaultDCOSFirstConsecutiveStaticIP
}
} else if p.HasWindows() {
p.MasterProfile.Subnet = DefaultSwarmWindowsMasterSubnet
// FirstConsecutiveStaticIP is not reset if it is upgrade and some value already exists
if !isUpgrade || len(p.MasterProfile.FirstConsecutiveStaticIP) == 0 {
p.MasterProfile.FirstConsecutiveStaticIP = DefaultSwarmWindowsFirstConsecutiveStaticIP
}
} else {
p.MasterProfile.Subnet = DefaultMasterSubnet
// FirstConsecutiveStaticIP is not reset if it is upgrade and some value already exists
if !isUpgrade || len(p.MasterProfile.FirstConsecutiveStaticIP) == 0 {
p.MasterProfile.FirstConsecutiveStaticIP = DefaultFirstConsecutiveStaticIP
}
}
}
}
if p.MasterProfile.HTTPSourceAddressPrefix == "" {
p.MasterProfile.HTTPSourceAddressPrefix = "*"
}

Просмотреть файл

@ -2341,45 +2341,6 @@ func TestDistroDefaults(t *testing.T) {
true,
AzurePublicCloud,
},
{
"default_swarm",
OrchestratorProfile{
OrchestratorType: Swarm,
},
"",
"",
Ubuntu,
Ubuntu,
false,
false,
AzurePublicCloud,
},
{
"default_swarmmode",
OrchestratorProfile{
OrchestratorType: SwarmMode,
},
"",
"",
Ubuntu,
Ubuntu,
false,
false,
AzurePublicCloud,
},
{
"default_dcos",
OrchestratorProfile{
OrchestratorType: DCOS,
},
"",
"",
Ubuntu,
Ubuntu,
false,
false,
AzurePublicCloud,
},
}
for _, test := range tests {
@ -3471,7 +3432,7 @@ func TestSetCertDefaults(t *testing.T) {
}
cs.setOrchestratorDefaults(false, false)
cs.Properties.setMasterProfileDefaults(false)
cs.Properties.setMasterProfileDefaults()
result, ips, err := cs.SetDefaultCerts(DefaultCertParams{
PkiKeySize: helpers.DefaultPkiKeySize,
})
@ -3539,7 +3500,7 @@ func TestSetCertDefaultsVMSS(t *testing.T) {
}
cs.setOrchestratorDefaults(false, false)
cs.Properties.setMasterProfileDefaults(false)
cs.Properties.setMasterProfileDefaults()
result, ips, err := cs.SetDefaultCerts(DefaultCertParams{
PkiKeySize: helpers.DefaultPkiKeySize,
})
@ -3718,11 +3679,6 @@ func TestSetCustomCloudProfileDefaults(t *testing.T) {
//Mock AzureEnvironmentSpecConfig
customCloudSpec := AzureEnvironmentSpecConfig{
CloudName: "AzuReStackCloud",
//DockerSpecConfig specify the docker engine download repo
DockerSpecConfig: DockerSpecConfig{
DockerEngineRepo: "DockerEngineRepo",
DockerComposeDownloadURL: "DockerComposeDownloadURL",
},
//KubernetesSpecConfig - Due to Chinese firewall issue, the default containers from google is blocked, use the Chinese local mirror instead
KubernetesSpecConfig: KubernetesSpecConfig{
AzureTelemetryPID: "AzureTelemetryPID",
@ -3745,7 +3701,6 @@ func TestSetCustomCloudProfileDefaults(t *testing.T) {
WindowsPauseImageURL: "WindowsPauseImageURL",
AlwaysPullWindowsPauseImage: true,
},
DCOSSpecConfig: DefaultDCOSSpecConfig,
EndpointConfig: AzureEndpointConfig{
ResourceManagerVMDNSSuffix: "ResourceManagerVMDNSSuffix",
},
@ -3787,10 +3742,6 @@ func TestSetCustomCloudProfileDefaults(t *testing.T) {
//Mock AzureEnvironmentSpecConfig
customCloudSpecP := AzureEnvironmentSpecConfig{
CloudName: "AzureStackCloud",
//DockerSpecConfig specify the docker engine download repo
DockerSpecConfig: DockerSpecConfig{
DockerEngineRepo: "DockerEngineRepo",
},
//KubernetesSpecConfig - Due to Chinese firewall issue, the default containers from google is blocked, use the Chinese local mirror instead
KubernetesSpecConfig: KubernetesSpecConfig{
KubernetesImageBase: "KubernetesImageBase",
@ -3808,7 +3759,6 @@ func TestSetCustomCloudProfileDefaults(t *testing.T) {
WindowsPauseImageURL: "WindowsPauseImageURL",
AlwaysPullWindowsPauseImage: true,
},
DCOSSpecConfig: DefaultDCOSSpecConfig,
EndpointConfig: AzureEndpointConfig{
ResourceManagerVMDNSSuffix: "ResourceManagerVMDNSSuffix",
},
@ -3833,9 +3783,6 @@ func TestSetCustomCloudProfileDefaults(t *testing.T) {
t.Errorf("expected no error from SetPropertiesDefaults, instead got %s", err)
}
if mockCSCustomP.Properties.CustomCloudProfile.AzureEnvironmentSpecConfig.DockerSpecConfig.DockerComposeDownloadURL != DefaultDockerSpecConfig.DockerComposeDownloadURL {
t.Errorf("setCustomCloudProfileDefaults(): did not set DockerComposeDownloadURL with default Value, got '%s', expected %s", mockCSCustomP.Properties.CustomCloudProfile.AzureEnvironmentSpecConfig.DockerSpecConfig.DockerComposeDownloadURL, DefaultDockerSpecConfig.DockerComposeDownloadURL)
}
if mockCSCustomP.Properties.CustomCloudProfile.AzureEnvironmentSpecConfig.KubernetesSpecConfig.ACIConnectorImageBase != DefaultKubernetesSpecConfig.ACIConnectorImageBase {
t.Errorf("setCustomCloudProfileDefaults(): did not set ACIConnectorImageBase with default Value, got '%s', expected %s", mockCSCustomP.Properties.CustomCloudProfile.AzureEnvironmentSpecConfig.KubernetesSpecConfig.ACIConnectorImageBase, DefaultKubernetesSpecConfig.ACIConnectorImageBase)
}

Просмотреть файл

@ -216,11 +216,8 @@ func GetMockPropertiesWithCustomCloudProfile(name string, hasCustomCloudProfile,
//azureStackCloudSpec is the default configurations for azure stack with public Azure.
azureStackCloudSpec := AzureEnvironmentSpecConfig{
CloudName: AzureStackCloud,
//DockerSpecConfig specify the docker engine download repo
DockerSpecConfig: DefaultDockerSpecConfig,
//KubernetesSpecConfig is the default kubernetes container image url.
KubernetesSpecConfig: DefaultKubernetesSpecConfig,
DCOSSpecConfig: DefaultDCOSSpecConfig,
EndpointConfig: AzureEndpointConfig{
ResourceManagerVMDNSSuffix: "",
},

Просмотреть файл

@ -22,21 +22,12 @@ var versionsMapAzureStack map[string][]string
func init() {
funcmap = map[string]orchestratorsFunc{
Kubernetes: kubernetesInfo,
DCOS: dcosInfo,
Swarm: swarmInfo,
SwarmMode: dockerceInfo,
}
versionsMap = map[string][]string{
Kubernetes: common.GetAllSupportedKubernetesVersions(true, false, false),
DCOS: common.GetAllSupportedDCOSVersions(),
Swarm: common.GetAllSupportedSwarmVersions(),
SwarmMode: common.GetAllSupportedDockerCEVersions(),
}
versionsMapAzureStack = map[string][]string{
Kubernetes: common.GetAllSupportedKubernetesVersions(true, false, true),
DCOS: common.GetAllSupportedDCOSVersions(),
Swarm: common.GetAllSupportedSwarmVersions(),
SwarmMode: common.GetAllSupportedDockerCEVersions(),
}
}
@ -44,12 +35,6 @@ func validate(orchestrator, version string) (string, error) {
switch {
case strings.EqualFold(orchestrator, Kubernetes):
return Kubernetes, nil
case strings.EqualFold(orchestrator, DCOS):
return DCOS, nil
case strings.EqualFold(orchestrator, Swarm):
return Swarm, nil
case strings.EqualFold(orchestrator, SwarmMode):
return SwarmMode, nil
case orchestrator == "":
if version != "" {
return "", errors.Errorf("Must specify orchestrator for version '%s'", version)
@ -122,7 +107,7 @@ func GetOrchestratorVersionProfile(orch *OrchestratorProfile, hasWindows bool, i
return nil, errors.New("Missing Orchestrator Version")
}
switch orch.OrchestratorType {
case Kubernetes, DCOS:
case Kubernetes:
arr, err := funcmap[orch.OrchestratorType](orch, hasWindows, isAzureStackCloud)
if err != nil {
return nil, err
@ -218,102 +203,3 @@ func getKubernetesAvailableUpgradeVersions(orchestratorVersion string, supported
return []string{}, nil
}
func dcosInfo(csOrch *OrchestratorProfile, hasWindows bool, isAzureStackCloud bool) ([]*OrchestratorVersionProfile, error) {
orchs := []*OrchestratorVersionProfile{}
if csOrch.OrchestratorVersion == "" {
// get info for all supported versions
for _, ver := range common.AllDCOSSupportedVersions {
upgrades := dcosUpgrades(&OrchestratorProfile{OrchestratorVersion: ver})
orchs = append(orchs,
&OrchestratorVersionProfile{
OrchestratorProfile: OrchestratorProfile{
OrchestratorType: DCOS,
OrchestratorVersion: ver,
},
Default: ver == common.DCOSDefaultVersion,
Upgrades: upgrades,
})
}
} else {
if !isVersionSupported(csOrch, false) {
return nil, errors.Errorf("DCOS version %s is not supported", csOrch.OrchestratorVersion)
}
// get info for the specified version
upgrades := dcosUpgrades(csOrch)
orchs = append(orchs,
&OrchestratorVersionProfile{
OrchestratorProfile: OrchestratorProfile{
OrchestratorType: DCOS,
OrchestratorVersion: csOrch.OrchestratorVersion,
},
Default: csOrch.OrchestratorVersion == common.DCOSDefaultVersion,
Upgrades: upgrades,
})
}
return orchs, nil
}
func dcosUpgrades(csOrch *OrchestratorProfile) []*OrchestratorProfile {
ret := []*OrchestratorProfile{}
if csOrch.OrchestratorVersion == common.DCOSVersion1Dot11Dot0 {
ret = append(ret, &OrchestratorProfile{
OrchestratorType: DCOS,
OrchestratorVersion: common.DCOSVersion1Dot11Dot2,
})
}
return ret
}
func swarmInfo(csOrch *OrchestratorProfile, hasWindows bool, isAzureStackCloud bool) ([]*OrchestratorVersionProfile, error) {
if csOrch.OrchestratorVersion == "" {
return []*OrchestratorVersionProfile{
{
OrchestratorProfile: OrchestratorProfile{
OrchestratorType: Swarm,
OrchestratorVersion: SwarmVersion,
},
},
}, nil
}
if !isVersionSupported(csOrch, false) {
return nil, errors.Errorf("Swarm version %s is not supported", csOrch.OrchestratorVersion)
}
return []*OrchestratorVersionProfile{
{
OrchestratorProfile: OrchestratorProfile{
OrchestratorType: Swarm,
OrchestratorVersion: csOrch.OrchestratorVersion,
},
},
}, nil
}
func dockerceInfo(csOrch *OrchestratorProfile, hasWindows bool, isAzureStackCloud bool) ([]*OrchestratorVersionProfile, error) {
if csOrch.OrchestratorVersion == "" {
return []*OrchestratorVersionProfile{
{
OrchestratorProfile: OrchestratorProfile{
OrchestratorType: SwarmMode,
OrchestratorVersion: DockerCEVersion,
},
},
}, nil
}
if !isVersionSupported(csOrch, false) {
return nil, errors.Errorf("Docker CE version %s is not supported", csOrch.OrchestratorVersion)
}
return []*OrchestratorVersionProfile{
{
OrchestratorProfile: OrchestratorProfile{
OrchestratorType: SwarmMode,
OrchestratorVersion: csOrch.OrchestratorVersion,
},
},
}, nil
}

Просмотреть файл

@ -113,91 +113,6 @@ func TestKubernetesInfo(t *testing.T) {
}
func TestDcosInfo(t *testing.T) {
RegisterTestingT(t)
invalid := []string{
"invalid number",
"invalid.number",
"a4.b7.c3",
"31.29.",
".17.02",
"43.156.89.",
"1.2.a"}
for _, v := range invalid {
csOrch := &OrchestratorProfile{
OrchestratorType: DCOS,
OrchestratorVersion: v,
}
_, e := dcosInfo(csOrch, false, false)
Expect(e).NotTo(BeNil())
}
// test good value
csOrch := &OrchestratorProfile{
OrchestratorType: DCOS,
OrchestratorVersion: common.DCOSDefaultVersion,
}
_, e := dcosInfo(csOrch, false, false)
Expect(e).To(BeNil())
}
func TestSwarmInfo(t *testing.T) {
RegisterTestingT(t)
invalid := []string{
"swarm:1.1.1",
"swarm:1.1.2",
}
for _, v := range invalid {
csOrch := &OrchestratorProfile{
OrchestratorType: Swarm,
OrchestratorVersion: v,
}
_, e := swarmInfo(csOrch, false, false)
Expect(e).NotTo(BeNil())
}
// test good value
csOrch := &OrchestratorProfile{
OrchestratorType: Swarm,
OrchestratorVersion: common.SwarmVersion,
}
_, e := swarmInfo(csOrch, false, false)
Expect(e).To(BeNil())
}
func TestDockerceInfoInfo(t *testing.T) {
RegisterTestingT(t)
invalid := []string{
"17.02.1",
"43.156.89",
}
for _, v := range invalid {
csOrch := &OrchestratorProfile{
OrchestratorType: SwarmMode,
OrchestratorVersion: v,
}
_, e := dockerceInfo(csOrch, false, false)
Expect(e).NotTo(BeNil())
}
// test good value
csOrch := &OrchestratorProfile{
OrchestratorType: SwarmMode,
OrchestratorVersion: common.DockerCEVersion,
}
_, e := dockerceInfo(csOrch, false, false)
Expect(e).To(BeNil())
}
func TestGetKubernetesAvailableUpgradeVersions(t *testing.T) {
RegisterTestingT(t)
cases := []struct {

Просмотреть файл

@ -199,7 +199,7 @@ const jsonWithTypo = `
"apiVersion": "ignored",
"properties": {
"orchestratorProfile": {
"orchestratorType": "DCOS"
"orchestratorType": "Kubernetes"
},
"masterProfile": {
"count": 1,

Просмотреть файл

@ -275,7 +275,6 @@ type OrchestratorProfile struct {
OrchestratorType string `json:"orchestratorType"`
OrchestratorVersion string `json:"orchestratorVersion"`
KubernetesConfig *KubernetesConfig `json:"kubernetesConfig,omitempty"`
DcosConfig *DcosConfig `json:"dcosConfig,omitempty"`
}
// OrchestratorVersionProfile contains information of a supported orchestrator version:
@ -547,29 +546,6 @@ type BootstrapProfile struct {
Subnet string `json:"subnet,omitempty"`
}
// DcosConfig Configuration for DC/OS
type DcosConfig struct {
DcosBootstrapURL string `json:"dcosBootstrapURL,omitempty"`
DcosWindowsBootstrapURL string `json:"dcosWindowsBootstrapURL,omitempty"`
Registry string `json:"registry,omitempty"`
RegistryUser string `json:"registryUser,omitempty"`
RegistryPass string `json:"registryPassword,omitempty"`
DcosRepositoryURL string `json:"dcosRepositoryURL,omitempty"` // For CI use, you need to specify
DcosClusterPackageListID string `json:"dcosClusterPackageListID,omitempty"` // all three of these items
DcosProviderPackageID string `json:"dcosProviderPackageID,omitempty"` // repo url is the location of the build,
BootstrapProfile *BootstrapProfile `json:"bootstrapProfile,omitempty"`
}
// HasPrivateRegistry returns if a private registry is specified
func (d *DcosConfig) HasPrivateRegistry() bool {
return len(d.Registry) > 0
}
// HasBootstrap returns if a bootstrap profile is specified
func (d *DcosConfig) HasBootstrap() bool {
return d.BootstrapProfile != nil
}
// MasterProfile represents the definition of the master cluster
type MasterProfile struct {
Count int `json:"count"`
@ -1917,28 +1893,11 @@ func (l *LinuxProfile) HasCustomNodesDNS() bool {
return false
}
// IsSwarmMode returns true if this template is for Swarm Mode orchestrator
func (o *OrchestratorProfile) IsSwarmMode() bool {
return o.OrchestratorType == SwarmMode
}
// IsKubernetes returns true if this template is for Kubernetes orchestrator
func (o *OrchestratorProfile) IsKubernetes() bool {
return o.OrchestratorType == Kubernetes
}
// IsDCOS returns true if this template is for DCOS orchestrator
func (o *OrchestratorProfile) IsDCOS() bool {
return o.OrchestratorType == DCOS
}
// IsDCOS19 returns true if this is a DCOS 1.9 orchestrator using the latest version
func (o *OrchestratorProfile) IsDCOS19() bool {
return o.OrchestratorType == DCOS &&
(o.OrchestratorVersion == common.DCOSVersion1Dot9Dot0 ||
o.OrchestratorVersion == common.DCOSVersion1Dot9Dot8)
}
// IsAzureCNI returns true if Azure CNI network plugin is enabled
func (o *OrchestratorProfile) IsAzureCNI() bool {
if o.KubernetesConfig != nil {

Просмотреть файл

@ -3244,14 +3244,6 @@ func TestRequireRouteTable(t *testing.T) {
p Properties
expected bool
}{
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: DCOS,
},
},
expected: false,
},
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
@ -3310,14 +3302,6 @@ func TestIsPrivateCluster(t *testing.T) {
p Properties
expected bool
}{
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: DCOS,
},
},
expected: false,
},
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
@ -3406,14 +3390,6 @@ func TestIsHostsConfigAgentEnabled(t *testing.T) {
p Properties
expected bool
}{
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: DCOS,
},
},
expected: false,
},
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
@ -3471,106 +3447,22 @@ func TestIsHostsConfigAgentEnabled(t *testing.T) {
func TestOrchestrator(t *testing.T) {
cases := []struct {
p Properties
expectedIsDCOS bool
expectedIsKubernetes bool
expectedIsSwarmMode bool
}{
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: DCOS,
},
},
expectedIsDCOS: true,
expectedIsKubernetes: false,
expectedIsSwarmMode: false,
},
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
},
},
expectedIsDCOS: false,
expectedIsKubernetes: true,
expectedIsSwarmMode: false,
},
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: SwarmMode,
},
},
expectedIsDCOS: false,
expectedIsKubernetes: false,
expectedIsSwarmMode: true,
},
}
for _, c := range cases {
if c.expectedIsDCOS != c.p.OrchestratorProfile.IsDCOS() {
t.Fatalf("Expected IsDCOS() to be %t with OrchestratorType=%s", c.expectedIsDCOS, c.p.OrchestratorProfile.OrchestratorType)
}
if c.expectedIsKubernetes != c.p.OrchestratorProfile.IsKubernetes() {
t.Fatalf("Expected IsKubernetes() to be %t with OrchestratorType=%s", c.expectedIsKubernetes, c.p.OrchestratorProfile.OrchestratorType)
}
if c.expectedIsSwarmMode != c.p.OrchestratorProfile.IsSwarmMode() {
t.Fatalf("Expected IsSwarmMode() to be %t with OrchestratorType=%s", c.expectedIsSwarmMode, c.p.OrchestratorProfile.OrchestratorType)
}
}
}
func TestIsDCOS19(t *testing.T) {
cases := []struct {
p Properties
expectedIsDCOS19 bool
}{
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: DCOS,
OrchestratorVersion: common.DCOSVersion1Dot9Dot8,
},
},
expectedIsDCOS19: true,
},
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: DCOS,
OrchestratorVersion: "1.9.7",
},
},
expectedIsDCOS19: false,
},
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: DCOS,
},
},
expectedIsDCOS19: false,
},
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{},
},
expectedIsDCOS19: false,
},
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
},
},
expectedIsDCOS19: false,
},
}
for _, c := range cases {
if c.expectedIsDCOS19 != c.p.OrchestratorProfile.IsDCOS19() {
t.Fatalf("Expected IsDCOS19() to be %t got %t", c.expectedIsDCOS19, c.p.OrchestratorProfile.IsDCOS19())
}
}
}
@ -7082,85 +6974,6 @@ func TestAADAdminGroupIDMethods(t *testing.T) {
}
}
func TestDcosConfigHasPrivateRegistry(t *testing.T) {
cases := []struct {
p Properties
expected bool
}{
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: DCOS,
DcosConfig: &DcosConfig{
Registry: "my-custom-registry",
},
},
},
expected: true,
},
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: DCOS,
DcosConfig: &DcosConfig{
Registry: "",
},
},
},
expected: false,
},
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: DCOS,
DcosConfig: &DcosConfig{},
},
},
expected: false,
},
}
for _, c := range cases {
if c.p.OrchestratorProfile.DcosConfig.HasPrivateRegistry() != c.expected {
t.Fatalf("expected HasPrivateRegistry() to return %t but instead got %t", c.expected, c.p.OrchestratorProfile.DcosConfig.HasPrivateRegistry())
}
}
}
func TestDcosConfigHasBootstrap(t *testing.T) {
cases := []struct {
p Properties
expected bool
}{
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: DCOS,
DcosConfig: &DcosConfig{},
},
},
expected: false,
},
{
p: Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: DCOS,
DcosConfig: &DcosConfig{
BootstrapProfile: &BootstrapProfile{},
},
},
},
expected: true,
},
}
for _, c := range cases {
if c.p.OrchestratorProfile.DcosConfig.HasBootstrap() != c.expected {
t.Fatalf("expected HasBootstrap() to return %t but instead got %t", c.expected, c.p.OrchestratorProfile.DcosConfig.HasBootstrap())
}
}
}
func TestKubernetesAddonIsEnabled(t *testing.T) {
cases := []struct {
a *KubernetesAddon

Просмотреть файл

@ -6,32 +6,11 @@ package vlabs
//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"`

Просмотреть файл

@ -10,14 +10,8 @@ const (
// the orchestrators supported by vlabs
const (
// DCOS is the string constant for DCOS orchestrator type and defaults to DCOS188
DCOS string = "DCOS"
// Swarm is the string constant for the Swarm orchestrator type
Swarm string = "Swarm"
// Kubernetes is the string constant for the Kubernetes orchestrator type
Kubernetes string = "Kubernetes"
// SwarmMode is the string constant for the Swarm Mode orchestrator type
SwarmMode string = "SwarmMode"
)
// the OSTypes supported by vlabs

Просмотреть файл

@ -226,7 +226,6 @@ type OrchestratorProfile struct {
OrchestratorRelease string `json:"orchestratorRelease,omitempty"`
OrchestratorVersion string `json:"orchestratorVersion,omitempty"`
KubernetesConfig *KubernetesConfig `json:"kubernetesConfig,omitempty"`
DcosConfig *DcosConfig `json:"dcosConfig,omitempty"`
}
// UnmarshalJSON unmarshal json using the default behavior
@ -242,14 +241,8 @@ func (o *OrchestratorProfile) UnmarshalJSON(b []byte) error {
// Unmarshal OrchestratorType, format it as well
orchestratorType := o.OrchestratorType
switch {
case strings.EqualFold(orchestratorType, DCOS):
o.OrchestratorType = DCOS
case strings.EqualFold(orchestratorType, Swarm):
o.OrchestratorType = Swarm
case strings.EqualFold(orchestratorType, Kubernetes):
o.OrchestratorType = Kubernetes
case strings.EqualFold(orchestratorType, SwarmMode):
o.OrchestratorType = SwarmMode
default:
return errors.Errorf("OrchestratorType has unknown orchestrator: %s", orchestratorType)
}
@ -426,19 +419,6 @@ type BootstrapProfile struct {
Subnet string `json:"subnet,omitempty"`
}
// DcosConfig Configuration for DC/OS
type DcosConfig struct {
DcosBootstrapURL string `json:"dcosBootstrapURL,omitempty"`
DcosWindowsBootstrapURL string `json:"dcosWindowsBootstrapURL,omitempty"`
Registry string `json:"registry,omitempty"`
RegistryUser string `json:"registryUser,omitempty"`
RegistryPass string `json:"registryPassword,omitempty"`
DcosRepositoryURL string `json:"dcosRepositoryURL,omitempty"` // For CI use, you need to specify
DcosClusterPackageListID string `json:"dcosClusterPackageListID,omitempty"` // all three of these items
DcosProviderPackageID string `json:"dcosProviderPackageID,omitempty"` // repo url is the location of the build,
BootstrapProfile *BootstrapProfile `json:"bootstrapProfile,omitempty"`
}
// MasterProfile represents the definition of the master cluster
type MasterProfile struct {
Count int `json:"count" validate:"required,eq=1|eq=3|eq=5"`
@ -979,11 +959,6 @@ func (w *WindowsProfile) IsCSIProxyEnabled() bool {
return common.DefaultEnableCSIProxyWindows
}
// IsSwarmMode returns true if this template is for Swarm Mode orchestrator
func (o *OrchestratorProfile) IsSwarmMode() bool {
return o.OrchestratorType == SwarmMode
}
// RequiresDocker returns if the kubernetes settings require docker binary to be installed.
func (k *KubernetesConfig) RequiresDocker() bool {
runtime := strings.ToLower(k.ContainerRuntime)

Просмотреть файл

@ -21,25 +21,20 @@ func TestOrchestratorProfile(t *testing.T) {
OrchestratorProfileText = `{ "orchestratorType": "Swarm" }`
op = &OrchestratorProfile{}
if e := json.Unmarshal([]byte(OrchestratorProfileText), op); e != nil {
t.Fatalf("unexpectedly detected unmarshal failure for OrchestratorProfile, %+v", e)
if e := json.Unmarshal([]byte(OrchestratorProfileText), op); e == nil {
t.Fatalf("expected unmarshal failure for OrchestratorProfile when passing an invalid orchestratorType")
}
OrchestratorProfileText = `{ "orchestratorType": "SwarmMode" }`
op = &OrchestratorProfile{}
if e := json.Unmarshal([]byte(OrchestratorProfileText), op); e != nil {
t.Fatalf("unexpectedly detected unmarshal failure for OrchestratorProfile, %+v", e)
}
if !op.IsSwarmMode() {
t.Fatalf("unexpectedly detected OrchestratorProfile.Type != DockerCE after unmarshal")
if e := json.Unmarshal([]byte(OrchestratorProfileText), op); e == nil {
t.Fatalf("expected unmarshal failure for OrchestratorProfile when passing an invalid orchestratorType")
}
OrchestratorProfileText = `{ "orchestratorType": "DCOS" }`
op = &OrchestratorProfile{}
if e := json.Unmarshal([]byte(OrchestratorProfileText), op); e != nil {
t.Fatalf("unexpectedly detected unmarshal failure for OrchestratorProfile, %+v", e)
if e := json.Unmarshal([]byte(OrchestratorProfileText), op); e == nil {
t.Fatalf("expected unmarshal failure for OrchestratorProfile when passing an invalid orchestratorType")
}
OrchestratorProfileText = `{ "orchestratorType": "Kubernetes" }`

Просмотреть файл

@ -188,27 +188,6 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error {
// On updates we only need to make sure there is a supported patch version for the minor version
if !isUpdate {
switch o.OrchestratorType {
case DCOS:
version := common.RationalizeReleaseAndVersion(
o.OrchestratorType,
o.OrchestratorRelease,
o.OrchestratorVersion,
isUpdate,
false,
false)
if version == "" {
return errors.Errorf("the following OrchestratorProfile configuration is not supported: OrchestratorType: %s, OrchestratorRelease: %s, OrchestratorVersion: %s. Please check supported Release or Version for this build of aks-engine", o.OrchestratorType, o.OrchestratorRelease, o.OrchestratorVersion)
}
if o.DcosConfig != nil && o.DcosConfig.BootstrapProfile != nil {
if len(o.DcosConfig.BootstrapProfile.StaticIP) > 0 {
if net.ParseIP(o.DcosConfig.BootstrapProfile.StaticIP) == nil {
return errors.Errorf("DcosConfig.BootstrapProfile.StaticIP '%s' is an invalid IP address",
o.DcosConfig.BootstrapProfile.StaticIP)
}
}
}
case Swarm:
case SwarmMode:
case Kubernetes:
version := common.RationalizeReleaseAndVersion(
o.OrchestratorType,
@ -383,7 +362,7 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error {
}
} else {
switch o.OrchestratorType {
case DCOS, Kubernetes:
case Kubernetes:
version := common.RationalizeReleaseAndVersion(
o.OrchestratorType,
@ -414,10 +393,6 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error {
return errors.Errorf("KubernetesConfig can be specified only when OrchestratorType is Kubernetes")
}
if o.OrchestratorType != DCOS && o.DcosConfig != nil && (*o.DcosConfig != DcosConfig{}) {
return errors.Errorf("DcosConfig can be specified only when OrchestratorType is DCOS")
}
return a.validateContainerRuntime(isUpdate)
}
@ -1059,10 +1034,7 @@ func (a *AgentPoolProfile) validateStorageProfile(orchestratorType string) error
/* this switch statement is left to protect newly added orchestrators until they support Managed Disks*/
if a.StorageProfile == ManagedDisks {
switch orchestratorType {
case DCOS:
case Swarm:
case Kubernetes:
case SwarmMode:
default:
return errors.Errorf("HA volumes are currently unsupported for Orchestrator %s", orchestratorType)
}
@ -1072,9 +1044,6 @@ func (a *AgentPoolProfile) validateStorageProfile(orchestratorType string) error
switch orchestratorType {
case Kubernetes:
break
case DCOS:
case Swarm:
case SwarmMode:
default:
return errors.Errorf("Ephemeral volumes are currently unsupported for Orchestrator %s", orchestratorType)
}
@ -1086,7 +1055,6 @@ func (a *AgentPoolProfile) validateStorageProfile(orchestratorType string) error
func (a *AgentPoolProfile) validateCustomNodeLabels(orchestratorType string) error {
if len(a.CustomNodeLabels) > 0 {
switch orchestratorType {
case DCOS:
case Kubernetes:
for k, v := range a.CustomNodeLabels {
if e := validateKubernetesLabelKey(k); e != nil {
@ -1097,7 +1065,7 @@ func (a *AgentPoolProfile) validateCustomNodeLabels(orchestratorType string) err
}
}
default:
return errors.New("Agent CustomNodeLabels are only supported for DCOS and Kubernetes")
return errors.New("Agent CustomNodeLabels are only supported for Kubernetes")
}
}
return nil
@ -1163,9 +1131,6 @@ func (a *Properties) validateWindowsProfile(isUpdate bool) error {
// I am leaving this in because I cannot get a clear answer on if we need to continue supporting Swarm + Windows and
// RationalizeReleaseAndVersion does not properly handle Swarm.
switch o.OrchestratorType {
case DCOS:
case Swarm:
case SwarmMode:
case Kubernetes:
version = common.RationalizeReleaseAndVersion(
o.OrchestratorType,

Просмотреть файл

@ -46,13 +46,13 @@ func Test_OrchestratorProfile_Validate(t *testing.T) {
"should error when KubernetesConfig populated for non-Kubernetes OrchestratorType": {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "DCOS",
OrchestratorType: "Bogus",
KubernetesConfig: &KubernetesConfig{
ClusterSubnet: "10.0.0.0/16",
},
},
},
expectedError: "KubernetesConfig can be specified only when OrchestratorType is Kubernetes",
expectedError: "OrchestratorProfile has unknown orchestrator: Bogus",
},
"should error when KubernetesConfig has invalid etcd version": {
properties: &Properties{
@ -206,55 +206,9 @@ func Test_OrchestratorProfile_Validate(t *testing.T) {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "Kubernetes",
DcosConfig: &DcosConfig{},
},
},
},
"should error when DcosConfig orchestrator has invalid configuration": {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "DCOS",
OrchestratorVersion: "1.12.0",
},
},
expectedError: "the following OrchestratorProfile configuration is not supported: OrchestratorType: DCOS, OrchestratorRelease: , OrchestratorVersion: 1.12.0. Please check supported Release or Version for this build of aks-engine",
},
"should error when DcosConfig orchestrator configuration has invalid static IP": {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "DCOS",
DcosConfig: &DcosConfig{
BootstrapProfile: &BootstrapProfile{
StaticIP: "0.0.0.0.0.0",
},
},
},
},
expectedError: "DcosConfig.BootstrapProfile.StaticIP '0.0.0.0.0.0' is an invalid IP address",
},
"should error when DcosConfig populated for non-Kubernetes OrchestratorType 1": {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "Kubernetes",
DcosConfig: &DcosConfig{
DcosWindowsBootstrapURL: "http://www.microsoft.com",
},
},
},
expectedError: "DcosConfig can be specified only when OrchestratorType is DCOS",
},
"should error when DcosConfig populated for non-Kubernetes OrchestratorType 2": {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "Kubernetes",
DcosConfig: &DcosConfig{
DcosWindowsBootstrapURL: "http://www.microsoft.com",
DcosBootstrapURL: "http://www.microsoft.com",
},
},
},
expectedError: "DcosConfig can be specified only when OrchestratorType is DCOS",
},
"kubernetes should have failed on old patch version": {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
@ -1649,7 +1603,7 @@ func Test_AadProfile_Validate(t *testing.T) {
t.Parallel()
cs := getK8sDefaultContainerService(false)
cs.Properties.OrchestratorProfile = &OrchestratorProfile{
OrchestratorType: DCOS,
OrchestratorType: "DCOS",
}
cs.Properties.AADProfile = &AADProfile{
ClientAppID: "92444486-5bc3-4291-818b-d53ae480991b",
@ -4256,15 +4210,15 @@ func TestValidateProperties_CustomNodeLabels(t *testing.T) {
}
})
t.Run("Should not support orchestratorTypes other than Kubernetes/DCOS", func(t *testing.T) {
t.Run("Should not support orchestratorTypes other than Kubernetes", func(t *testing.T) {
t.Parallel()
cs := getK8sDefaultContainerService(false)
cs.Properties.OrchestratorProfile.OrchestratorType = SwarmMode
cs.Properties.OrchestratorProfile.OrchestratorType = "Mesos"
agentPoolProfiles := cs.Properties.AgentPoolProfiles
agentPoolProfiles[0].CustomNodeLabels = map[string]string{
"foo": "bar",
}
expectedMsg := "Agent CustomNodeLabels are only supported for DCOS and Kubernetes"
expectedMsg := "Agent CustomNodeLabels are only supported for Kubernetes"
if err := cs.Properties.validateAgentPoolProfiles(true); err.Error() != expectedMsg {
t.Errorf("expected error with message : %s, but got %s", expectedMsg, err.Error())
}
@ -5446,7 +5400,7 @@ func TestValidateAzureStackSupport(t *testing.T) {
break
}
}
cs.Properties.OrchestratorProfile.OrchestratorVersion = "1.16.11"
cs.Properties.OrchestratorProfile.OrchestratorVersion = "1.16.13"
if err := cs.Validate(false); !helpers.EqualError(err, test.expectedErr) {
t.Logf("scenario %q", test.name)
t.Logf("FIXME: expected error: %v, got: %v", test.expectedErr, err)

Просмотреть файл

@ -4,16 +4,8 @@
package engine
const (
// Mesos is the string constant for MESOS orchestrator type
Mesos string = "Mesos"
// DCOS is the string constant for DCOS orchestrator type and defaults to DCOS188
DCOS string = "DCOS"
// Swarm is the string constant for the Swarm orchestrator type
Swarm string = "Swarm"
// Kubernetes is the string constant for the Kubernetes orchestrator type
Kubernetes string = "Kubernetes"
// SwarmMode is the string constant for the Swarm Mode orchestrator type
SwarmMode string = "SwarmMode"
)
const (
@ -135,60 +127,14 @@ const (
)
const (
dcosCustomData188 = "dcos/dcoscustomdata188.t"
dcosCustomData190 = "dcos/dcoscustomdata190.t"
dcosCustomData198 = "dcos/dcoscustomdata198.t"
dcosCustomData110 = "dcos/dcoscustomdata110.t"
dcosProvision = "dcos/dcosprovision.sh"
dcosWindowsProvision = "dcos/dcosWindowsProvision.ps1"
dcosProvisionSource = "dcos/dcosprovisionsource.sh"
dcos2Provision = "dcos/bstrap/dcosprovision.sh"
dcos2BootstrapProvision = "dcos/bstrap/bootstrapprovision.sh"
dcos2CustomData1110 = "dcos/bstrap/dcos1.11.0.customdata.t"
dcos2CustomData1112 = "dcos/bstrap/dcos1.11.2.customdata.t"
)
const (
swarmProvision = "swarm/configure-swarm-cluster.sh"
swarmWindowsProvision = "swarm/Install-ContainerHost-And-Join-Swarm.ps1"
swarmModeProvision = "swarm/configure-swarmmode-cluster.sh"
swarmModeWindowsProvision = "swarm/Join-SwarmMode-cluster.ps1"
)
const (
agentOutputs = "agentoutputs.t"
agentParams = "agentparams.t"
armParameters = "k8s/armparameters.t"
dcosAgentResourcesVMAS = "dcos/dcosagentresourcesvmas.t"
dcosWindowsAgentResourcesVMAS = "dcos/dcosWindowsAgentResourcesVmas.t"
dcosAgentResourcesVMSS = "dcos/dcosagentresourcesvmss.t"
dcosWindowsAgentResourcesVMSS = "dcos/dcosWindowsAgentResourcesVmss.t"
dcosAgentVars = "dcos/dcosagentvars.t"
dcosBaseFile = "dcos/dcosbase.t"
dcosParams = "dcos/dcosparams.t"
dcosMasterResources = "dcos/dcosmasterresources.t"
dcosMasterVars = "dcos/dcosmastervars.t"
dcos2BaseFile = "dcos/bstrap/dcosbase.t"
dcos2BootstrapVars = "dcos/bstrap/bootstrapvars.t"
dcos2BootstrapParams = "dcos/bstrap/bootstrapparams.t"
dcos2BootstrapResources = "dcos/bstrap/bootstrapresources.t"
dcos2BootstrapCustomdata = "dcos/bstrap/bootstrapcustomdata.yml"
dcos2MasterVars = "dcos/bstrap/dcosmastervars.t"
dcos2MasterResources = "dcos/bstrap/dcosmasterresources.t"
iaasOutputs = "iaasoutputs.t"
kubernetesParams = "k8s/kubernetesparams.t"
masterOutputs = "masteroutputs.t"
masterParams = "masterparams.t"
swarmBaseFile = "swarm/swarmbase.t"
swarmParams = "swarm/swarmparams.t"
swarmAgentResourcesVMAS = "swarm/swarmagentresourcesvmas.t"
swarmAgentResourcesVMSS = "swarm/swarmagentresourcesvmss.t"
swarmAgentVars = "swarm/swarmagentvars.t"
swarmMasterResources = "swarm/swarmmasterresources.t"
swarmMasterVars = "swarm/swarmmastervars.t"
swarmWinAgentResourcesVMAS = "swarm/swarmwinagentresourcesvmas.t"
swarmWinAgentResourcesVMSS = "swarm/swarmwinagentresourcesvmss.t"
windowsParams = "windowsparams.t"
agentOutputs = "agentoutputs.t"
agentParams = "agentparams.t"
armParameters = "k8s/armparameters.t"
iaasOutputs = "iaasoutputs.t"
kubernetesParams = "k8s/kubernetesparams.t"
masterOutputs = "masteroutputs.t"
masterParams = "masterparams.t"
windowsParams = "windowsparams.t"
)
// addons source and destination file references

Просмотреть файл

@ -30,11 +30,7 @@ import (
)
var commonTemplateFiles = []string{agentOutputs, agentParams, masterOutputs, iaasOutputs, masterParams, windowsParams}
var dcosTemplateFiles = []string{dcosBaseFile, dcosAgentResourcesVMAS, dcosAgentResourcesVMSS, dcosAgentVars, dcosMasterResources, dcosMasterVars, dcosParams, dcosWindowsAgentResourcesVMAS, dcosWindowsAgentResourcesVMSS}
var dcos2TemplateFiles = []string{dcos2BaseFile, dcosAgentResourcesVMAS, dcosAgentResourcesVMSS, dcosAgentVars, dcos2MasterResources, dcos2BootstrapResources, dcos2MasterVars, dcosParams, dcosWindowsAgentResourcesVMAS, dcosWindowsAgentResourcesVMSS, dcos2BootstrapVars, dcos2BootstrapParams}
var kubernetesParamFiles = []string{armParameters, kubernetesParams, masterParams, agentParams, windowsParams}
var swarmTemplateFiles = []string{swarmBaseFile, swarmParams, swarmAgentResourcesVMAS, swarmAgentVars, swarmAgentResourcesVMSS, swarmBaseFile, swarmMasterResources, swarmMasterVars, swarmWinAgentResourcesVMAS, swarmWinAgentResourcesVMSS}
var swarmModeTemplateFiles = []string{swarmBaseFile, swarmParams, swarmAgentResourcesVMAS, swarmAgentVars, swarmAgentResourcesVMSS, swarmBaseFile, swarmMasterResources, swarmMasterVars, swarmWinAgentResourcesVMAS, swarmWinAgentResourcesVMSS}
var keyvaultSecretPathRe *regexp.Regexp
@ -103,15 +99,13 @@ func GenerateKubeConfig(properties *api.Properties, location string) (string, er
// validateDistro checks if the requested orchestrator type is supported on the requested Linux distro.
func validateDistro(cs *api.ContainerService) bool {
// Check Master distro
if cs.Properties.MasterProfile != nil && cs.Properties.MasterProfile.Distro == api.RHEL &&
(cs.Properties.OrchestratorProfile.OrchestratorType != api.SwarmMode) {
if cs.Properties.MasterProfile != nil && cs.Properties.MasterProfile.Distro == api.RHEL {
log.Printf("Orchestrator type %s not suported on RHEL Master", cs.Properties.OrchestratorProfile.OrchestratorType)
return false
}
// Check Agent distros
for _, agentProfile := range cs.Properties.AgentPoolProfiles {
if agentProfile.Distro == api.RHEL &&
(cs.Properties.OrchestratorProfile.OrchestratorType != api.SwarmMode) {
if agentProfile.Distro == api.RHEL {
log.Printf("Orchestrator type %s not suported on RHEL Agent", cs.Properties.OrchestratorProfile.OrchestratorType)
return false
}
@ -237,157 +231,6 @@ func makeWindowsExtensionScriptCommands(extension *api.Extension, extensionProfi
return fmt.Sprintf("New-Item -ItemType Directory -Force -Path \"%s\" ; Invoke-WebRequest -Uri \"%s\" -OutFile \"%s\" ; powershell \"%s `\"',parameters('%sParameters'),'`\"\"\n", scriptFileDir, scriptURL, scriptFilePath, scriptFilePath, extensionProfile.Name)
}
func getDCOSWindowsAgentPreprovisionParameters(cs *api.ContainerService, profile *api.AgentPoolProfile) string {
extension := profile.PreprovisionExtension
var extensionProfile *api.ExtensionProfile
for _, eP := range cs.Properties.ExtensionProfiles {
if strings.EqualFold(eP.Name, extension.Name) {
extensionProfile = eP
break
}
}
parms := extensionProfile.ExtensionParameters
return parms
}
func getDCOSDefaultBootstrapInstallerURL(profile *api.OrchestratorProfile) string {
if profile.OrchestratorType == api.DCOS {
switch profile.OrchestratorVersion {
case common.DCOSVersion1Dot11Dot2:
return "https://dcos-mirror.azureedge.net/dcos-1-11-2/dcos_generate_config.sh"
case common.DCOSVersion1Dot11Dot0:
return "https://dcos-mirror.azureedge.net/dcos-1-11-0/dcos_generate_config.sh"
}
}
return ""
}
func getDCOSDefaultWindowsBootstrapInstallerURL(profile *api.OrchestratorProfile) string {
if profile.OrchestratorType == api.DCOS {
switch profile.OrchestratorVersion {
case common.DCOSVersion1Dot11Dot2:
return "https://dcos-mirror.azureedge.net/dcos-windows/1-11-2"
case common.DCOSVersion1Dot11Dot0:
return "https://dcos-mirror.azureedge.net/dcos-windows/1-11-0"
}
}
return ""
}
func getDCOSDefaultProviderPackageGUID(orchestratorType string, orchestratorVersion string, masterCount int) string {
if orchestratorType == api.DCOS {
switch orchestratorVersion {
case common.DCOSVersion1Dot10Dot0:
switch masterCount {
case 1:
return "c4ec6210f396b8e435177b82e3280a2cef0ce721"
case 3:
return "08197947cb57d479eddb077a429fa15c139d7d20"
case 5:
return "f286ad9d3641da5abb622e4a8781f73ecd8492fa"
}
case common.DCOSVersion1Dot9Dot0:
switch masterCount {
case 1:
return "bcc883b7a3191412cf41824bdee06c1142187a0b"
case 3:
return "dcff7e24c0c1827bebeb7f1a806f558054481b33"
case 5:
return "b41bfa84137a6374b2ff5eb1655364d7302bd257"
}
case common.DCOSVersion1Dot9Dot8:
switch masterCount {
case 1:
return "e8b0e3fc4a16394dc6dd5b19fc54bf1543bff429"
case 3:
return "2d36c3f570d9dd7d187c699f9a322ed9d95e7dfa"
case 5:
return "c03c9587f88929f310b80af4f448b7b51654f1c8"
}
case common.DCOSVersion1Dot8Dot8:
switch masterCount {
case 1:
return "441385ce2f5942df7e29075c12fb38fa5e92cbba"
case 3:
return "b1cd359287504efb780257bd12cc3a63704e42d4"
case 5:
return "d9b61156dfcc9383e014851529738aa550ef57d9"
}
}
}
return ""
}
func getDCOSDefaultRepositoryURL(orchestratorType string, orchestratorVersion string) string {
if orchestratorType == api.DCOS {
switch orchestratorVersion {
case common.DCOSVersion1Dot10Dot0:
return "https://dcosio.azureedge.net/dcos/stable/1.10.0"
case common.DCOSVersion1Dot9Dot8:
return "https://dcosio.azureedge.net/dcos/stable/1.9.8"
default:
return "https://dcosio.azureedge.net/dcos/stable"
}
}
return ""
}
func getDCOSMasterCustomNodeLabels() string {
// return empty string for DCOS since no attribtutes needed on master
return ""
}
func getDCOSAgentCustomNodeLabels(profile *api.AgentPoolProfile) string {
var buf bytes.Buffer
var attrstring string
buf.WriteString("")
// always write MESOS_ATTRIBUTES because
// the provision script will add FD/UD attributes
// at node provisioning time
if len(profile.OSType) > 0 {
attrstring = fmt.Sprintf("MESOS_ATTRIBUTES=\"os:%s", profile.OSType)
} else {
attrstring = fmt.Sprintf("MESOS_ATTRIBUTES=\"os:%s", api.Linux)
}
if len(profile.Ports) > 0 {
attrstring += ";public_ip:yes"
}
buf.WriteString(attrstring)
if len(profile.CustomNodeLabels) > 0 {
for k, v := range profile.CustomNodeLabels {
buf.WriteString(fmt.Sprintf(";%s:%s", k, v))
}
}
buf.WriteString("\"")
return buf.String()
}
func getDCOSWindowsAgentCustomAttributes(profile *api.AgentPoolProfile) string {
var buf bytes.Buffer
var attrstring string
buf.WriteString("")
if len(profile.OSType) > 0 {
attrstring = fmt.Sprintf("os:%s", profile.OSType)
} else {
attrstring = "os:windows"
}
if len(profile.Ports) > 0 {
attrstring += ";public_ip:yes"
}
buf.WriteString(attrstring)
if len(profile.CustomNodeLabels) > 0 {
for k, v := range profile.CustomNodeLabels {
buf.WriteString(fmt.Sprintf(";%s:%s", k, v))
}
}
return buf.String()
}
func getVNETAddressPrefixes(properties *api.Properties) string {
visitedSubnets := make(map[string]bool)
var buf bytes.Buffer
@ -998,58 +841,6 @@ func getAddonsString(cs *api.ContainerService, sourcePath string) string {
return result
}
func getDCOSMasterProvisionScript(orchProfile *api.OrchestratorProfile, bootstrapIP string) string {
scriptname := dcos2Provision
if orchProfile.DcosConfig == nil || orchProfile.DcosConfig.BootstrapProfile == nil {
scriptname = dcosProvision
}
// add the provision script
bp, err := Asset(scriptname)
if err != nil {
panic(fmt.Sprintf("BUG: %s", err.Error()))
}
provisionScript := string(bp)
if strings.Contains(provisionScript, "'") {
panic(fmt.Sprintf("BUG: %s may not contain character '", scriptname))
}
// the embedded roleFileContents
roleFileContents := `touch /etc/mesosphere/roles/master
touch /etc/mesosphere/roles/azure_master`
provisionScript = strings.Replace(provisionScript, "ROLESFILECONTENTS", roleFileContents, -1)
provisionScript = strings.Replace(provisionScript, "BOOTSTRAP_IP", bootstrapIP, -1)
var b bytes.Buffer
b.WriteString(provisionScript)
b.WriteString("\n")
return strings.Replace(strings.Replace(b.String(), "\r\n", "\n", -1), "\n", "\n\n ", -1)
}
func buildYamlFileWithWriteFiles(files []string, cs *api.ContainerService) string {
clusterYamlFile := `#cloud-config
write_files:
%s
`
writeFileBlock := ` - encoding: gzip
content: !!binary |
%s
path: /opt/azure/containers/%s
permissions: "0744"
`
filelines := ""
for _, file := range files {
b64GzipString := getBase64EncodedGzippedCustomScript(file, cs)
fileNoPath := strings.TrimPrefix(file, "swarm/")
filelines += fmt.Sprintf(writeFileBlock, b64GzipString, fileNoPath)
}
return fmt.Sprintf(clusterYamlFile, filelines)
}
func getKubernetesSubnets(properties *api.Properties) string {
subnetString := `{
"name": "podCIDR%d",
@ -1241,10 +1032,6 @@ func stringInSlice(a string, list []string) bool {
return false
}
func getSwarmVersions(orchestratorVersion, dockerComposeVersion string) string {
return fmt.Sprintf("\"orchestratorVersion\": \"%s\",\n\"dockerComposeVersion\": \"%s\",\n", orchestratorVersion, dockerComposeVersion)
}
func wrapAsVariableObject(o, v string) string {
return fmt.Sprintf("',variables('%s').%s,'", o, v)
}

Просмотреть файл

@ -1,290 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
package engine
import (
"bytes"
"fmt"
"regexp"
"strconv"
"strings"
"github.com/Azure/aks-engine/pkg/api"
"github.com/Azure/aks-engine/pkg/api/common"
"github.com/ghodss/yaml"
)
func getDCOSProvisionScript(script string) string {
// add the provision script
bp, err := Asset(script)
if err != nil {
panic(fmt.Sprintf("BUG: %s", err.Error()))
}
provisionScript := string(bp)
if strings.Contains(provisionScript, "'") {
panic(fmt.Sprintf("BUG: %s may not contain character '", script))
}
return strings.Replace(strings.Replace(provisionScript, "\r\n", "\n", -1), "\n", "\n\n ", -1)
}
func getDCOSBootstrapCustomData(p *api.Properties) string {
masterIPList, err := generateConsecutiveIPsList(p.MasterProfile.Count, p.MasterProfile.FirstConsecutiveStaticIP)
if err != nil {
return ""
}
for i, v := range masterIPList {
masterIPList[i] = " - " + v
}
str := getSingleLineDCOSCustomData(
p.OrchestratorProfile.OrchestratorType,
dcos2BootstrapCustomdata, 0,
map[string]string{
"PROVISION_SOURCE_STR": getDCOSProvisionScript(dcosProvisionSource),
"PROVISION_STR": getDCOSProvisionScript(dcos2BootstrapProvision),
"MASTER_IP_LIST": strings.Join(masterIPList, "\n"),
"BOOTSTRAP_IP": p.OrchestratorProfile.DcosConfig.BootstrapProfile.StaticIP,
"BOOTSTRAP_OAUTH_ENABLED": strconv.FormatBool(p.OrchestratorProfile.DcosConfig.BootstrapProfile.OAuthEnabled)})
return fmt.Sprintf("\"customData\": \"[base64(concat('#cloud-config\\n\\n', '%s'))]\",", str)
}
func getDCOSCustomDataPublicIPStr(orchestratorType string, masterCount int) string {
if orchestratorType == api.DCOS {
var buf bytes.Buffer
for i := 0; i < masterCount; i++ {
buf.WriteString(fmt.Sprintf("reference(variables('masterVMNic')[%d]).ipConfigurations[0].properties.privateIPAddress,", i))
if i < (masterCount - 1) {
buf.WriteString(`'\\\", \\\"', `)
}
}
return buf.String()
}
return ""
}
// getSingleLineForTemplate returns the file as a single line for embedding in an arm template
func getSingleLineDCOSCustomData(orchestratorType, yamlFilename string, masterCount int, replaceMap map[string]string) string {
b, err := Asset(yamlFilename)
if err != nil {
panic(fmt.Sprintf("BUG getting yaml custom data file: %s", err.Error()))
}
yamlStr := string(b)
for k, v := range replaceMap {
yamlStr = strings.Replace(yamlStr, k, v, -1)
}
// convert to json
jsonBytes, err4 := yaml.YAMLToJSON([]byte(yamlStr))
if err4 != nil {
panic(fmt.Sprintf("BUG: %s", err4.Error()))
}
yamlStr = string(jsonBytes)
// convert to one line
yamlStr = strings.Replace(yamlStr, "\\", "\\\\", -1)
yamlStr = strings.Replace(yamlStr, "\r\n", "\\n", -1)
yamlStr = strings.Replace(yamlStr, "\n", "\\n", -1)
yamlStr = strings.Replace(yamlStr, "\"", "\\\"", -1)
// variable replacement
rVariable, e1 := regexp.Compile("{{{([^}]*)}}}")
if e1 != nil {
panic(fmt.Sprintf("BUG: %s", e1.Error()))
}
yamlStr = rVariable.ReplaceAllString(yamlStr, "',variables('$1'),'")
// replace the internal values
publicIPStr := getDCOSCustomDataPublicIPStr(orchestratorType, masterCount)
yamlStr = strings.Replace(yamlStr, "DCOSCUSTOMDATAPUBLICIPSTR", publicIPStr, -1)
return yamlStr
}
func getDCOSCustomDataTemplate(orchestratorType, orchestratorVersion string) string {
switch orchestratorType {
case api.DCOS:
switch orchestratorVersion {
case common.DCOSVersion1Dot8Dot8:
return dcosCustomData188
case common.DCOSVersion1Dot9Dot0:
return dcosCustomData190
case common.DCOSVersion1Dot9Dot8:
return dcosCustomData198
case common.DCOSVersion1Dot10Dot0:
return dcosCustomData110
case common.DCOSVersion1Dot11Dot0:
return dcos2CustomData1110
case common.DCOSVersion1Dot11Dot2:
return dcos2CustomData1112
}
default:
// it is a bug to get here
panic(fmt.Sprintf("BUG: invalid orchestrator %s", orchestratorType))
}
return ""
}
func getDCOSMasterCustomData(cs *api.ContainerService) string {
masterAttributeContents := getDCOSMasterCustomNodeLabels()
masterPreprovisionExtension := ""
if cs.Properties.MasterProfile.PreprovisionExtension != nil {
masterPreprovisionExtension += "\n"
masterPreprovisionExtension += makeMasterExtensionScriptCommands(cs)
}
var bootstrapIP string
if cs.Properties.OrchestratorProfile.DcosConfig != nil && cs.Properties.OrchestratorProfile.DcosConfig.BootstrapProfile != nil {
bootstrapIP = cs.Properties.OrchestratorProfile.DcosConfig.BootstrapProfile.StaticIP
}
str := getSingleLineDCOSCustomData(
cs.Properties.OrchestratorProfile.OrchestratorType,
getDCOSCustomDataTemplate(cs.Properties.OrchestratorProfile.OrchestratorType, cs.Properties.OrchestratorProfile.OrchestratorVersion),
cs.Properties.MasterProfile.Count,
map[string]string{
"PROVISION_SOURCE_STR": getDCOSProvisionScript(dcosProvisionSource),
"PROVISION_STR": getDCOSMasterProvisionScript(cs.Properties.OrchestratorProfile, bootstrapIP),
"ATTRIBUTES_STR": masterAttributeContents,
"PREPROVISION_EXTENSION": masterPreprovisionExtension,
"ROLENAME": "master"})
return fmt.Sprintf("\"customData\": \"[base64(concat('#cloud-config\\n\\n', '%s'))]\",", str)
}
func getDCOSAgentProvisionScript(profile *api.AgentPoolProfile, orchProfile *api.OrchestratorProfile, bootstrapIP string) string {
// add the provision script
scriptname := dcos2Provision
if orchProfile.DcosConfig == nil || orchProfile.DcosConfig.BootstrapProfile == nil {
if profile.OSType == api.Windows {
scriptname = dcosWindowsProvision
} else {
scriptname = dcosProvision
}
}
bp, err := Asset(scriptname)
if err != nil {
panic(fmt.Sprintf("BUG: %s", err.Error()))
}
provisionScript := string(bp)
if strings.Contains(provisionScript, "'") {
panic(fmt.Sprintf("BUG: %s may not contain character '", dcosProvision))
}
// the embedded roleFileContents
var roleFileContents string
if len(profile.Ports) > 0 {
// public agents
roleFileContents = "touch /etc/mesosphere/roles/slave_public"
} else {
roleFileContents = "touch /etc/mesosphere/roles/slave"
}
provisionScript = strings.Replace(provisionScript, "ROLESFILECONTENTS", roleFileContents, -1)
provisionScript = strings.Replace(provisionScript, "BOOTSTRAP_IP", bootstrapIP, -1)
var b bytes.Buffer
b.WriteString(provisionScript)
b.WriteString("\n")
if len(orchProfile.DcosConfig.Registry) == 0 {
b.WriteString("rm /etc/docker.tar.gz\n")
}
return strings.Replace(strings.Replace(b.String(), "\r\n", "\n", -1), "\n", "\n\n ", -1)
}
func getDCOSAgentCustomData(cs *api.ContainerService, profile *api.AgentPoolProfile) string {
attributeContents := getDCOSAgentCustomNodeLabels(profile)
agentPreprovisionExtension := ""
if profile.PreprovisionExtension != nil {
agentPreprovisionExtension += "\n"
agentPreprovisionExtension += makeAgentExtensionScriptCommands(cs, profile)
}
var agentRoleName, bootstrapIP string
if len(profile.Ports) > 0 {
agentRoleName = "slave_public"
} else {
agentRoleName = "slave"
}
if cs.Properties.OrchestratorProfile.DcosConfig != nil && cs.Properties.OrchestratorProfile.DcosConfig.BootstrapProfile != nil {
bootstrapIP = cs.Properties.OrchestratorProfile.DcosConfig.BootstrapProfile.StaticIP
}
str := getSingleLineDCOSCustomData(
cs.Properties.OrchestratorProfile.OrchestratorType,
getDCOSCustomDataTemplate(cs.Properties.OrchestratorProfile.OrchestratorType, cs.Properties.OrchestratorProfile.OrchestratorVersion),
cs.Properties.MasterProfile.Count,
map[string]string{
"PROVISION_SOURCE_STR": getDCOSProvisionScript(dcosProvisionSource),
"PROVISION_STR": getDCOSAgentProvisionScript(profile, cs.Properties.OrchestratorProfile, bootstrapIP),
"ATTRIBUTES_STR": attributeContents,
"PREPROVISION_EXTENSION": agentPreprovisionExtension,
"ROLENAME": agentRoleName})
return fmt.Sprintf("\"customData\": \"[base64(concat('#cloud-config\\n\\n', '%s'))]\",", str)
}
func getDCOSWindowsAgentCustomData(cs *api.ContainerService, profile *api.AgentPoolProfile) string {
agentPreprovisionExtension := ""
if profile.PreprovisionExtension != nil {
agentPreprovisionExtension += "\n"
agentPreprovisionExtension += makeAgentExtensionScriptCommands(cs, profile)
}
b, err := Asset(dcosWindowsProvision)
if err != nil {
// this should never happen and this is a bug
panic(fmt.Sprintf("BUG: %s", err.Error()))
}
// translate the parameters
csStr := string(b)
csStr = strings.Replace(csStr, "PREPROVISION_EXTENSION", agentPreprovisionExtension, -1)
csStr = strings.Replace(csStr, "\r\n", "\n", -1)
str := getBase64EncodedGzippedCustomScriptFromStr(csStr)
return fmt.Sprintf("\"customData\": \"%s\"", str)
}
// getLinkedTemplatesForExtensions returns the
// Microsoft.Resources/deployments for each extension
func getLinkedTemplatesForExtensions(properties *api.Properties) string {
var result string
extensions := properties.ExtensionProfiles
masterProfileExtensions := properties.MasterProfile.Extensions
orchestratorType := properties.OrchestratorProfile.OrchestratorType
for err, extensionProfile := range extensions {
_ = err
masterOptedForExtension, singleOrAll := validateProfileOptedForExtension(extensionProfile.Name, masterProfileExtensions)
if masterOptedForExtension {
result += ","
dta, e := getMasterLinkedTemplateText(orchestratorType, extensionProfile, singleOrAll)
if e != nil {
fmt.Println(e.Error())
return ""
}
result += dta
}
for _, agentPoolProfile := range properties.AgentPoolProfiles {
poolProfileExtensions := agentPoolProfile.Extensions
poolOptedForExtension, singleOrAll := validateProfileOptedForExtension(extensionProfile.Name, poolProfileExtensions)
if poolOptedForExtension {
result += ","
dta, e := getAgentPoolLinkedTemplateText(agentPoolProfile, orchestratorType, extensionProfile, singleOrAll)
if e != nil {
fmt.Println(e.Error())
return ""
}
result += dta
}
}
}
return result
}

Просмотреть файл

@ -805,60 +805,6 @@ func TestMakeMasterExtensionScriptCommands(t *testing.T) {
}
}
func TestGetDCOSWindowsAgentPreprovisionParameters(t *testing.T) {
cs := &api.ContainerService{
Properties: &api.Properties{
ExtensionProfiles: []*api.ExtensionProfile{
{
Name: "fooExtension",
ExtensionParameters: "fooExtensionParams",
},
},
},
}
profile := &api.AgentPoolProfile{
PreprovisionExtension: &api.Extension{
Name: "fooExtension",
},
}
actual := getDCOSWindowsAgentPreprovisionParameters(cs, profile)
expected := "fooExtensionParams"
if actual != expected {
t.Errorf("expected to get %s, but got %s instead", expected, actual)
}
}
func TestGetDCOSWindowsAgentCustomAttributes(t *testing.T) {
profile := &api.AgentPoolProfile{
OSType: api.Windows,
Ports: []int{
8000,
8080,
},
CustomNodeLabels: map[string]string{
"foo": "bar",
"abc": "xyz",
"lorem": "ipsum",
},
}
actual := getDCOSWindowsAgentCustomAttributes(profile)
if !strings.Contains(actual, "os:Windows;public_ip:yes;") {
t.Errorf("expected output string of getDCOSWindowsAgentCustomAttributes %s to contain os:Windows;public_ip:yes;", actual)
}
for k, v := range profile.CustomNodeLabels {
if !strings.Contains(actual, fmt.Sprintf("%s:%s", k, v)) {
t.Errorf("expected output string of getDCOSWindowsAgentCustomAttributes %s to contain key-value pairs %s:%s", actual, k, v)
}
}
}
func TestGetKubernetesSubnets(t *testing.T) {
props := &api.Properties{
AgentPoolProfiles: []*api.AgentPoolProfile{

Просмотреть файл

@ -4,12 +4,9 @@
package engine
import (
"encoding/base64"
"fmt"
"strings"
"github.com/Azure/aks-engine/pkg/api"
"github.com/Azure/aks-engine/pkg/api/common"
"github.com/Azure/aks-engine/pkg/helpers"
)
@ -46,7 +43,7 @@ func getParameters(cs *api.ContainerService, generatorCode string, aksEngineVers
addValue(parametersMap, "dnsServer", linuxProfile.CustomNodesDNS.DNSServer)
}
}
// masterEndpointDNSNamePrefix is the basis for storage account creation across dcos, swarm, and k8s
// masterEndpointDNSNamePrefix is the basis for storage account creation for k8s
if properties.MasterProfile != nil {
// MasterProfile exists, uses master DNS prefix
addValue(parametersMap, "masterEndpointDNSNamePrefix", properties.MasterProfile.DNSPrefix)
@ -98,96 +95,11 @@ func getParameters(cs *api.ContainerService, generatorCode string, aksEngineVers
}
}
//Swarm and SwarmMode Parameters
if properties.OrchestratorProfile.OrchestratorType == api.Swarm || properties.OrchestratorProfile.OrchestratorType == api.SwarmMode {
var dockerEngineRepo, dockerComposeDownloadURL string
if cloudSpecConfig.DockerSpecConfig.DockerEngineRepo == "" {
dockerEngineRepo = DefaultDockerEngineRepo
} else {
dockerEngineRepo = cloudSpecConfig.DockerSpecConfig.DockerEngineRepo
}
if cloudSpecConfig.DockerSpecConfig.DockerComposeDownloadURL == "" {
dockerComposeDownloadURL = DefaultDockerComposeURL
} else {
dockerComposeDownloadURL = cloudSpecConfig.DockerSpecConfig.DockerComposeDownloadURL
}
addValue(parametersMap, "dockerEngineDownloadRepo", dockerEngineRepo)
addValue(parametersMap, "dockerComposeDownloadURL", dockerComposeDownloadURL)
}
// Kubernetes Parameters
if properties.OrchestratorProfile.IsKubernetes() {
assignKubernetesParameters(properties, parametersMap, cloudSpecConfig, generatorCode)
}
if strings.HasPrefix(properties.OrchestratorProfile.OrchestratorType, api.DCOS) {
dcosBootstrapURL := cloudSpecConfig.DCOSSpecConfig.DCOS188BootstrapDownloadURL
dcosWindowsBootstrapURL := cloudSpecConfig.DCOSSpecConfig.DCOSWindowsBootstrapDownloadURL
dcosRepositoryURL := cloudSpecConfig.DCOSSpecConfig.DcosRepositoryURL
dcosClusterPackageListID := cloudSpecConfig.DCOSSpecConfig.DcosClusterPackageListID
dcosProviderPackageID := cloudSpecConfig.DCOSSpecConfig.DcosProviderPackageID
if properties.OrchestratorProfile.OrchestratorType == api.DCOS {
switch properties.OrchestratorProfile.OrchestratorVersion {
case common.DCOSVersion1Dot8Dot8:
dcosBootstrapURL = cloudSpecConfig.DCOSSpecConfig.DCOS188BootstrapDownloadURL
case common.DCOSVersion1Dot9Dot0:
dcosBootstrapURL = cloudSpecConfig.DCOSSpecConfig.DCOS190BootstrapDownloadURL
case common.DCOSVersion1Dot9Dot8:
dcosBootstrapURL = cloudSpecConfig.DCOSSpecConfig.DCOS198BootstrapDownloadURL
case common.DCOSVersion1Dot10Dot0:
dcosBootstrapURL = cloudSpecConfig.DCOSSpecConfig.DCOS110BootstrapDownloadURL
default:
dcosBootstrapURL = getDCOSDefaultBootstrapInstallerURL(properties.OrchestratorProfile)
dcosWindowsBootstrapURL = getDCOSDefaultWindowsBootstrapInstallerURL(properties.OrchestratorProfile)
}
}
if properties.OrchestratorProfile.DcosConfig != nil {
if properties.OrchestratorProfile.DcosConfig.DcosWindowsBootstrapURL != "" {
dcosWindowsBootstrapURL = properties.OrchestratorProfile.DcosConfig.DcosWindowsBootstrapURL
}
if properties.OrchestratorProfile.DcosConfig.DcosBootstrapURL != "" {
dcosBootstrapURL = properties.OrchestratorProfile.DcosConfig.DcosBootstrapURL
}
if len(properties.OrchestratorProfile.DcosConfig.Registry) > 0 {
addValue(parametersMap, "registry", properties.OrchestratorProfile.DcosConfig.Registry)
addValue(parametersMap, "registryKey", base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", properties.OrchestratorProfile.DcosConfig.RegistryUser, properties.OrchestratorProfile.DcosConfig.RegistryPass))))
}
if properties.OrchestratorProfile.DcosConfig.DcosRepositoryURL != "" {
dcosRepositoryURL = properties.OrchestratorProfile.DcosConfig.DcosRepositoryURL
} else {
dcosRepositoryURL = getDCOSDefaultRepositoryURL(
properties.OrchestratorProfile.OrchestratorType,
properties.OrchestratorProfile.OrchestratorVersion)
}
if properties.OrchestratorProfile.DcosConfig.DcosClusterPackageListID != "" {
dcosClusterPackageListID = properties.OrchestratorProfile.DcosConfig.DcosClusterPackageListID
}
if properties.OrchestratorProfile.DcosConfig.DcosProviderPackageID != "" {
dcosProviderPackageID = properties.OrchestratorProfile.DcosConfig.DcosProviderPackageID
} else {
dcosProviderPackageID = getDCOSDefaultProviderPackageGUID(
properties.OrchestratorProfile.OrchestratorType,
properties.OrchestratorProfile.OrchestratorVersion,
properties.MasterProfile.Count)
}
}
addValue(parametersMap, "dcosBootstrapURL", dcosBootstrapURL)
addValue(parametersMap, "dcosWindowsBootstrapURL", dcosWindowsBootstrapURL)
addValue(parametersMap, "dcosRepositoryURL", dcosRepositoryURL)
addValue(parametersMap, "dcosClusterPackageListID", dcosClusterPackageListID)
addValue(parametersMap, "dcosProviderPackageID", dcosProviderPackageID)
if properties.OrchestratorProfile.DcosConfig != nil && properties.OrchestratorProfile.DcosConfig.BootstrapProfile != nil {
addValue(parametersMap, "bootstrapStaticIP", properties.OrchestratorProfile.DcosConfig.BootstrapProfile.StaticIP)
addValue(parametersMap, "bootstrapVMSize", properties.OrchestratorProfile.DcosConfig.BootstrapProfile.VMSize)
}
}
// Agent parameters
for _, agentProfile := range properties.AgentPoolProfiles {
addValue(parametersMap, fmt.Sprintf("%sCount", agentProfile.Name), agentProfile.Count)

Просмотреть файл

@ -127,9 +127,6 @@ func (t *TemplateGenerator) GenerateTemplate(containerService *api.ContainerServ
func (t *TemplateGenerator) verifyFiles() error {
allFiles := commonTemplateFiles
allFiles = append(allFiles, dcosTemplateFiles...)
allFiles = append(allFiles, dcos2TemplateFiles...)
allFiles = append(allFiles, swarmTemplateFiles...)
for _, file := range allFiles {
if _, err := Asset(file); err != nil {
return t.Translator.Errorf("template file %s does not exist", file)
@ -139,28 +136,7 @@ func (t *TemplateGenerator) verifyFiles() error {
}
func (t *TemplateGenerator) prepareTemplateFiles(properties *api.Properties) ([]string, string, error) {
var files []string
var baseFile string
switch properties.OrchestratorProfile.OrchestratorType {
case api.DCOS:
if properties.OrchestratorProfile.DcosConfig == nil || properties.OrchestratorProfile.DcosConfig.BootstrapProfile == nil {
files = append(commonTemplateFiles, dcosTemplateFiles...)
baseFile = dcosBaseFile
} else {
files = append(commonTemplateFiles, dcos2TemplateFiles...)
baseFile = dcos2BaseFile
}
case api.Swarm:
files = append(commonTemplateFiles, swarmTemplateFiles...)
baseFile = swarmBaseFile
case api.SwarmMode:
files = append(commonTemplateFiles, swarmModeTemplateFiles...)
baseFile = swarmBaseFile
default:
return nil, "", t.Translator.Errorf("orchestrator '%s' is unsupported", properties.OrchestratorProfile.OrchestratorType)
}
return files, baseFile, nil
return []string{}, "", t.Translator.Errorf("orchestrator '%s' is unsupported", properties.OrchestratorProfile.OrchestratorType)
}
func (t *TemplateGenerator) GetJumpboxCustomDataJSON(cs *api.ContainerService) string {
@ -272,9 +248,6 @@ func getContainerServiceFuncMap(cs *api.ContainerService) template.FuncMap {
"IsIPMasqAgentEnabled": func() bool {
return cs.Properties.IsIPMasqAgentEnabled()
},
"IsDCOS19": func() bool {
return cs.Properties.OrchestratorProfile != nil && cs.Properties.OrchestratorProfile.IsDCOS19()
},
"IsKubernetesVersionGe": func(version string) bool {
return cs.Properties.OrchestratorProfile.IsKubernetes() && common.IsKubernetesVersionGe(cs.Properties.OrchestratorProfile.OrchestratorVersion, version)
},
@ -327,14 +300,8 @@ func getContainerServiceFuncMap(cs *api.ContainerService) template.FuncMap {
return string(cs.Properties.OrchestratorProfile.KubernetesConfig.ProxyMode)
},
"HasPrivateRegistry": func() bool {
if cs.Properties.OrchestratorProfile.DcosConfig != nil {
return cs.Properties.OrchestratorProfile.DcosConfig.HasPrivateRegistry()
}
return false
},
"IsSwarmMode": func() bool {
return cs.Properties.OrchestratorProfile.IsSwarmMode()
},
"IsKubernetes": func() bool {
return cs.Properties.OrchestratorProfile.IsKubernetes()
},
@ -393,34 +360,7 @@ func getContainerServiceFuncMap(cs *api.ContainerService) template.FuncMap {
"GetDataDisks": func(profile *api.AgentPoolProfile) string {
return getDataDisks(profile)
},
"HasBootstrap": func() bool {
return cs.Properties.OrchestratorProfile.DcosConfig != nil && cs.Properties.OrchestratorProfile.DcosConfig.HasBootstrap()
},
"GetDCOSBootstrapCustomData": func() string {
return getDCOSBootstrapCustomData(cs.Properties)
},
"GetDCOSMasterCustomData": func() string {
return getDCOSMasterCustomData(cs)
},
"GetDCOSAgentCustomData": func(profile *api.AgentPoolProfile) string {
return getDCOSAgentCustomData(cs, profile)
},
"GetDCOSWindowsAgentCustomData": func(profile *api.AgentPoolProfile) string {
return getDCOSWindowsAgentCustomData(cs, profile)
},
"GetDCOSWindowsAgentCustomNodeAttributes": func(profile *api.AgentPoolProfile) string {
return getDCOSWindowsAgentCustomAttributes(profile)
},
"GetDCOSWindowsAgentPreprovisionParameters": func(profile *api.AgentPoolProfile) string {
if profile.PreprovisionExtension != nil {
return getDCOSWindowsAgentPreprovisionParameters(cs, profile)
}
return ""
},
"GetMasterAllowedSizes": func() string {
if cs.Properties.OrchestratorProfile.OrchestratorType == api.DCOS {
return helpers.GetDCOSMasterAllowedSizes()
}
return helpers.GetKubernetesAllowedVMSKUs()
},
"GetDefaultVNETCIDR": func() string {
@ -432,18 +372,9 @@ func getContainerServiceFuncMap(cs *api.ContainerService) template.FuncMap {
"GetDefaultVNETCIDRIPv6": func() string {
return DefaultVNETCIDRIPv6
},
"getSwarmVersions": func() string {
return getSwarmVersions(api.SwarmVersion, api.SwarmDockerComposeVersion)
},
"GetSwarmModeVersions": func() string {
return getSwarmVersions(api.DockerCEVersion, api.DockerCEDockerComposeVersion)
},
"GetSizeMap": func() string {
return helpers.GetSizeMap()
},
"WriteLinkedTemplatesForExtensions": func() string {
return getLinkedTemplatesForExtensions(cs.Properties)
},
"GetSshPublicKeysPowerShell": func() string {
return getSSHPublicKeysPowerShell(cs.Properties.LinuxProfile)
},
@ -466,41 +397,9 @@ func getContainerServiceFuncMap(cs *api.ContainerService) template.FuncMap {
}
return str
},
"GetMasterSwarmCustomData": func() string {
files := []string{swarmProvision}
str := buildYamlFileWithWriteFiles(files, cs)
if cs.Properties.MasterProfile.PreprovisionExtension != nil {
extensionStr := makeMasterExtensionScriptCommands(cs)
str += "'runcmd:\n" + extensionStr + "\n\n'"
}
str = escapeSingleLine(str)
return fmt.Sprintf("\"customData\": \"[base64(concat('%s'))]\",", str)
},
"GetAgentSwarmCustomData": func(profile *api.AgentPoolProfile) string {
files := []string{swarmProvision}
str := buildYamlFileWithWriteFiles(files, cs)
str = escapeSingleLine(str)
return fmt.Sprintf("\"customData\": \"[base64(concat('%s',variables('%sRunCmdFile'),variables('%sRunCmd')))]\",", str, profile.Name, profile.Name)
},
"GetSwarmAgentPreprovisionExtensionCommands": func(profile *api.AgentPoolProfile) string {
str := ""
if profile.PreprovisionExtension != nil {
makeAgentExtensionScriptCommands(cs, profile)
}
str = escapeSingleLine(str)
return str
},
"GetLocation": func() string {
return cs.Location
},
"GetWinAgentSwarmCustomData": func() string {
str := getBase64EncodedGzippedCustomScript(swarmWindowsProvision, cs)
return fmt.Sprintf("\"customData\": \"%s\"", str)
},
"GetWinAgentSwarmModeCustomData": func() string {
str := getBase64EncodedGzippedCustomScript(swarmModeWindowsProvision, cs)
return fmt.Sprintf("\"customData\": \"%s\"", str)
},
"GetKubernetesWindowsAgentFunctions": func() string {
// Collect all the parts into a zip
var parts = []string{
@ -540,22 +439,6 @@ func getContainerServiceFuncMap(cs *api.ContainerService) template.FuncMap {
}
return base64.StdEncoding.EncodeToString(buf.Bytes())
},
"GetMasterSwarmModeCustomData": func() string {
files := []string{swarmModeProvision}
str := buildYamlFileWithWriteFiles(files, cs)
if cs.Properties.MasterProfile.PreprovisionExtension != nil {
extensionStr := makeMasterExtensionScriptCommands(cs)
str += "runcmd:\n" + extensionStr + "\n\n"
}
str = escapeSingleLine(str)
return fmt.Sprintf("\"customData\": \"[base64(concat('%s'))]\",", str)
},
"GetAgentSwarmModeCustomData": func(profile *api.AgentPoolProfile) string {
files := []string{swarmModeProvision}
str := buildYamlFileWithWriteFiles(files, cs)
str = escapeSingleLine(str)
return fmt.Sprintf("\"customData\": \"[base64(concat('%s',variables('%sRunCmdFile'),variables('%sRunCmd')))]\",", str, profile.Name, profile.Name)
},
"WrapAsVariable": func(s string) string {
return common.WrapAsARMVariable(s)
},

Просмотреть файл

@ -61,7 +61,6 @@ func TestGetTemplateFuncMap(t *testing.T) {
"GetKubeletConfigKeyValsPsh",
"GetK8sRuntimeConfigKeyVals",
"HasPrivateRegistry",
"IsSwarmMode",
"IsKubernetes",
"IsPublic",
"IsAzureCNI",
@ -78,25 +77,16 @@ func TestGetTemplateFuncMap(t *testing.T) {
"GetVNETAddressPrefixes",
"GetVNETSubnets",
"GetDataDisks",
"HasBootstrap",
"GetMasterAllowedSizes",
"GetDefaultVNETCIDR",
"GetKubernetesAllowedVMSKUs",
"GetSizeMap",
"WriteLinkedTemplatesForExtensions",
"GetSshPublicKeysPowerShell",
"GetWindowsMasterSubnetARMParam",
"GetKubernetesMasterPreprovisionYaml",
"GetKubernetesAgentPreprovisionYaml",
"GetMasterSwarmCustomData",
"GetAgentSwarmCustomData",
"GetSwarmAgentPreprovisionExtensionCommands",
"GetLocation",
"GetWinAgentSwarmCustomData",
"GetWinAgentSwarmModeCustomData",
"GetKubernetesWindowsAgentFunctions",
"GetMasterSwarmModeCustomData",
"GetAgentSwarmModeCustomData",
"GetPodInfraContainerSpec",
"IsKubenet",
"WrapAsVariable",

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,47 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "DCOS"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agent128",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "ManagedDisks",
"diskSizesGB": [128, 128, 128, 128]
},
{
"name": "agent1public",
"count": 3,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agent1public",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "ManagedDisks",
"diskSizesGB": [1],
"ports": [
80,
443,
8080
]
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
}
}
}

Просмотреть файл

@ -1,47 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "DCOS"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agent128",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "VirtualMachineScaleSets",
"storageProfile": "ManagedDisks",
"diskSizesGB": [128, 128, 128, 128]
},
{
"name": "agent1public",
"count": 3,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agent1public",
"availabilityProfile": "VirtualMachineScaleSets",
"storageProfile": "ManagedDisks",
"diskSizesGB": [1],
"ports": [
80,
443,
8080
]
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
}
}
}

Просмотреть файл

@ -1,47 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Swarm"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agent128",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "ManagedDisks",
"diskSizesGB": [128, 128, 128, 128]
},
{
"name": "agent1public",
"count": 3,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agent1public",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "ManagedDisks",
"diskSizesGB": [1],
"ports": [
80,
443,
8080
]
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
}
}
}

Просмотреть файл

@ -1,47 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Swarm"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agent128",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "VirtualMachineScaleSets",
"storageProfile": "ManagedDisks",
"diskSizesGB": [128, 128, 128, 128]
},
{
"name": "agent1public",
"count": 3,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agent1public",
"availabilityProfile": "VirtualMachineScaleSets",
"storageProfile": "ManagedDisks",
"diskSizesGB": [1],
"ports": [
80,
443,
8080
]
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
}
}
}

Просмотреть файл

@ -1,53 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Swarm"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agent128",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "ManagedDisks",
"diskSizesGB": [128, 128, 128, 128],
"osType": "Windows"
},
{
"name": "agent1public",
"count": 3,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agent1public",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "ManagedDisks",
"diskSizesGB": [1],
"osType": "Windows",
"ports": [
80,
443,
8080
]
}
],
"windowsProfile": {
"adminUsername": "azureuser",
"adminPassword": "replacepassword1234$"
},
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
}
}
}

Просмотреть файл

@ -1,53 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Swarm"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agent128",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "VirtualMachineScaleSets",
"storageProfile": "ManagedDisks",
"diskSizesGB": [128, 128, 128, 128],
"osType": "Windows"
},
{
"name": "agent1public",
"count": 3,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agent1public",
"availabilityProfile": "VirtualMachineScaleSets",
"storageProfile": "ManagedDisks",
"diskSizesGB": [1],
"osType": "Windows",
"ports": [
80,
443,
8080
]
}
],
"windowsProfile": {
"adminUsername": "azureuser",
"adminPassword": "replacepassword1234$"
},
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
}
}
}

Просмотреть файл

@ -1,47 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "SwarmMode"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agent128",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "ManagedDisks",
"diskSizesGB": [128, 128, 128, 128]
},
{
"name": "agent1public",
"count": 3,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agent1public",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "ManagedDisks",
"diskSizesGB": [1],
"ports": [
80,
443,
8080
]
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
}
}
}

Просмотреть файл

@ -1,47 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "SwarmMode"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agent128",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "VirtualMachineScaleSets",
"storageProfile": "ManagedDisks",
"diskSizesGB": [128, 128, 128, 128]
},
{
"name": "agent1public",
"count": 3,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agent1public",
"availabilityProfile": "VirtualMachineScaleSets",
"storageProfile": "ManagedDisks",
"diskSizesGB": [1],
"ports": [
80,
443,
8080
]
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
}
}
}

Просмотреть файл

@ -1,47 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "DCOS"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agent128",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "StorageAccount",
"diskSizesGB": [128, 128, 128, 128]
},
{
"name": "agent1public",
"count": 3,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agent1public",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "StorageAccount",
"diskSizesGB": [1],
"ports": [
80,
443,
8080
]
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
}
}
}

Просмотреть файл

@ -1,47 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Swarm"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agent128",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "StorageAccount",
"diskSizesGB": [128, 128, 128, 128]
},
{
"name": "agent1public",
"count": 3,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agent1public",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "StorageAccount",
"diskSizesGB": [1],
"ports": [
80,
443,
8080
]
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
}
}
}

Просмотреть файл

@ -1,47 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "SwarmMode"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agent128",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "StorageAccount",
"diskSizesGB": [128, 128, 128, 128]
},
{
"name": "agent1public",
"count": 3,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agent1public",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "StorageAccount",
"diskSizesGB": [1],
"ports": [
80,
443,
8080
]
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
}
}
}

53
pkg/engine/testdata/extensions/dcos.json поставляемый
Просмотреть файл

@ -1,53 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "DCOS"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2",
"preProvisionExtension": {
"name": "hello-world",
"singleOrAll": "All"
}
},
"agentPoolProfiles": [
{
"name": "agentpool1",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet",
"preProvisionExtension": {
"name": "hello-world",
"singleOrAll": "All"
}
},
{
"name": "agentpool2",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet"
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
},
"extensionProfiles": [
{
"name": "hello-world",
"version": "v1",
"rootURL": "https://raw.githubusercontent.com/Azure/aks-engine/master/",
"script": "hello.sh"
}
]
}
}

76
pkg/engine/testdata/extensions/swarmmode.json поставляемый
Просмотреть файл

@ -1,76 +0,0 @@
{
"apiVersion": "vlabs",
"plan": {},
"properties": {
"provisioningState": "",
"orchestratorProfile": {
"orchestratorType": "SwarmMode"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2",
"firstConsecutiveStaticIP": "172.16.0.5",
"preProvisionExtension": {
"name": "hello-world-k8s",
"singleOrAll": "all"
},
"extensions": [
{
"name": "hello-world-k8s",
"singleOrAll": "all"
}
]
},
"agentPoolProfiles": [
{
"name": "agentpool1",
"count": 3,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agentdns1",
"ports": [
80,
443,
8080
],
"availabilityProfile": "AvailabilitySet",
"storageProfile": "StorageAccount",
"extensions": [
{
"name": "hello-world-k8s",
"singleOrAll": "all"
}
]
},
{
"name": "agentpool2",
"count": 3,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "StorageAccount"
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
},
"extensionProfiles": [
{
"name": "hello-world-k8s",
"version": "v1",
"extensionParameters": "extensionParameters",
"rootURL": "https://raw.githubusercontent.com/Azure/aks-engine/master/",
"script": "test.sh"
}
],
"windowsProfile": {},
"servicePrincipalProfile": {},
"certificateProfile": {}
}
}

53
pkg/engine/testdata/key-vault-certs/dcos.json поставляемый
Просмотреть файл

@ -1,53 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "DCOS"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agentprivate",
"count": 3,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpublic",
"count": 3,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agentpublic1",
"ports": [
80,
443,
8080
]
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
},
"secrets":[
{
"sourceVault":{
"id":"vaultId"
},
"vaultCertificates":[
{
"certificateUrl" :"http://url1"
}
]
}
]
}
}
}

Просмотреть файл

@ -1,90 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Swarm"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agentpool1",
"count": 3,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agentdns1",
"ports": [
80,
443,
8080
]
},
{
"name": "agentpool2",
"count": 3,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpoolw",
"count": 3,
"vmSize": "Standard_D2_v2",
"osType": "Windows"
}
],
"windowsProfile": {
"adminUsername": "azureuser",
"adminPassword": "replacepassword1234$",
"secrets":[
{
"sourceVault":{
"id":"vaultId"
},
"vaultCertificates":[
{
"certificateUrl" :"http://url3",
"certificateStore" : "store"
},
{
"certificateUrl" :"http://url4",
"certificateStore" : "store"
}
]
}
]
},
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
},
"secrets":[
{
"sourceVault":{
"id":"vaultId"
},
"vaultCertificates":[
{
"certificateUrl" :"http://url2"
}
]
},
{
"sourceVault":{
"id":"vaultId2"
},
"vaultCertificates":[
{
"certificateUrl" :"http://url1"
}
]
}
]
}
}
}

Просмотреть файл

@ -1,63 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "SwarmMode"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agentpool1",
"count": 3,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agentdns1",
"ports": [
80,
443,
8080
]
},
{
"name": "agentpool2",
"count": 3,
"vmSize": "Standard_D2_v2"
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
},
"secrets":[
{
"sourceVault":{
"id":"vaultId"
},
"vaultCertificates":[
{
"certificateUrl" :"http://url2"
}
]
},
{
"sourceVault":{
"id":"vaultId2"
},
"vaultCertificates":[
{
"certificateUrl" :"http://url1"
}
]
}
]
}
}
}

Просмотреть файл

@ -1,103 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "DCOS"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agentpri0",
"count": 100,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet"
},
{
"name": "agentpri1",
"count": 100,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet"
},
{
"name": "agentpri2",
"count": 100,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet"
},
{
"name": "agentpri3",
"count": 100,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet"
},
{
"name": "agentpri4",
"count": 100,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet"
},
{
"name": "agentpri5",
"count": 100,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet"
},
{
"name": "agentpri6",
"count": 100,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet"
},
{
"name": "agentpri7",
"count": 100,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet"
},
{
"name": "agentpri8",
"count": 100,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet"
},
{
"name": "agentpri9",
"count": 100,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet"
},
{
"name": "agentpri10",
"count": 100,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet"
},
{
"name": "agentpublic1",
"count": 100,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet",
"dnsPrefix": "agentpublic1",
"ports": [
80,
443,
8080
]
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
}
}
}

91
pkg/engine/testdata/largeclusters/dcos.json поставляемый
Просмотреть файл

@ -1,91 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "DCOS"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agentpri0",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri1",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri2",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri3",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri4",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri5",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri6",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri7",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri8",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri9",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri10",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpublic1",
"count": 100,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agentpublic1",
"ports": [
80,
443,
8080
]
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
}
}
}

91
pkg/engine/testdata/largeclusters/swarm.json поставляемый
Просмотреть файл

@ -1,91 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Swarm"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agentpri0",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri1",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri2",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri3",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri4",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri5",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri6",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri7",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri8",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri9",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri10",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpublic1",
"count": 100,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agentpublic1",
"ports": [
80,
443,
8080
]
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa PUBLICKEY azureuser@linuxvm"
}
]
}
}
}
}

Просмотреть файл

@ -1,91 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "SwarmMode"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "masterdns1",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "agentpri0",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri1",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri2",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri3",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri4",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri5",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri6",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri7",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri8",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri9",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpri10",
"count": 100,
"vmSize": "Standard_D2_v2"
},
{
"name": "agentpublic1",
"count": 100,
"vmSize": "Standard_D2_v2",
"dnsPrefix": "agentpublic1",
"ports": [
80,
443,
8080
]
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8fhkh3jpHUQsrUIezFB5k4Rq9giJM8G1Cr0u2IRMiqG++nat5hbOr3gODpTA0h11q9bzb6nJtK7NtDzIHx+w3YNIVpcTGLiUEsfUbY53IHg7Nl/p3/gkST3g0R6BSL7Hg45SfyvpH7kwY30MoVHG/6P3go4SKlYoHXlgaaNr3fMwUTIeE9ofvyS3fcr6xxlsoB6luKuEs50h0NGsE4QEnbfSY4Yd/C1ucc3mEw+QFXBIsENHfHfZYrLNHm2L8MXYVmAH8k//5sFs4Migln9GiUgEQUT6uOjowsZyXBbXwfT11og+syPkAq4eqjiC76r0w6faVihdBYVoc/UcyupgH azureuser@linuxvm"
}
]
}
}
}
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше