Skip to content

Build custom ecs image for kubernetes node with dind packer.

License

Notifications You must be signed in to change notification settings

NUCsimple/custom-image-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom-image-builder

Overview

Custom-image-builder aims to help users quickly build their own system images in a docker environment. Now we support two ways to build system image:

  • Parametric construction of the mirror, the customer enters the required fields to complete the construction.
  • The customer himself mounts alicloud.json through the volume to complete the construction with the container.

Prerequisites

Supported OS

  • CentOS 7.6/7.7
  • Aliyun Linux 2 (Alibaba Cloud Linux 2)

Usage:

1.Use build.sh

$ bash build.sh example/ack-centos.json 

required:

2.Build the OS image By mounting custom alicloud.json

$ docker run -v $hostPath:$containerPath registry.aliyuncs.com/acs/custom-sys-image:v1.0.0  $containerPath/alicloud.json

Verify


When executing the build task, as follows: building


The system image is built, as follows: down

RAM Policy

If you are using a sub account,the ram policy should at least include actions as below:

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:DescribeImages",
                "ecs:CreateImage",
                "ecs:ModifyImageSharePermission",
                "ecs:CreateKeyPair",
                "ecs:DeleteKeyPairs",
                "ecs:DetachKeyPair",
                "ecs:AttachKeyPair",
                "ecs:CreateSecurityGroup",
                "ecs:DeleteSecurityGroup",
                "ecs:AuthorizeSecurityGroupEgress",
                "ecs:AuthorizeSecurityGroup",
                "ecs:CreateSnapshot",
                "ecs:AttachDisk",
                "ecs:DetachDisk",
                "ecs:DescribeDisks",
                "ecs:CreateDisk",
                "ecs:DeleteDisk",
                "ecs:CreateNetworkInterface",
                "ecs:DescribeNetworkInterfaces",
                "ecs:AttachNetworkInterface",
                "ecs:DetachNetworkInterface",
                "ecs:DeleteNetworkInterface",
                "ecs:DescribeInstanceAttribute",
                "ecs:CreateInstance",
                "ecs:DeleteInstance",
                "ecs:StartInstance",
                "ecs:StopInstance",
                "ecs:DescribeInstances"
            ],
            "Resource": [
                "*"
            ],
            "Effect": "Allow"
        },
        {
            "Action": [
                "vpc:CreateVpc",
                "vpc:DeleteVpc",
                "vpc:DescribeVpcs",
                "vpc:CreateVSwitch",
                "vpc:DeleteVSwitch",
                "vpc:DescribeVSwitches",
                "vpc:AllocateEipAddress",
                "vpc:AssociateEipAddress",
                "vpc:UnassociateEipAddress",
                "vpc:DescribeEipAddresses",
                "vpc:ReleaseEipAddress"
            ],
            "Resource": [
                "*"
            ],
            "Effect": "Allow"
        }
    ]
}

More information

About

Build custom ecs image for kubernetes node with dind packer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published