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

Support yaml 1.2 #791

Open
M0NsTeRRR opened this issue Nov 11, 2024 · 0 comments
Open

Support yaml 1.2 #791

M0NsTeRRR opened this issue Nov 11, 2024 · 0 comments

Comments

@M0NsTeRRR
Copy link

M0NsTeRRR commented Nov 11, 2024

SUMMARY

Any component that uses pyyaml (like kubernetes.core.k8s in my case) is affected by the fact that pyyaml currently does not support YAML 1.2. One of the maintainers noted in an issue that we can use an alternative library (developed by him) as a workaround until pyyaml is updated to support YAML 1.2.

ISSUE TYPE
  • Use yamlcore on top of pyyaml until pyyaml support YAML 1.2 spec.
COMPONENT NAME

Every components that use pyyaml.

ADDITIONAL INFORMATION

In this reproducible example, my playbook applies a Kustomize file that deploys a Helm chart. In a production scenario, my Kustomize setup would include a Helm chart along with additional components. Why do I use Ansible this way instead of using the helm components? This is because I’m using the playbook only for the initial setup; after that, ArgoCD takes over and synchronizes changes to this Kustomize file.

CRDs : https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-operator-crds/charts/crds/templates

Linked PR on CRDs : prometheus-operator/prometheus-operator#4897

Playbook

---
- name: Deploy prometheus-operator-crds
  hosts: kubernetes_master[0]
  become: true
  tasks:
    - name: "Install kubernetes base infra first part"
      kubernetes.core.k8s:
        definition: "{{ lookup('kubernetes.core.kustomize', dir='../argocd/monitoring/prometheus-operator-crds', enable_helm=True) }}"
        wait: true
        kubeconfig: "/home/vscode/.kube/homelab"
        validate_certs: true
      delegate_to: localhost

Kustomize file

---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: &namespace prometheus-operator-crds

helmCharts:
- name: prometheus-operator-crds
  releaseName: prometheus-operator-crds
  namespace: *namespace
  repo: https://prometheus-community.github.io/helm-charts
  version: 16.0.0

Error

An exception occurred during task execution. To see the full traceback, use -vvv. The error was:                                 ^
fatal: [master1.unicornafk.fr -> localhost]: FAILED! => changed=false 
  msg: |-
    Failed to load resource definition: could not determine a constructor for the tag 'tag:yaml.org,2002:value'
      in "<unicode string>", line 9903, column 29:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant