k8s部署yapi
helm配置 Chart 仓库并下载安装包
helm repo add myrepo https://putianhui.github.io/helm-charts/
#先查可用的yapi版本
helm search repo yapi
#下载安装包至本地
注意:2.0.0是chart的版本
helm pull myrepo/yapi --version=0.0.1
#解压缩安装包
tar xf yapi-0.0.1.tgz
#修改values.yaml文件
cd yapi
cp values.yaml values.yaml.bak
vim values.yaml
#查看配置文件
grep -Ev "$^|#" values.yaml
在配置文件中修改以下部分
image:
# 指定镜像仓库地址
# yapi的容器镜像参考:https://github.com/fjc0k/docker-YApi
repository: jayfong/yapi
# 指定镜像的版本号
tag: latest
# 镜像拉取策略(IfNotPresent、Always、Never)
pullPolicy: IfNotPresent
# 指定镜像拉取secret,私用镜像时使用
imagePullSecrets: []
# - name: imagesecret
service:
# service暴露的类型("ClusterIP、NodePort")
type: NodePort
# yapi镜像的端口号,默认3000
port: 3000
# 当type为NodePort时指定Node的端口号(30000-32767),为空时表示随机端口
NodePort: ""
# 持久化存储相关
persistence:
# 是否开启数据持久化,为true时通过配置的storageClassName自动创建pv和pvc,为false时使用emptyDir
enabled: true
# 使用的存储类名称,生产环