Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ec2-user not used on Amazon Linux AMI #536

Closed
sfzylad opened this issue Jan 31, 2019 · 4 comments · Fixed by #541
Closed

ec2-user not used on Amazon Linux AMI #536

sfzylad opened this issue Jan 31, 2019 · 4 comments · Fixed by #541
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@sfzylad
Copy link
Contributor

sfzylad commented Jan 31, 2019

/kind bug

What steps did you take and what happened:
Once our Amazon Linux 2 AMI is used, the default user to be used with Amazon Linux is centos. The default user supported by AWS is ec2-user and is present in the system we provide. It's that cloud-init is comnfigured to use centos user:

# cat /etc/cloud/cloud.cfg
[...]
# System and/or distro specific settings
# (not accessible to handlers/transforms)
system_info:
   # This will affect which distro class gets used
   distro: centos
   # Default user name + that default users groups (if added/used)
   default_user:
     name: centos # <--- here's where the problem is
     lock_passwd: True
     gecos: centos Cloud User # <--- this should be changed too
     groups: [wheel, adm, systemd-journal]
     sudo: ["ALL=(ALL) NOPASSWD:ALL"]
     shell: /bin/bash
   # Other config here will be given to the distro class and/or path classes
   paths:
      cloud_dir: /var/lib/cloud/
      templates_dir: /etc/cloud/templates/
   ssh_svcname: sshd

What did you expect to happen:
When instance uses Amazon Linux, ec2-user system user should be used to loggin the instance.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api-provider-aws version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):
@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 31, 2019
@detiber
Copy link
Member

detiber commented Jan 31, 2019

/assign
/priority important-soon
/milestone v1alpha1

@k8s-ci-robot k8s-ci-robot added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Jan 31, 2019
@detiber detiber added this to the v1alpha1 milestone Jan 31, 2019
@detiber
Copy link
Member

detiber commented Jan 31, 2019

/lifecycle active

@k8s-ci-robot k8s-ci-robot added the lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. label Jan 31, 2019
@detiber
Copy link
Member

detiber commented Jan 31, 2019

/remove-lifecycle active

It looks like the cloud-init config is populated at compile time, this will either require a separate build of cloud-init for Amazon Linux 2 or it will require some additional modifications in ansible post install to modify the config.

@k8s-ci-robot k8s-ci-robot removed the lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. label Jan 31, 2019
@sfzylad
Copy link
Contributor Author

sfzylad commented Feb 1, 2019

/lifecycle active

@k8s-ci-robot k8s-ci-robot added the lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. label Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
3 participants