Signed-off-by: haoshuwei <haoshuwei24@gmail.com>
This commit is contained in:
haoshuwei
2020-07-16 17:31:34 +08:00
parent 71dc34b9c7
commit 0ed106e972
5 changed files with 98 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
{
"variables": {
"region": "cn-hangzhou",
"image_name": "test_image{{timestamp}}",
"source_image": "aliyun_2_1903_x64_20G_uefi_alibase_20200616.vhd",
"instance_type": "ecs.g6.large",
"access_key": "{{env `ALICLOUD_ACCESS_KEY`}}",
"secret_key": "{{env `ALICLOUD_SECRET_KEY`}}"
},
"builders": [
{
"type": "alicloud-ecs",
"access_key": "{{user `access_key`}}",
"secret_key": "{{user `secret_key`}}",
"region": "{{user `region`}}",
"image_name": "{{user `image_name`}}",
"source_image": "{{user `source_image`}}",
"ssh_username": "root",
"instance_type": "{{user `instance_type`}}",
"skip_image_validation": "true",
"io_optimized": "true"
}
],
"provisioners": [
{
"type": "shell",
"scripts": [
"scripts/updateKernel.sh",
"scripts/reboot.sh",
"scripts/cleanUpKerneles.sh",
"config/default.sh",
"scripts/verify.sh"
],
"expect_disconnect": true
}
]
}

View File

@@ -0,0 +1,8 @@
This is the template for ack base image to fix issue [#19](https://github.com/AliyunContainerService/ack-image-builder/issues/19)
Commands to build image:
```
export ALICLOUD_ACCESS_KEY=XXX
export ALICLOUD_SECRET_KEY=XXX
packer build ack-aliyunlinux2-ipvlan.json
```

View File

@@ -0,0 +1,34 @@
{
"variables": {
"region": "cn-hangzhou",
"image_name": "test_image{{timestamp}}",
"source_image": "aliyun_2_1903_x64_20G_alibase_20200529.vhd",
"instance_type": "ecs.g6.large",
"access_key": "{{env `ALICLOUD_ACCESS_KEY`}}",
"secret_key": "{{env `ALICLOUD_SECRET_KEY`}}"
},
"builders": [
{
"type": "alicloud-ecs",
"access_key": "{{user `access_key`}}",
"secret_key": "{{user `secret_key`}}",
"region": "{{user `region`}}",
"image_name": "{{user `image_name`}}",
"source_image": "{{user `source_image`}}",
"ssh_username": "root",
"instance_type": "{{user `instance_type`}}",
"skip_image_validation": "true",
"io_optimized": "true"
}
],
"provisioners": [
{
"type": "shell",
"scripts": [
"scripts/installRPMs.sh",
"scripts/updateConfig.sh"
],
"expect_disconnect": true
}
]
}

View File

@@ -0,0 +1,8 @@
#!/bin/bash
curl -LO http://xxx.xx.xx.xxx/kernel-4.19.91-0.1.git.6eb3a5047051.al7.x86_64.rpm
curl -LO http://xxx.xx.xx.xxx/kernel-headers-4.19.91-0.1.git.6eb3a5047051.al7.x86_64.rpm
yum localinstall -y kernel-4.19.91-0.1.git.6eb3a5047051.al7.x86_64.rpm kernel-headers-4.19.91-0.1.git.6eb3a5047051.al7.x86_64.rpm
rm -rf kernel-4.19.91-0.1.git.6eb3a5047051.al7.x86_64.rpm kernel-headers-4.19.91-0.1.git.6eb3a5047051.al7.x86_64.rpm

View File

@@ -0,0 +1,11 @@
#!/bin/sh
/usr/sbin/sysctl -w net.ipv4.vs.conn_reuse_mode=1
# 如果压测出现客户端分配不到端口可以改成2
EOF
chmod +x /root/set-ipvs-sysctls.sh
echo '*/1 * * * * root bash /root/set-ipvs-sysctls.sh' >> /etc/cron.d/setsysctl
systemctl reload crond
systemctl restart crond