0

我正在尝试为 AWS EKS 托管节点组构建自定义映像,注意:我的自定义映像 (ubuntu) 已经启用了 MFA 和基于私钥的身份验证。

我克隆了 github 存储库以从以下 url 构建与 eks 相关的更改。

git clone https://github.com/awslabs/amazon-eks-ami && cd amazon-eks-ami

接下来我做了一些更改来运行make文件

cat eks-worker-al2.json
{
  "variables": {
    "aws_region": "eu-central-1",
    "ami_name": "template",
    "creator": "{{env `USER`}}",
    "encrypted": "false",
    "kms_key_id": "",
    "aws_access_key_id": "{{env `AWS_ACCESS_KEY_ID`}}",
    "aws_secret_access_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
    "aws_session_token": "{{env `AWS_SESSION_TOKEN`}}",
    "binary_bucket_name": "amazon-eks",
    "binary_bucket_region": "eu-central-1",
    "kubernetes_version": "1.20",
    "kubernetes_build_date": null,
    "kernel_version": "",
    "docker_version": "19.03.13ce-1.amzn2",
    "containerd_version": "1.4.1-2.amzn2",
    "runc_version": "1.0.0-0.3.20210225.git12644e6.amzn2",
    "cni_plugin_version": "v0.8.6",
    "pull_cni_from_github": "true",
    "source_ami_id": "ami-12345678",
    "source_ami_owners": "00012345",
    "source_ami_filter_name": "template",
    "arch": null,
    "instance_type": null,
    "ami_description": "EKS Kubernetes Worker AMI with AmazonLinux2 image",
    "cleanup_image": "true",
    "ssh_interface": "",
    "ssh_username": "nandu",
    "ssh_private_key_file": "/home/nandu/.ssh/template_rsa.ppk",
    "temporary_security_group_source_cidrs": "",
    "security_group_id": "sg-08725678910",
    "associate_public_ip_address": "",
    "subnet_id": "subnet-01273896789",
    "remote_folder": "",
    "launch_block_device_mappings_volume_size": "4",
    "ami_users": "",
    "additional_yum_repos": "",
    "sonobuoy_e2e_registry": ""

添加用户和私钥构建失败并出现以下错误后。

日志

amazon-ebs: Error waiting for SSH: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain.
4

1 回答 1

0

对我来说,只需更改 aws 的区域或删除打包程序中的 aws 区域。

于 2021-10-06T17:21:47.633 回答