本文档提供了使用此Helm Chart部署服务的详细步骤。
使用默认配置安装Chart:
helm install my-release ./chart
my-values.yaml
安装Chart:
helm install my-release ./chart -f my-values.yaml
service:
name: my-app
image: myapp:1.0.0
port: 8080
service:
name: my-app
image: myapp:1.0.0
port: 8080
env:
- name: ENV
value: production
- name: DEBUG
value: "false"
serviceConfig:
exposeToIntranet: true
ingress:
enabled: false
安装后,使用以下命令验证部署是否成功:
# 检查Pod是否正常运行
kubectl get pods -l app=my-app -n app
# 检查Service是否创建成功
kubectl get svc -n app
# 如果启用了Ingress,检查Ingress是否创建成功
kubectl get ingress -n app
使用以下命令卸载Chart:
helm uninstall my-release
如果遇到部署问题,请尝试:
检查Pod状态和日志
kubectl get pods -n app
kubectl logs <pod-name> -n app
检查服务状态
kubectl describe svc <service-name> -n app
检查Ingress状态
kubectl describe ingress <ingress-name> -n app