{"id":1373,"date":"2024-02-09T15:13:37","date_gmt":"2024-02-09T09:43:37","guid":{"rendered":"https:\/\/www.openwriteup.com\/?page_id=1373"},"modified":"2024-02-09T17:02:24","modified_gmt":"2024-02-09T11:32:24","slug":"helm-labs","status":"publish","type":"page","link":"https:\/\/www.openwriteup.com\/?page_id=1373","title":{"rendered":"Helm labs"},"content":{"rendered":"<p>helm installation<\/p>\n<pre>wget https:\/\/get.helm.sh\/helm-v3.10.2-linux-amd64.tar.gz\r\ntar -zxvf helm-v3.10.2-linux-amd64.tar.gz\r\nmv linux-amd64\/helm \/usr\/local\/bin\/helm<\/pre>\n<pre>helm version\r\nhelm env\r\n\r\n#To list repo\r\n\r\nhelm repo list<\/pre>\n<p>#To add a repo<br \/>\n#helm repo add &lt;repo&gt; url<br \/>\nhelm repo add stable https:\/\/charts.helm.sh\/stable<\/p>\n<p>#Search a repo<br \/>\nhelm search repo mysql<\/p>\n<p>&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>#create helm chart<\/p>\n<p>1) helm create testchart<\/p>\n<p>2) cd testchart<\/p>\n<p>3) ls<\/p>\n<p>4) #Cleanup all the files inside templates directory so that we will start from scratch<\/p>\n<p>rm -rf templates\/*<\/p>\n<p>5)# Create deployment file<\/p>\n<pre>kubectl create deployment nginx --image=nginx --dry-run=client -o yaml &gt;&gt; templates\/deployment.yaml\r\n\r\n6) #create a deployment to expose service\r\nkubectl create deployment nginx --image=nginx\r\n\r\nkubectl expose deploy nginx --port 80 --type NodePort --dry-run=client -o yaml &gt; templates\/service.yaml\r\n\r\n7) #define only the required values inside Chart.yaml\r\ncat Chart.yaml\r\n\r\n8)#One more additional file, need to create is NOTES.txt inside templates directory\r\n\r\necho \"This is first helm chart and it will deploy nginx application\" &gt;&gt;templates\/NOTES.txt\r\n\r\n9)#cleanup rest of the files and directory to draw the clean slate\r\ncd ..\r\n\r\n10)#It always a good idea to run linter before deploying your chart to make sure there is no syntax error or your are following all the best practices\r\n\r\nhelm lint .\/testchart\r\n\r\n11) #delete the deployment\r\n\r\nkubectl delete deployment nginx\r\nkubectl delete svc nginx\r\n12)#Do the dry run\r\nhelm install testchart .\/testchart --dry-run\r\n\r\n13) #install\r\n\r\nhelm install testchart .\/testchart\r\n#Check service and deployment\r\nkubectl get deployment\r\nkubectl get svc\r\n\r\n14) #check\r\nhelm list\r\n\r\n15) #package\r\nhelm package testchart\/\r\n#Successfully packaged chart and saved it to: \/root\/testchart-0.1.0.tgz\r\n16) #Uninstall\r\nhelm uninstall testchart\r\n#Check service and deployment\r\nkubectl get svc\r\nkubectl get deployment<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>helm installation wget https:\/\/get.helm.sh\/helm-v3.10.2-linux-amd64.tar.gz tar -zxvf helm-v3.10.2-linux-amd64.tar.gz mv linux-amd64\/helm \/usr\/local\/bin\/helm helm version helm env #To list repo helm repo list #To add a repo #helm repo add &lt;repo&gt; url helm repo add stable https:\/\/charts.helm.sh\/stable #Search a repo helm search repo mysql &#8212;&#8212;&#8212;&#8211; #create helm chart 1) helm create testchart 2) cd testchart 3) ls 4) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_oct_exclude_from_cache":false,"footnotes":""},"class_list":["post-1373","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/pages\/1373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1373"}],"version-history":[{"count":2,"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/pages\/1373\/revisions"}],"predecessor-version":[{"id":1376,"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/pages\/1373\/revisions\/1376"}],"wp:attachment":[{"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}