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

Not able to add custom ContainerPort to awx-task container #2004

Open
3 tasks done
Saravanaselvaraj opened this issue Dec 19, 2024 · 0 comments
Open
3 tasks done

Not able to add custom ContainerPort to awx-task container #2004

Saravanaselvaraj opened this issue Dec 19, 2024 · 0 comments

Comments

@Saravanaselvaraj
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 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.
Screenshot 2024-12-19 at 23 37 54

Actual results

The ports are not displayed/opened.
Screenshot 2024-12-19 at 23 39 59

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

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

1 participant