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

v2.26.0 - Environment with proxy - installation of required packages is not working #11825

Open
kamszp opened this issue Dec 20, 2024 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@kamszp
Copy link

kamszp commented Dec 20, 2024

What happened?

Collection version v2.26.0

For environment with proxy installation process is giving error on task:
TASK [kubernetes_sigs.kubespray.kubernetes/preinstall : Install packages requirements]

Proxy is probably blocked by setting environment proxy_disable_env in playbooks/cluster.yml:

environment: "{{ proxy_disable_env }}"

where role: kubernetes/preinstall is invoked.

What did you expect to happen?

Packages should be installed with proxy, it will happen when I do workaround:

ansible-playbook deploy.yml

where deploy.yml:

- name: Deploy
  hosts: k8s_servers
  gather_facts: false
  tasks:
    - name: Fix Kubespray proxy issue
      ansible.builtin.lineinfile:
        path: "{{ lookup('ansible.builtin.config', 'COLLECTIONS_PATHS') | first }}/ansible_collections/kubernetes_sigs/kubespray/playbooks/cluster.yml"
        regexp: '^\s+environment: '
        line: !unsafe "  environment: \"{{ proxy_env }}\""
        state: present
        firstmatch: true
      delegate_to: localhost
      run_once: true

- import_playbook: kubernetes_sigs.kubespray.cluster.yml

How can we reproduce it (as minimally and precisely as possible)?

Run cluster.yml playbook without workaround (like I showed above).

OS

Red Hat Enterprise Linux release 8.10 (Ootpa)

Version of Ansible

ansible [core 2.16.8]
config file = /home/ansible/deploy/ansible.cfg
configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/ansible/.local/lib/python3.11/site-packages/ansible
ansible collection location = /home/ansible/deploy/collections
executable location = /home/ansible/.local/bin/ansible
python version = 3.11.10 (main, Sep 24 2024, 09:33:51) [GCC 8.5.0 20210514 (Red Hat 8.5.0-22)] (/usr/bin/python3.11)
jinja version = 3.1.4
libyaml = True

Version of Python

Python 3.11.10

Version of Kubespray (commit)

f9ebd45

Network plugin used

flannel

Full inventory with variables

Default kubespray-2.26.0 variables and proxy for all hosts:
"http_proxy": "http://10.54.4.28:3128",
"https_proxy": "http://10.54.4.28:3128",
no_proxy": "127.0.0.1,localhost,localaddress,.localdomain.com"

Command used to invoke ansible

In section "What did you expect to happen?"

Output of ansible run

TASK [kubernetes_sigs.kubespray.kubernetes/preinstall : Install packages requirements] ***************************************************************************
Thursday 19 December 2024 12:53:38 +0100 (0:00:00.105) 0:02:23.314 *****
FAILED - RETRYING: [k8s-px-2]: Install packages requirements (4 retries left).
FAILED - RETRYING: [k8s-px-3]: Install packages requirements (4 retries left).
FAILED - RETRYING: [k8s-px-1]: Install packages requirements (4 retries left).
FAILED - RETRYING: [k8s-px-2]: Install packages requirements (3 retries left).
FAILED - RETRYING: [k8s-px-1]: Install packages requirements (3 retries left).
FAILED - RETRYING: [k8s-px-3]: Install packages requirements (3 retries left).
FAILED - RETRYING: [k8s-px-2]: Install packages requirements (2 retries left).
FAILED - RETRYING: [k8s-px-1]: Install packages requirements (2 retries left).
FAILED - RETRYING: [k8s-px-3]: Install packages requirements (2 retries left).
FAILED - RETRYING: [k8s-px-2]: Install packages requirements (1 retries left).
FAILED - RETRYING: [k8s-px-1]: Install packages requirements (1 retries left).
FAILED - RETRYING: [k8s-px-3]: Install packages requirements (1 retries left).
fatal: [k8s-px-2]: FAILED! => {
"attempts": 4,
"changed": false,
"rc": 1,
"results": []
}

MSG:

Failed to download metadata for repo 'myrepo': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
fatal: [k8s-px-1]: FAILED! => {
"attempts": 4,
"changed": false,
"rc": 1,
"results": []
}

MSG:

Failed to download metadata for repo 'myrepo': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
fatal: [k8s-px-3]: FAILED! => {
"attempts": 4,
"changed": false,
"rc": 1,
"results": []
}

MSG:

Failed to download metadata for repo 'myrepo': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

Anything else we need to know

No response

@kamszp kamszp added the kind/bug Categorizes issue or PR as related to a bug. label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

1 participant