Skip to content

Use k8s-admin user and disable root SSH for s390x VPC and VSI resources#71

Open
sudharshanibm wants to merge 1 commit intokubernetes-sigs:mainfrom
sudharshanibm:test-user
Open

Use k8s-admin user and disable root SSH for s390x VPC and VSI resources#71
sudharshanibm wants to merge 1 commit intokubernetes-sigs:mainfrom
sudharshanibm:test-user

Conversation

@sudharshanibm
Copy link
Copy Markdown

  • Disable root SSH access on newly created VPC–VSI instances
  • Introduce and use a dedicated non-root user k8s-admin for all automation
  • Grant required privileges via sudo (wheel group), instead of direct root login
  • Remove any dependency on ansible_become_user: root

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sudharshanibm
Once this PR has been reviewed and has the lgtm label, please assign prajyot-parab for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 24, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @sudharshanibm!

It looks like this is your first PR to kubernetes-sigs/provider-ibmcloud-test-infra 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/provider-ibmcloud-test-infra has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @sudharshanibm. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 24, 2026
@kishen-v
Copy link
Copy Markdown
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 13, 2026
@kishen-v
Copy link
Copy Markdown
Contributor

/test-pull-provider-ibmcloud-test-infra-kubernetes

@kishen-v
Copy link
Copy Markdown
Contributor

/test pull-provider-ibmcloud-test-infra-kubernetes

@kishen-v
Copy link
Copy Markdown
Contributor

/hold
/lgtm
/cc @Prajyot-Parab for a final review.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 24, 2026
@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Mar 24, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

@sudharshanibm sudharshanibm force-pushed the test-user branch 3 times, most recently from 012ea44 to ce623e8 Compare March 30, 2026 15:50
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 30, 2026
@sudharshanibm sudharshanibm force-pushed the test-user branch 4 times, most recently from ac40e59 to 97e3ce5 Compare March 30, 2026 17:57
@kishen-v
Copy link
Copy Markdown
Contributor

Please squash the commits.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 31, 2026
@sudharshanibm
Copy link
Copy Markdown
Author

Hi @kishen-v
Squashed the commits

Comment thread kubetest2-tf/deployer/deployer.go Outdated
[workers:vars]
ansible_user=k8s-admin
ansible_become=true
ansible_become_method=sudo
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sudharshanibm , just a thought. We're setting the same set of values under hosts.yml and the group_vars/all through deployer.go.

Based on the comment Extra-vars have the highest precedence in Ansible, so this overrides, setting them in group-vars alone should suffice?

https://github.com/kubernetes-sigs/provider-ibmcloud-test-infra/pull/71/changes#diff-fada1d1362e2ff82c6c7888d1d53ca5489fe572092a62f014d23a1be1b4ae38aR365-R369

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @kishen-v removed the redundant inventory template vars

@sudharshanibm sudharshanibm force-pushed the test-user branch 3 times, most recently from 0b647b4 to e2fdabe Compare April 6, 2026 06:19
Comment thread kubetest2-tf/deployer/deployer.go Outdated
// has disabled root SSH access for new VPC-VSI instances.
// Extra-vars have the highest precedence in Ansible, so this overrides
// the ansible_user: root in group_vars/all (shared with PowerVS).
if d.TargetProvider == "vpc" {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we pass these variables while calling the tf command itself as an extra-vars argument..

Copy link
Copy Markdown
Author

@sudharshanibm sudharshanibm Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @mkumatag
removed this block and updated the job config in test-infra to pass these values directly via --extra-vars
here is the related PR for test-infra

Comment thread kubetest2-tf/deployer/deployer.go Outdated

// Add-in the extra-vars set to the final set.
maps.Insert(combinedAnsibleVars, maps.All(d.ExtraVars))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the new lines.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the implications of these changes on PowerVS? Why are they needed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added it only to test whether returning an error instead of calling os.Exit(1) would work better with the periodic job wiring in kubernetes/test-infra#36659 but that did not fix the issue
reverting this so there is no unintended behavioral change for PowerVS from this PR

@sudharshanibm sudharshanibm force-pushed the test-user branch 4 times, most recently from 92bfcc8 to 620f61a Compare April 9, 2026 17:45
Create a non-root k8s-admin account on instances and update Terraform/Ansible to use it.

Signed-off-by: Sudharshan Muralidharan <sudharshan.muralidharan1@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants