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

Agree on solution for community.kubernetes.helm and kubectl #47

Closed
2 tasks
AlanCoding opened this issue Jul 13, 2020 · 5 comments
Closed
2 tasks

Agree on solution for community.kubernetes.helm and kubectl #47

AlanCoding opened this issue Jul 13, 2020 · 5 comments
Labels
priority:high question Further information is requested

Comments

@AlanCoding
Copy link
Member

In #22 we discussed how we may use bindep to process system dependencies, and how this will resolve into a set of dnf installs.

Importantly, this would have allowed for a consistent set of requirements, consistently using the system package manager.

We have identified our first notable exception.

https://github.com/ansible-collections/community.kubernetes/blob/3e971e0ad36a05a9ad63f442204c2dd59bbf558e/plugins/modules/helm.py#L23

The community.kubernetes.helm module, unsurprisingly, requires helm. This is not available as a dnf package to be installed, and to get it on a supported OS like RHEL, steps look like this:

https://snapcraft.io/install/helm/rhel

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo dnf upgrade
sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"
sudo yum update
sudo yum install snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap

(tl;dr it requires a different package manager, snap, so install snap, then install helm)

We don't have any need for this particular module in the AWX internals, but we do have a need for community.kubernetes, since it's a primary dependency for OpenShift-native job isolation https://github.com/ansible/awx/blob/2385e47ac313110235758c098ca0188fb430f5a6/requirements/collections_requirements.yml#L11

How could this possibly be handled?

  • allow collection-level metadata to specify "additional build steps" and dump whatever they need in there
  • don't attempt to support this requirement, leave as exercise for user

Even assuming that we can get away with not supporting this, kubectl itself may be a problem, see the AWX solution:

https://github.com/ansible/awx/blob/89b087ffb61ed5cbad2360329e7e28abd5b6ba25/installer/roles/image_build/templates/Dockerfile.j2#L143-L145

Note that this is a little more than a blind dnf install command. So we might need some increased form of flexibility even to support this.

@AlanCoding AlanCoding added the question Further information is requested label Jul 30, 2020
@AlanCoding
Copy link
Member Author

I should link this:

https://kubernetes.io/docs/tasks/tools/install-kubectl/

I wanted to create a first-draft that just installs kubectl, but I don't see how I can do that.

Do we have to accomplish this entirely through append steps? Or add a new feature to ansible-builder?

@AlanCoding
Copy link
Member Author

the primary issue of kubectl is addressed for upstream in ansible/ansible-runner#502 by switching the base to Fedora.

Downstream versions will have to add extra steps to enable this repo to get the RPM from.

@AlanCoding
Copy link
Member Author

However, all that does is unblock #67.

@AlanCoding
Copy link
Member Author

Alright, I think we've settled the questions and I'll open a PR soon in the collection.

@AlanCoding
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:high question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant