Skip to content

fix(helm): add pyyaml install task for fedora coreos #12269

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LiquidPL
Copy link

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change

/kind bug

/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:

As per ansible/ansible#69064 (comment) and https://docs.ansible.com/ansible/latest/collections/community/general/atomic_container_module.html, the package Ansible module on Fedora CoreOS uses the atomic_package module which is deprecated and doesn't handle rpm-ostree well. This PR adds a separate task for installing PyYAML in the kubernetes-apps/helm role specific to FCOS.
Which issue(s) this PR fixes:

Fixes #10885

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

The `package` ansible module uses the deprecated
`atomic_container` module for managing FCOS packages.

This commit switches FCOS to use the
`community.general_rpm_ostree_pkg` module instead.
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. labels May 28, 2025
Copy link

linux-foundation-easycla bot commented May 28, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label May 28, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

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
Copy link
Contributor

Welcome @LiquidPL!

It looks like this is your first PR to kubernetes-sigs/kubespray 🎉. 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/kubespray 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 k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 28, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @LiquidPL. 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.

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 requested review from tico88612 and yankay May 28, 2025 22:20
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 28, 2025
@tico88612
Copy link
Member

/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 May 29, 2025
Copy link
Member

@tico88612 tico88612 left a comment

Choose a reason for hiding this comment

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

Can't CoreOS use package? EDIT: nevermind let me read description

@yankay
Copy link
Member

yankay commented Jun 3, 2025

have a question.

From #10165, pyyaml was introduced during the Helm installation process. However, pyyaml is not a required dependency of Helm. Recently, there have been multiple PRs addressing this dependency that seem to have caused some complications, such as:

Therefore, would it be more reasonable to remove pyyaml from the Helm installation process?

Do you mind share your thoughts, @tico88612 @VannTen. :-)

@tico88612
Copy link
Member

@yankay PyYAML is not dependency of Helm, but if we need to use kubernetes.core.helm, it's required.

https://docs.ansible.com/ansible/latest/collections/kubernetes/core/helm_module.html

@LiquidPL
Copy link
Author

LiquidPL commented Jun 3, 2025

Can't CoreOS use package? EDIT: nevermind let me read description

Yeah, from my testing package doesn't seem to work. However, through some extra testing I realized that my PR also sometimes breaks due to the usage of package_facts:

fatal: [homelab-control-plane-test-hva]: FAILED! => {"changed": false, "msg": "Could not detect a supported package manager from the following list: ['rpm'], or the required Python library is not installed. Check warnings for details."}

I believe that CoreOS is specific and minimal enough that it just doesn't work with regular Ansible tooling.

@LiquidPL LiquidPL marked this pull request as draft June 3, 2025 13:38
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 3, 2025
@VannTen
Copy link
Contributor

VannTen commented Jun 5, 2025

Therefore, would it be more reasonable to remove pyyaml from the Helm installation process?

Do you mind share your thoughts, @tico88612 @VannTen. :-)

My opinion is that long term, we should remove any templating on the managed hosts and use exclusively

- command: kubectl apply -f - --server-side=true
  stdin: "{{ expanded resources }}" -> where this could be helm templates, kustomize output -> templating on the ansible control node.

(as we can see in #12254 , helm is a can of worms)

@VannTen
Copy link
Contributor

VannTen commented Jun 5, 2025

On the other for the short term, installing packages should probably go in system_packages even if the package modules is not usable, and use the same filtering logic as the rest.

@LiquidPL
Copy link
Author

LiquidPL commented Jun 15, 2025

I could move this to the system_packages role, although from what I can see, it is completely broken on CoreOS. I would need to do some further testing, but whenever my system would need any extra packages, the role would fail.

The way I see it, FCOS would need custom handling anyway, either using the community.general.rpm_ostree_pkg module, like I did in this PR, or with plain rpm-ostree calls like it's done in bootstrap_os. Would it be acceptable if I added custom logic for that distro inside that role?

@VannTen
Copy link
Contributor

VannTen commented Jun 15, 2025 via email

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/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fedora CoreOS fails to install PyYAML
5 participants