Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Deploy helm private libraries

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

1. Run the web container as a private repository (I run this container on node01) # run web container [root@node01 ~] # docker run-d-p 81:80-v / var/www:/usr/local/apache2/htdocs httpd# to create a directory Used to store charts package [root@node01 ~] # mkdir-p / var/www/charts2, package tesetchart through helm package [root@master ~] # helm create testchart # create testechart [root@master ~] # helm package testchart # to package # after performing the packaging operation A package named testchart-0.1.0.tgz is generated in the current directory. Execute the index file of the helm repo index generation library [root@master ~] # mkdir myrepo [root@master ~] # mv testchart-0.1.0.tgz myrepo/ [root@master ~] # helm repo index myrepo/-- the url above in url http://192.168.20.3:81/charts# is the node IP+ port where the httpd image is run in the first step [root@master ~] # ls myrepo/ # make sure that the index.yaml file has generated index.yaml testchart-0.1.0.tgz4, Copy the generated index.yaml file and charts package to the node where the httpd container is located and map it to the local directory [root@master ~] # cd myrepo/ [root@master myrepo] # scp index.yaml testchart-0.1.0.tgz node01:/var/www/charts5, Add the new warehouse to the helm# through helm repo add. URL is the URL of the web container [root @ master myrepo] # helm repo add newrepo http://192.168.20.3:81/charts[root@master myrepo] # helm repo list # confirm that the list returned has the newly added warehouse.

In fact, at this point of configuration, the private repository of this charts package can be used normally by the private network environment. Here are some verifications.

6 、 Search for charts packages copied to node01 # search testchart (packages copied to node01 using scp) [root@master myrepo] # helm search testchart NAME CHART VERSION APP VERSION DESCRIPTION local/testchart 0.1.0 A Helm chart for Kubernetesnewrepo/testchart 0.1.0 A Helm chart for Kubernetes# you can see the returned results There is the corresponding package "newrepo/testchart" under the newly created library # the search results at this time have nothing to do with the local Because this package is searched from the web container You can delete the local package and do a search test [root@master myrepo] # lsindex.yaml testchart-0.1.0.tgz [root@master myrepo] # rm-rf * [root@master myrepo] # helm search testchart# or you can see the package in the private repository 7. Install testchart from the new private library for testing # you can use this private library like a shared library [root@master myrepo] # helm install newrepo/testchart-n my-nginx8, Update the image of the service running by the charts package

In fact, it is a service version upgrade operation, and the general idea is as follows: modify the values.yaml file under the extracted charts package directory to the desired value (the values.yaml file contains the value of the service, in which you can specify the image and label, the type of data persistence, and so on). After the modification is completed, use the following command to upgrade.

[root@master ~] # helm upgrade-f sunqiuming-chart/values.yaml my-nginx newrepo/testchart#my-nginx is the name of the previous instance. You can view the instance name # newrepo/testchart through "helm list": the chart package in the custom repository.

-this is the end of this article. Thank you for reading-

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report