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

kubernetes.core.helm supports OCI registry #578

Open
willzhang opened this issue Jan 31, 2023 · 0 comments · May be fixed by #601
Open

kubernetes.core.helm supports OCI registry #578

willzhang opened this issue Jan 31, 2023 · 0 comments · May be fixed by #601
Assignees
Labels
topic/helm Issues relating to helm plugins type/enhancement New feature or request

Comments

@willzhang
Copy link

willzhang commented Jan 31, 2023

SUMMARY

support helm registry login

# helm registry --help

This command consists of multiple subcommands to interact with registries.

Usage:
  helm registry [command]

Available Commands:
  login       login to a registry
  logout      logout from a registry

the feature like this: registry_username registry_password

- name: Install nginx
  kubernetes.core.helm:
    chart_ref: oci://registry.hub/helm-charts/nginx
    chart_version: 13.2.22
    registry_username: admin
    registry_password: 123456
ISSUE TYPE

i have try this
#429 (comment)

- name: Install nginx
  kubernetes.core.helm:
    chart_ref: oci://registry.hub/helm-charts/nginx
    chart_version: 13.2.22
    create_namespace: true
    release_name: nginx
    release_namespace: nginx
    release_state: present

but i have a docker registry with basic auth, so it error with 401 Unauthorized

root@945914a03027:/kubespray# ansible-playbook -i inventory/mycluster/inventory.ini nginx.yml 
[WARNING]: Skipping callback plugin 'ara_default', unable to load

PLAY [kube_control_plane[0]] ***************************************************************************************************************************************************
Tuesday 31 January 2023  10:22:26 +0000 (0:00:00.053)       0:00:00.053 ******* 

TASK [kubernetes-apps/nginx : Install nginx] ***********************************************************************************************************************************
fatal: [node1]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "command": "/usr/local/bin/helm --version=13.2.22 show chart oci://kubespray.hub/helm-charts/nginx", "msg": "Failure when executing Helm command. Exited 1.\nstdout: \nstderr: Error: pulling from host kubespray.hub failed with status code [manifests 13.2.22]: 401 Unauthorized\n", "stderr": "Error: pulling from host kubespray.hub failed with status code [manifests 13.2.22]: 401 Unauthorized\n", "stderr_lines": ["Error: pulling from host kubespray.hub failed with status code [manifests 13.2.22]: 401 Unauthorized"], "stdout": "", "stdout_lines": []}

PLAY RECAP *********************************************************************************************************************************************************************
node1                      : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

Tuesday 31 January 2023  10:22:27 +0000 (0:00:00.785)       0:00:00.839 ******* 
=============================================================================== 
kubernetes-apps/nginx : Install nginx ----------------------------------------------------------------------------------------------------------------------------------- 0.79s
root@945914a03027:/kubespray# nano roles/kubernetes-apps/nginx/tasks/main.yml 

temporary solution

- name: login helm registry
  shell: "{{ bin_dir }}/helm registry login registry.hub -u admin -p Registry12345"

COMPONENT NAME

kubernetes.core.helm

ADDITIONAL INFORMATION

helm registry login will support oci registry like docker registry or harbor registry with username and password.

@abikouo abikouo added type/enhancement New feature or request topic/helm Issues relating to helm plugins labels Jan 31, 2023
@abikouo abikouo self-assigned this Mar 28, 2023
@abikouo abikouo linked a pull request Mar 28, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/helm Issues relating to helm plugins type/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants