mirror of
https://github.com/outbackdingo/ack-image-builder.git
synced 2026-01-27 02:18:08 +00:00
37
examples/ack-aliyunlinux2.json
Normal file
37
examples/ack-aliyunlinux2.json
Normal 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
|
||||
}
|
||||
]
|
||||
}
|
||||
8
hotfix/hotfix-ipvlan/README.md
Normal file
8
hotfix/hotfix-ipvlan/README.md
Normal 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
|
||||
```
|
||||
34
hotfix/hotfix-ipvlan/ack-aliyunlinux2-ipvlan.json
Normal file
34
hotfix/hotfix-ipvlan/ack-aliyunlinux2-ipvlan.json
Normal 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
|
||||
}
|
||||
]
|
||||
}
|
||||
8
hotfix/hotfix-ipvlan/scripts/installRPMs.sh
Executable file
8
hotfix/hotfix-ipvlan/scripts/installRPMs.sh
Executable 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
|
||||
11
hotfix/hotfix-ipvlan/scripts/updateConfig.sh
Executable file
11
hotfix/hotfix-ipvlan/scripts/updateConfig.sh
Executable 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
|
||||
Reference in New Issue
Block a user