# How to use Ansible Kubernetes packages with the Helm package manager modules

**URL:** <https://forum.ansible.com/t/how-to-use-ansible-kubernetes-packages-with-the-helm-package-manager-modules/34883>\
**Category:** Ansible Project\
**Tags:** kubernetes\
**Created:** [March 30, 2021, 12:14pm UTC](https://forum.ansible.com/t/how-to-use-ansible-kubernetes-packages-with-the-helm-package-manager-modules/34883 "2021-03-30T12:14:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sivaraman](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Sivaraman](https://forum.ansible.com/u/Sivaraman)\
**Post date:** [March 30, 2021, 12:14pm UTC](https://forum.ansible.com/t/how-to-use-ansible-kubernetes-packages-with-the-helm-package-manager-modules/34883/1 "2021-03-30T12:14:25Z")

</div>

Hi All,

I am trying to do helm install using Ansible Kubernetes packages with the Helm package manager modules.

If I use the below command in Ansible shell, the helm deployment is a success.

- name: install\_nr\_kubernetes\_integration  
shell: /usr/local/bin/helm upgrade --install newrelic newrelic/nri-bundle --set global.licenseKey={{ new\_relic\_key }} --set global.cluster={{ gcp\_cluster }} --set infrastructure.enabled=true --set prometheus.enabled=true --set webhook.enabled=true --set ksm.enabled=true --set kubeEvents.enabled=true --set logging.enabled=true

If I try to use the Ansible Kubernetes packages with the Helm package manager modules, the helm deployment is not deployed as expected.

---

<div class="post-metadata">

**Author:** ![Sivaraman](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Sivaraman](https://forum.ansible.com/u/Sivaraman)\
**Post date:** [March 31, 2021, 9:54am UTC](https://forum.ansible.com/t/how-to-use-ansible-kubernetes-packages-with-the-helm-package-manager-modules/34883/2 "2021-03-31T09:54:08Z")

</div>

Hi Team,

Could you help me with the above-said issue please?

Thanks,  
Siva

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [March 31, 2021, 10:32am UTC](https://forum.ansible.com/t/how-to-use-ansible-kubernetes-packages-with-the-helm-package-manager-modules/34883/3 "2021-03-31T10:32:59Z")

</div>

Hi Siva,

Let me try to reproduce this and get back to you.

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [March 31, 2021, 11:52am UTC](https://forum.ansible.com/t/how-to-use-ansible-kubernetes-packages-with-the-helm-package-manager-modules/34883/4 "2021-03-31T11:52:08Z")

</div>

Hi Siva,

I am not able to reproduce any error, here is my output -

changed: [localhost] =\> {  
“changed”: true,  
“command”: “/usr/local/bin/helm upgrade -i --reset-values -f=/tmp/tmp9iz7ys8s.yml newrelic newrelic/nri-bundle”,  
“invocation”: {  
“module\_args”: {  
“api\_key”: null,  
“atomic”: false,  
“binary\_path”: “/usr/local/bin/helm”,  
“ca\_cert”: null,  
“chart\_ref”: “newrelic/nri-bundle”,  
“chart\_repo\_url”: null,  
“chart\_version”: null,  
“context”: null,  
“create\_namespace”: false,  
“disable\_hook”: false,  
“force”: false,  
“host”: null,  
“kubeconfig”: null,  
“name”: “newrelic”,  
“purge”: true,  
“release\_name”: “newrelic”,  
“release\_namespace”: “default”,  
“release\_state”: “present”,  
“release\_values”: {  
“global.cluster”: “a”,  
“global.licenseKey”: “a”,  
“infrastructure.enabled”: true,  
“prometheus.enabled”: true  
},  
“replace”: false,  
“skip\_crds”: false,  
“update\_repo\_cache”: false,  
“validate\_certs”: true,  
“values”: {  
“global.cluster”: “a”,  
“global.licenseKey”: “a”,  
“infrastructure.enabled”: true,  
“prometheus.enabled”: true  
},  
“values\_files”: ,  
“wait”: false,  
“wait\_timeout”: null  
}  
},  
“status”: {  
“app\_version”: “1.0”,  
“chart”: “nri-bundle-2.6.0”,  
“name”: “newrelic”,  
“namespace”: “default”,  
“revision”: “1”,  
“status”: “deployed”,  
“updated”: “2021-03-31 17:20:56.228572 +0530 IST”,  
“values”: {  
“global.cluster”: “a”,  
“global.licenseKey”: “a”,  
“infrastructure.enabled”: true,  
“prometheus.enabled”: true  
}  
},  
“stderr”: “”,  
“stderr\_lines”: ,  
“stdout”: “Release "newrelic" does not exist. Installing it now.\nNAME: newrelic\nLAST DEPLOYED: Wed Mar 31 17:20:56 2021\nNAMESPACE: default\nSTATUS: deployed\nREVISION: 1\nTEST SUITE: None\n”,  
“stdout\_lines”: [  
“Release "newrelic" does not exist. Installing it now.”,  
“NAME: newrelic”,  
“LAST DEPLOYED: Wed Mar 31 17:20:56 2021”,  
“NAMESPACE: default”,  
“STATUS: deployed”,  
“REVISION: 1”,  
“TEST SUITE: None”  
]  
}

Can you please paste your error message or console log?

---

<div class="post-metadata">

**Author:** ![Sivaraman](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Sivaraman](https://forum.ansible.com/u/Sivaraman)\
**Post date:** [April 1, 2021, 9:26am UTC](https://forum.ansible.com/t/how-to-use-ansible-kubernetes-packages-with-the-helm-package-manager-modules/34883/5 "2021-04-01T09:26:02Z")

</div>

Hi Abhijeet,

Thanks for your help.

Please find the log below. Btrw, there is no error message upon running the playbook. But its not deployed the helm chart.

\<34.69.209.68\> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“ansadmin”’ -o ConnectTimeout=10 -o ControlPath=/home/ansadmin/.ansible/cp/e12395894d 34.69.209.68 ‘/bin/sh -c ‘"’“‘rm -f -r /home/ansadmin/.ansible/tmp/ansible-tmp-1617268607.9522765-6383-1146126971822/ \> /dev/null 2\>&1 && sleep 0’”’"‘’  
\<34.69.209.68\> (0, b’‘, b’')  
changed: [34.69.209.68] =\> {  
“ansible\_facts”: {  
“discovered\_interpreter\_python”: “/usr/bin/python”  
},  
“changed”: true,  
“command”: “/usr/local/bin/helm upgrade -i --reset-values -f=/tmp/tmprp\_GBW.yml newrelic newrelic/nri-bundle”,  
“invocation”: {  
“module\_args”: {  
“api\_key”: null,  
“atomic”: false,  
“binary\_path”: “/usr/local/bin/helm”,  
“ca\_cert”: null,  
“chart\_ref”: “newrelic/nri-bundle”,  
“chart\_repo\_url”: null,  
“chart\_version”: null,  
“context”: null,  
“create\_namespace”: false,  
“disable\_hook”: false,  
“force”: false,  
“host”: null,  
“kubeconfig”: null,  
“name”: “newrelic”,  
“purge”: true,  
“release\_name”: “newrelic”,  
“release\_namespace”: “default”,  
“release\_state”: “present”,  
“release\_values”: {  
“global.cluster”: " sample-cluster-instance-1 ",  
“global.licenseKey”: “tempkey45878”,  
“infrastructure.enabled”: true,  
“prometheus.enabled”: true  
},  
“replace”: false,  
“skip\_crds”: false,  
“update\_repo\_cache”: false,  
“validate\_certs”: true,  
“values”: {  
“global.cluster”: “sample-cluster-instance-1”,  
“global.licenseKey”: “tempkey45878”,  
“infrastructure.enabled”: true,  
“prometheus.enabled”: true  
},  
“values\_files”: ,  
“wait”: false,  
“wait\_timeout”: null  
}  
},  
“status”: {  
“app\_version”: “1.0”,  
“chart”: “nri-bundle-2.6.0”,  
“name”: “newrelic”,  
“namespace”: “default”,  
“revision”: “1”,  
“status”: “deployed”,  
“updated”: “2021-04-01 09:16:49.648228551 +0000 UTC”,  
“values”: {  
“global.cluster”: “sample-cluster-instance-1”,  
“global.licenseKey”: “tempkey45878”,  
“infrastructure.enabled”: true,  
“prometheus.enabled”: true  
}  
},  
“stderr”: “”,  
“stderr\_lines”: ,  
“stdout”: “Release "newrelic" does not exist. Installing it now.\nNAME: newrelic\nLAST DEPLOYED: Thu Apr 1 09:16:49 2021\nNAMESPACE: default\nSTATUS: deployed\nREVISION: 1\nTEST SUITE: None\n”,  
“stdout\_lines”: [  
“Release "newrelic" does not exist. Installing it now.”,  
“NAME: newrelic”,  
“LAST DEPLOYED: Thu Apr 1 09:16:49 2021”,  
“NAMESPACE: default”,  
“STATUS: deployed”,  
“REVISION: 1”,  
“TEST SUITE: None”  
]  
}

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

Thanks,  
Siva

---

<div class="post-metadata">

**Author:** ![Sivaraman\_S\_b](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@Sivaraman\_S\_b](https://forum.ansible.com/u/Sivaraman_S_b)\
**Post date:** [April 8, 2021, 11:10am UTC](https://forum.ansible.com/t/how-to-use-ansible-kubernetes-packages-with-the-helm-package-manager-modules/34883/6 "2021-04-08T11:10:34Z")

</div>

Hi Abhijeet, Team,

Could you help me with my request?

Thanks in advance.

Thanks,  
Siva

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [April 8, 2021, 11:32am UTC](https://forum.ansible.com/t/how-to-use-ansible-kubernetes-packages-with-the-helm-package-manager-modules/34883/7 "2021-04-08T11:32:00Z")

</div>

Can you please paste kubectl -n default get pods?

---

<div class="post-metadata">

**Author:** ![Sivaraman\_S\_b](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@Sivaraman\_S\_b](https://forum.ansible.com/u/Sivaraman_S_b)\
**Post date:** [April 8, 2021, 12:07pm UTC](https://forum.ansible.com/t/how-to-use-ansible-kubernetes-packages-with-the-helm-package-manager-modules/34883/8 "2021-04-08T12:07:36Z")

</div>

Please find the output.

]# kubectl -n default get pods  
NAME READY STATUS RESTARTS AGE  
newrelic-nri-metadata-injection-job-4gsxp 0/1 Completed 0 5h30m

**In actual helm deployment, it should show below PODS and daemon sets. All are missing when deploy using ansible helm modules.**

# **kubectl -n default get pods**

NAME READY STATUS RESTARTS AGE  
newrelic-kube-state-metrics-774bcf5cf5-zhtjb 0/1 Running 0 7s  
newrelic-newrelic-infrastructure-246kt 1/1 Running 0 7s  
newrelic-newrelic-infrastructure-cjrbs 1/1 Running 0 7s  
newrelic-newrelic-infrastructure-klkv6 1/1 Running 0 7s  
newrelic-newrelic-infrastructure-p8r5t 1/1 Running 0 7s  
newrelic-newrelic-infrastructure-tlgm4 1/1 Running 0 7s  
newrelic-newrelic-infrastructure-zbd2d 1/1 Running 0 7s  
newrelic-newrelic-logging-cm8gv 1/1 Running 0 7s  
newrelic-newrelic-logging-dpcjw 1/1 Running 0 7s  
newrelic-newrelic-logging-lgf6b 1/1 Running 0 7s  
newrelic-newrelic-logging-pxgnq 1/1 Running 0 7s  
newrelic-newrelic-logging-wh9qc 1/1 Running 0 7s  
newrelic-newrelic-logging-ztmrs 1/1 Running 0 7s  
newrelic-nri-kube-events-86d68fd965-9xbrf 2/2 Running 0 7s  
newrelic-nri-metadata-injection-d7d676576-6d2vj 0/1 ContainerCreating 0 7s  
newrelic-nri-metadata-injection-job-pr6lx 1/1 Running 0 7s  
newrelic-nri-prometheus-586654b7ff-d229g 1/1 Running 0 7s

# **kubectl get pods --all-namespaces | grep kube-state-metrics**

default newrelic-kube-state-metrics-774bcf5cf5-zhtjb 1/1 Running 0 47s

# **kubectl get daemonsets**

NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE  
newrelic-newrelic-infrastructure 6 6 6 6 6 72s  
newrelic-newrelic-logging 6 6 6 6 6 72s

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [April 8, 2021, 1:20pm UTC](https://forum.ansible.com/t/how-to-use-ansible-kubernetes-packages-with-the-helm-package-manager-modules/34883/9 "2021-04-08T13:20:34Z")

</div>

Hi Siva,

Can you please try with values like -

- name: integrate-new-relic-and-prometheus-with-cluster  
community.kubernetes.helm:  
binary\_path: “/usr/local/bin/helm”  
release\_namespace: default  
name: newrelic  
chart\_ref: newrelic/nri-bundle  
values:  
global:  
cluster: “a”  
licenseKey: “a”  
infrastructure:  
enabled: true  
prometheus:  
enabled: true

---

<div class="post-metadata">

**Author:** ![Sivaraman](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Sivaraman](https://forum.ansible.com/u/Sivaraman)\
**Post date:** [April 8, 2021, 1:51pm UTC](https://forum.ansible.com/t/how-to-use-ansible-kubernetes-packages-with-the-helm-package-manager-modules/34883/10 "2021-04-08T13:51:03Z")

</div>

Hi Abhijeet,

It is showing the same output still.

Not sure where is the issue ?

Thanks,  
Siva
