ansible/awx-operator

Not able to add custom ContainerPort to awx-task container

Open

#2004 aperta il 19 dic 2024

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)Jinja (712 fork)auto 404
communityhelp wanted

Metriche repository

Star
 (1488 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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 the AWX Operator is open source software provided for free and that I might not receive a timely response.

Bug Summary

Hi,

It is not possible to add custom ContainerPorts for the awx-task container. I am trying to add the ContainerPort directly in task.yaml.j2 as below.

    - image: '{{ _image }}'
      name: '{{ ansible_operator_meta.name }}-task'
      imagePullPolicy: '{{ image_pull_policy }}'

{% if task-ports %} ports: {% for port in task-ports %} - name: {{ port.name }} containerPort: {{ port.containerPort }} protocol: {{ port.protocol | default('TCP') }} {% endfor %} {% endif %}

I am passing the input in defaults/main.yml . task-ports:

  • name: receptor-ctrl containerPort: 27199
  • name: receptor-data containerPort: 27200

and it does not work. Looks like there is no way to add custom ports to the container level aline task_resource and web_resource. Please check.

AWX Operator version

2.12.1

AWX version

23.8.1

Kubernetes platform

kubernetes

Kubernetes/Platform version

v1.31.3-gke.1006000

Modifications

yes

Steps to reproduce

I added the below entries from ports: in the task.yaml.j2 - image: '{{ _image }}' name: '{{ ansible_operator_meta.name }}-task' imagePullPolicy: '{{ image_pull_policy }}' {% if task-ports %} ports: {% for port in task-ports %} - name: {{ port.name }} containerPort: {{ port.containerPort }} protocol: {{ port.protocol | default('TCP') }} {% endfor %} {% endif %}

and in roles/defaults/main.yaml task-ports:

  • name: receptor-ctrl containerPort: 27199
  • name: receptor-data containerPort: 27200

Expected results

For the awx-task container I should see two ports 27199 and 27200 as shown in the attached image.

Actual results

The ports are not displayed/opened.

Additional information

awx.yaml


apiVersion: v1 kind: Secret metadata: name: awx-admin-password namespace: awx type: Opaque data: password: YWRtaW4=

apiVersion: awx.ansible.com/v1beta1 kind: AWX metadata: name: awx namespace: awx spec: task_replicas: 2 admin_user: admin admin_password_secret: awx-admin-password service_type: NodePort ingress_type: none no_log: false

Operator Logs

No response

Guida contributor