• 构建helm chart应用


    • 使用helm命令创建基础目录
    helm create t2cp
    
    [root@node04 ~]# tree t2cp
    t2cp
    ├── charts
    ├── Chart.yaml
    ├── templates
    │   ├── deployment.yaml
    │   ├── _helpers.tpl
    │   ├── ingress.yaml
    │   ├── NOTES.txt
    │   ├── service.yaml
    │   └── tests
    │       └── test-connection.yaml
    └── values.yaml
    
    
    • 编辑Chart.yaml 用于描述应用,包括名字,描述信息以及版本
    apiVersion: v1
    appVersion: "1.0"
    description: A Helm chart for Kubernetes
    name: t2cp
    version: 11
    
    • 编辑values.yaml设置启动容器的相关参数
    cat values.yaml |grep -v "#"|grep -v ^$
    replicaCount: 1
    image:
      repository: t2cp/t2cp-dev
      tag: 11
      pullPolicy: IfNotPresent
    nameOverride: ""
    fullnameOverride: ""
    service:
      type: ClusterIP
      port: 9010
    ingress:
      enabled: false
      annotations: {}
      paths: []
      hosts:
        - t2cp.local
      tls: []
    resources: {}
    nodeSelector: {}
    tolerations: []
    affinity: {}
    
    • 进入t2cp目录校验helm chart应用
    helm lint
    ==> Linting .
    [INFO] Chart.yaml: icon is recommended
    
    1 chart(s) linted, no failures
    
    • 对t2cp应用打包
    helm package t2cp --debug
    Successfully packaged chart and saved it to: /root/t2cp-11.tgz
    
    • 上传到harbor私有仓库
    helm repo list
    NAME    URL                                             
    stable  https://kubernetes-charts.storage.googleapis.com
    local   http://127.0.0.1:8879/charts                    
    bitnami https://charts.bitnami.com/bitnami              
    myrepo  https://www.harbor.mobi/chartrepo/myrepo 
    
    helm push /usr/t2cp-0.1.1.tgz myrepo
    
    # 或者在第五步的时候不打包应用,直接上传目录
    helm push t2cp myrepo
    
    # 需要配置自签名证书和账号密码的操作
    helm push --ca-file /usr/local/harbor/cert/ca.crt --cert-file /usr/local/harbor/cert/www.harbor.mobi.cert --key-file /usr/local/harbor/cert/www.harbor.mobi.key --username=admin --password=Harbor12345 t2cp-0.1.1.tgz myrepo
    
  • 相关阅读:
    AFO NOI2018退役——菜鸡一直是菜鸡
    NOI前总结
    洛谷3732:[HAOI2017]供给侧改革——题解
    BZOJ4037:[HAOI2015]数字串拆分——题解
    洛谷4717:【模板】 快速沃尔什变换——题解
    BZOJ3192:[JLOI2013]删除物品——题解
    BZOJ2288:[POJ Challenge]生日礼物——题解
    BZOJ1150:[APIO/CTSC2007]数据备份——题解
    BZOJ3155:Preprefix sum——题解
    Codility---FrogRiverOne
  • 原文地址:https://www.cnblogs.com/sanduzxcvbnm/p/11968964.html
Copyright © 2020-2023  润新知