经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » 数据库/运维 » Kubernetes » 查看文章
K8s helm 创建自定义Chart
来源:cnblogs  作者:klvchen  时间:2018/12/11 9:12:08  对本文有异议
  1. # 删除之前创建的 chart
  2. helm list
  3. helm delete --purge redis1
  4. # 创建自定义 chart myapp
  5. cd ~/helm
  6. helm create myapp
  7. cd myapp/
  8. # 修改 Chart.yaml
  9. cat Chart.yaml
  10. apiVersion: v1
  11. appVersion: "1.0"
  12. description: A Helm chart for Kubernetes myapp chart
  13. name: myapp
  14. version: 0.0.1
  15. maintainer:
  16. - name: klvchen
  17. email: klvchen@126.com
  18. url: http://www.klvchen.com
  19. # 修改 values.yaml
  20. cat values.yaml
  21. # Default values for myapp.
  22. # This is a YAML-formatted file.
  23. # Declare variables to be passed into your templates.
  24. replicaCount: 2
  25. image:
  26. repository: ikubernetes/myapp
  27. tag: v1
  28. pullPolicy: IfNotPresent
  29. service:
  30. type: ClusterIP
  31. port: 80
  32. targetPort: 80
  33. ingress:
  34. enabled: false
  35. annotations:
  36. kubernetes.io/ingress.class: nginx
  37. kubernetes.io/tls-acme: "true"
  38. path: /
  39. hosts:
  40. - chart-example.local
  41. tls: []
  42. # - secretName: chart-example-tls
  43. # hosts:
  44. # - chart-example.local
  45. resources:
  46. # We usually recommend not to specify default resources and to leave this as a conscious
  47. # choice for the user. This also increases chances charts run on environments with little
  48. # resources, such as Minikube. If you do want to specify resources, uncomment the following
  49. # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  50. limits:
  51. cpu: 100m
  52. memory: 128Mi
  53. requests:
  54. cpu: 100m
  55. memory: 128Mi
  56. nodeSelector: {}
  57. tolerations: []
  58. affinity: {}
  59. # 测试打包
  60. cd ..
  61. helm lint ./myapp
  62. helm package myapp/
  63. # 创建代理,注意这里需要在 myapp-0.0.1.tgz 同级上执行,这里会启动一个web服务,端口为 8879
  64. helm serve
  65. # 新开一个终端,安装
  66. helm install --name myapp1 local/myapp
  67. # 测试,访问 ClusterIP
  68. curl 10.102.91.53
  69. #运行结果,正常:
  70. Hello MyApp | Version: v1 | <a href="hostname.html">Pod Name</a>
  71. # 查看 myapp1 的状态
  72. helm status myapp1
 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号