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

Helm-Diff not working? #772

Open
Joachim-42he opened this issue Aug 9, 2024 · 2 comments
Open

Helm-Diff not working? #772

Joachim-42he opened this issue Aug 9, 2024 · 2 comments

Comments

@Joachim-42he
Copy link

I have previously asked about this in this issue but was directed to open a bug ticket.

SUMMARY

I am running Ansible from a devcontainer environment (Debian 12) against a bare-metal cluster (Ubuntu 22.04, k3s 1.29.7) .
Helm (version 3.15.3 and Helm-Diff (version 3.9.6) are installed in the devcontainer environment and on the cluster servers.
Still I get:

[WARNING]: The default idempotency check can fail to report changes in certain cases. Install helm diff >= 3.4.1 for better results.

whenever I run a task that installs a helm-chart via kubernetes.core.helm.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

kubernetes.core version 5.0.0

ANSIBLE VERSION
ansible [core 2.17.2]
  config file = /workspace/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/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/ansible/.local/bin/ansible
  python version = 3.11.9 (main, Aug  2 2024, 14:42:08) [GCC 12.2.0] (/usr/local/bin/python3)
  jinja version = 3.1.4
  libyaml = True
COLLECTION VERSION
# /home/ansible/.ansible/collections/ansible_collections
Collection                               Version
---------------------------------------- -------
ansible.posix                            1.5.4
community.crypto                         2.21.1
community.docker                         3.11.0
community.general                        9.2.0
community.library_inventory_filtering_v1 1.0.1
community.mysql                          3.9.0
kubernetes.core                          5.0.0
CONFIGURATION
ANSIBLE_PIPELINING(/workspace/ansible.cfg) = True
CONFIG_FILE() = /workspace/ansible.cfg
DEFAULT_FORKS(/workspace/ansible.cfg) = 8
DEFAULT_GATHERING(/workspace/ansible.cfg) = explicit
DEFAULT_MANAGED_STR(/workspace/ansible.cfg) = File managed by Ansible.
Manual editing will not be persistent!
DEFAULT_VAULT_PASSWORD_FILE(/workspace/ansible.cfg) = /secrets/production.ansible.vault.passwd
DIFF_ALWAYS(/workspace/ansible.cfg) = True
INTERPRETER_PYTHON(/workspace/ansible.cfg) = /usr/bin/python3
OS / ENVIRONMENT

Ubuntu 22.04

Example Task
- name: "Deploy Prometheus Helm Chart"
  kubernetes.core.helm:
    release_name: "kube-prometheus-stack"
    update_repo_cache: true
    chart_ref: "kube-prometheus/kube-prometheus-stack"
    chart_version: "{{ k8s_helm_prometheus_version }}"
    release_namespace: "monitoring"
    create_namespace: true
    skip_crds: true
    release_state: present
    wait: true
    release_values:
      global:
        rbac:
          createAggregateClusterRoles: true
      kubeControllerManager:
        enabled: true
(...)
@yurnov
Copy link
Contributor

yurnov commented Sep 2, 2024

If you need t patch some values in already installed chart, you can use:

- name: Get EDA2 installed release info
  kubernetes.core.helm_info:
    kubeconfig: "{{ kubeconfig }}"
    namespace: "monitoring"
    name: "kube-prometheus-stack"
  register: base_helm_info

- name: Baseline release values
  set_fact:
    base_values: "{{ base_helm_info['status']['values'] }}"

- name: Set desired diff
  set_fact:
    desired_diff:
	  global:
        rbac:
          createAggregateClusterRoles: true
      kubeControllerManager:
        enabled: true
		
- name: "Patch values Prometheus Helm Chart"
  kubernetes.core.helm:
    release_name: "kube-prometheus-stack"
    update_repo_cache: true
    chart_ref: "kube-prometheus/kube-prometheus-stack"
    chart_version: "{{ k8s_helm_prometheus_version }}"
    release_namespace: "monitoring"
    create_namespace: true
    skip_crds: true
    release_state: present
    wait: true
    release_values: "{{ base_values|conbine(desired_diff, recursive=True)}}"

@Joachim-42he
Copy link
Author

Thank you for your reply @yurnov but I only wanted to get rid of/understand the recurring warning in Ansible.

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

2 participants