我正在尝试使用带有一些自定义 cloud-init 配置的 CoreOS 稳定 AMI 设置 EC2 实例,但遇到了一些问题。
#cloud-config
coreos:
etcd:
discovery: https://discovery.etcd.io/5996f1b49fd642c5d1bc2f62cbff2fba
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
write_files:
- path: /etc/fleet/fleet.conf
content: |
public_ip="$private_ipv4"
metadata="elastic_ip=true,public_ip=$public_ipv4"
上面的云配置工作正常,但是一旦我使用下面的云配置
#cloud-config
coreos:
etcd:
discovery: https://discovery.etcd.io/5996f1b49fd642c5d1bc2f62cbff2fba
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
users:
- name: core
coreos-ssh-import-github: oba11
write_files:
- path: /etc/fleet/fleet.conf
content: |
public_ip="$private_ipv4"
metadata="elastic_ip=true,public_ip=$public_ipv4"
或者
#cloud-config
coreos:
etcd:
discovery: https://discovery.etcd.io/5996f1b49fd642c5d1bc2f62cbff2fba
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
users:
- name: oba11
groups:
- sudo
- docker
coreos-ssh-import-github: oba11
write_files:
- path: /etc/fleet/fleet.conf
content: |
public_ip="$private_ipv4"
metadata="elastic_ip=true,public_ip=$public_ipv4"
我无法使用我的 aws 密钥对或个人密钥作为“核心”用户再次 SSH 到 coreos 实例,并使用我的个人密钥创建用户“oba11”。我也尝试了 alpha AMI,但同样的问题。我不知道我是否做错了什么。
非常感谢您的帮助。