kubernetes-sigs / kubespray

Deploy a Production Ready Kubernetes Cluster
Apache License 2.0
15.7k stars 6.38k forks source link

Argo-CD Addon Error #8816

Closed klap50 closed 1 year ago

klap50 commented 2 years ago

ERROR: TASK [kubernetes-apps/argocd : Kubernetes Apps | Set ArgoCD namespace for remote manifests] *** failed: [master] (item=argocd-install.yml) => {"ansible_loop_var": "item", "changed": false, "cmd": "/usr/local/bin/yq eval-all -i '.metadata.namespace=\"argocd\"' /etc/kubernetes/argocd-install.yml", "item": {"file": "argocd-install.yml", "name": "install", "namespace": "argocd", "url": "https://raw.githubusercontent.com/argoproj/argo-cd/v2.3.3/manifests/install.yaml"}, "msg": "[Errno 8] Exec format error: b'/usr/local/bin/yq'", "rc": 8, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

i tink cant create namespace.

Environment:

Kubespray version (commit) (git rev-parse --short HEAD): HEAD

Network plugin used: CNI

Full inventory with variables (ansible -i inventory/sample/inventory.ini all -m debug -a "var=hostvars[inventory_hostname]"):

Command used to invoke ansible: ansible-playbook -i inventory/fwc/hosts.yaml -u root --become --become-user=root cluster.yml

Output of ansible run:

TASK [kubernetes-apps/argocd : Kubernetes Apps | Set ArgoCD namespace for remote manifests] *** failed: [master] (item=argocd-install.yml) => {"ansible_loop_var": "item", "changed": false, "cmd": "/usr/local/bin/yq eval-all -i '.metadata.namespace=\"argocd\"' /etc/kubernetes/argocd-install.yml", "item": {"file": "argocd-install.yml", "name": "install", "namespace": "argocd", "url": "https://raw.githubusercontent.com/argoproj/argo-cd/v2.3.3/manifests/install.yaml"}, "msg": "[Errno 8] Exec format error: b'/usr/local/bin/yq'", "rc": 8, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

oomichi commented 2 years ago

On my local env of Ubuntu 18.04, ArgoCD deployment succeeds like

TASK [kubernetes-apps/argocd : Kubernetes Apps | Install yq] *******************
changed: [k8s-1]
Monday 16 May 2022  22:47:54 +0000 (0:00:06.504)       0:19:23.715 ************ 

TASK [kubernetes-apps/argocd : Kubernetes Apps | Set ArgoCD template list] *****
ok: [k8s-1]
Monday 16 May 2022  22:47:54 +0000 (0:00:00.044)       0:19:23.760 ************ 

TASK [kubernetes-apps/argocd : Kubernetes Apps | Download ArgoCD remote manifests] ***
changed: [k8s-1] => (item=argocd-install.yml)
Monday 16 May 2022  22:47:56 +0000 (0:00:01.214)       0:19:24.974 ************ 

TASK [kubernetes-apps/argocd : Kubernetes Apps | Set ArgoCD namespace for remote manifests] ***
changed: [k8s-1] => (item=argocd-install.yml)
Monday 16 May 2022  22:47:56 +0000 (0:00:00.409)       0:19:25.384 ************ 

TASK [kubernetes-apps/argocd : Kubernetes Apps | Create ArgoCD manifests from templates] ***
changed: [k8s-1] => (item=argocd-namespace.yml)
Monday 16 May 2022  22:47:57 +0000 (0:00:00.665)       0:19:26.049 ************ 

TASK [kubernetes-apps/argocd : Kubernetes Apps | Install ArgoCD] ***************
ok: [k8s-1] => (item={'name': 'namespace', 'file': 'argocd-namespace.yml'})
ok: [k8s-1] => (item={'name': 'install', 'file': 'argocd-install.yml', 'namespace': 'argocd', 'url': 'https://raw.githubusercontent.com/argoproj/argo-cd/v2.1.6/manifests/install.yaml'})
Monday 16 May 2022  22:47:59 +0000 (0:00:02.211)       0:19:28.261 ************ 

Kubespray commit: 632d457f78f3f928138f7e03b0e4d6fc8fa56b53 CPU architecture: AMD64

oomichi commented 2 years ago

The problematic command was

/usr/local/bin/yq eval-all -i '.metadata.namespace="argocd"' /etc/kubernetes/argocd-install.yml

The command tried to replace .metadata.namespace with "argocd" and failed on /etc/kubernetes/argocd-install.yml. /etc/kubernetes/argocd-install.yml looks like

# This is an auto-generated file. DO NOT EDIT
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  labels:
    app.kubernetes.io/name: applications.argoproj.io
    app.kubernetes.io/part-of: argocd
  name: applications.argoproj.io
  namespace: argocd
spec:
  group: argoproj.io
  ...

@klap50 Could you check the content of /etc/kubernetes/argocd-install.yml on your machine?

k8s-triage-robot commented 1 year ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 1 year ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 1 year ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-ci-robot commented 1 year ago

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to [this](https://github.com/kubernetes-sigs/kubespray/issues/8816#issuecomment-1278374254): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue with `/reopen` >- Mark this issue as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close not-planned > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.