(packer): add option for managed image build

This commit is contained in:
Sean Knox 2018-04-07 10:38:33 -07:00
Родитель ff715d2869
Коммит 59b00c9ba6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4C461E0C1242AF66
2 изменённых файлов: 91 добавлений и 0 удалений

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

@ -0,0 +1,90 @@
{
"variables": {
"client_id": "{{env `AZURE_CLIENT_ID`}}",
"client_secret": "{{env `AZURE_CLIENT_SECRET`}}",
"tenant_id": "{{env `AZURE_TENANT_ID`}}",
"subscription_id": "{{env `AZURE_SUBSCRIPTION_ID`}}",
"location": "{{env `AZURE_LOCATION`}}",
"vm_size": "{{env `AZURE_VM_SIZE`}}"
},
"builders": [
{
"type": "azure-arm",
"client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}",
"tenant_id": "{{user `tenant_id`}}",
"subscription_id": "{{user `subscription_id`}}",
"managed_image_resource_group_name":
"{{user `managed_image_resource_group_name`}}",
"managed_image_name": "acstack-ubuntu-17.10-{{timestamp}}",
"os_type": "Linux",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "17.10",
"azure_tags": {
"dept": "Azure Container Service"
},
"location": "{{user `location`}}",
"vm_size": "{{user `vm_size`}}"
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo mkdir -p /opt/azure/containers",
"sudo chown -R $USER /opt/azure/containers"
]
},
{
"type": "file",
"source": "./prepare-vhd.sh",
"destination": "/home/packer/prepare-vhd.sh"
},
{
"type": "file",
"source": "./install-etcd.sh",
"destination": "/home/packer/install-etcd.sh"
},
{
"type": "file",
"source": "./acs-engine/kubernetes_mountetcd.sh",
"destination": "/opt/azure/containers/kubernetes_mountetcd.sh"
},
{
"type": "file",
"source": "./acs-engine/kubernetesmastercustomscript.sh",
"destination": "/opt/azure/containers/kubernetesmastercustomscript.sh"
},
{
"type": "file",
"source": "./acs-engine/kubernetesmastergenerateproxycertscript.sh",
"destination": "/opt/azure/containers/kubernetesmastergenerateproxycertscript.sh"
},
{
"type": "file",
"source": "./acs-engine/kubernetesprovisionsource.sh",
"destination": "/opt/azure/containers/provision_source.sh"
},
{
"type": "file",
"source": "./docker/daemon.json",
"destination": "$HOME/daemon.json"
},
{
"type": "shell",
"inline": [
"sudo /bin/bash -eux /home/packer/prepare-vhd.sh",
"sudo /bin/bash -eux /home/packer/install-etcd.sh",
"sudo mv $HOME/daemon.json /etc/docker",
"rm /home/packer/prepare-vhd.sh /home/packer/install-etcd.sh "
]
}
]
}

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

@ -4,6 +4,7 @@
"tenant_id": "",
"subscription_id": "",
"resource_group_name": "ACStackImages",
"managed_image_resource_group_name": "ACStackImages",
"location": "West US 2",
"vm_size": "Standard_D2_v2"
}