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

Allow Kubernetes credentials on SCM inventories #15165

Open
6 of 9 tasks
David-Igou opened this issue May 2, 2024 · 3 comments
Open
6 of 9 tasks

Allow Kubernetes credentials on SCM inventories #15165

David-Igou opened this issue May 2, 2024 · 3 comments

Comments

@David-Igou
Copy link

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I might not receive a timely response.

Feature type

Enhancement to Existing Feature

Feature Summary

I am working with a usecase involving the kubevirt dynamic inventory plugin, which requires Kuberentes credentials be injected into the inventory sync, AWX does not allow the "Openshift/Kubernetes token" default credential type to be attached to inventories. The current workaround is to create a custom credential with the same behavior as the default one, which will be allowed, but feels quite silly.

Select the relevant components

  • UI
  • API
  • Docs
  • Collection
  • CLI
  • Other

Steps to reproduce

Create a SCM based inventory that leveraged an inventory plugin which requires to authenticate to a kubernetes API, ie kubevirt.core

Current results

User is unable to attach k8s token credentials

Sugested feature result

Users will have a consistent experience leveraging this inventory and not have to create a custom credential that is identical in behavior to a preexisting one because they arbitrarily cannot attach the default one to inventories

Additional information

With as many inventory plugins as we see present now, I don't really see a point in limiting what credential types can be attached to scm inventory sources at all.

@TheRealHaoLiu
Copy link
Member

agree, I did something similar before and had to create a custom credential type.

@TheRealHaoLiu
Copy link
Member

https://github.com/ansible/awx/blob/devel/awx/main/models/credential/__init__.py/#L1098-L1132
this is where the kubernetes credenetial type is defined

adding injector to this should work

contribution welcome, marking this issue as good first issue

@TheRealHaoLiu
Copy link
Member

dug a bit further... kuberentes credential type already has injector and usable in job template... fantastic

as for inventory source (type SCM)
the UI explicitly query /api/v2/credentials/?credential_type__kind=cloud...

reclassifying kubernetes credential from kubernetes to "cloud" would allow us to use kubernetes credential to be use in inventory source...

but im not sure if that's the right way to do this... @chrismeyersfsu @AlanCoding thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants