mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
k8s inventory: add pod nodeport (#39107)
Node port field is not populated on K8S pods, and it's certainely the most useful port to use in pod when we need to interact with ansible outside of the cluster
This commit is contained in:
parent
cb547df261
commit
176ebfd471
1 changed files with 2 additions and 1 deletions
|
@ -212,7 +212,8 @@ class K8sInventoryHelper(object):
|
|||
ports = [{'name': port.name,
|
||||
'port': port.port,
|
||||
'protocol': port.protocol,
|
||||
'targetPort': port.target_port} for port in service.spec.ports]
|
||||
'targetPort': port.target_port,
|
||||
'nodePort': port.node_port} for port in service.spec.ports]
|
||||
|
||||
# add hostvars
|
||||
self.inventory.set_variable(service_name, 'object_type', 'service')
|
||||
|
|
Loading…
Reference in a new issue