This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
# violin-cv K8s 部署
|
||||
|
||||
## 一键部署
|
||||
|
||||
```bash
|
||||
kubectl apply -f namespace.yaml
|
||||
kubectl apply -f deployment.yaml
|
||||
kubectl apply -f service.yaml
|
||||
kubectl apply -f ingress.yaml
|
||||
```
|
||||
|
||||
## 验证
|
||||
|
||||
```bash
|
||||
# 看 pod 启动
|
||||
kubectl get pods -n drone -l app=violin-cv
|
||||
|
||||
# 看 service / ingress
|
||||
kubectl get svc,ing -n drone -l app=violin-cv
|
||||
|
||||
# 测访问
|
||||
curl -I http://cv.violin-work.online/
|
||||
```
|
||||
|
||||
## 文件说明
|
||||
|
||||
| 文件 | 作用 |
|
||||
|------|------|
|
||||
| `namespace.yaml` | K8s namespace(**不会真正创建**,因为 drone namespace 已存在;保留是声明依赖) |
|
||||
| `deployment.yaml` | 1 个 nginx 容器跑 HTML,replicas=1,资源极省 |
|
||||
| `service.yaml` | ClusterIP,端口 80 |
|
||||
| `ingress.yaml` | `cv.violin-work.online` → service:80(TLS 暂时不配,用 cert-manager 后再说) |
|
||||
|
||||
## 镜像
|
||||
|
||||
由 `.drone.yml` 自动 push 到 `ccr.ccs.tencentyun.com/violin/violin-cv:latest`
|
||||
|
||||
## 域名
|
||||
|
||||
`cv.violin-work.online` 需要:
|
||||
1. 你的 DNS 把这个域名解析到 K8s ingress 公网 IP
|
||||
2. 集群已装 nginx-ingress-controller
|
||||
3. (可选)cert-manager 给 `cv.violin-work.online` 申请证书
|
||||
Reference in New Issue
Block a user