zhong (钟鹏群) 00a7ae7270 nginx il y a 4 semaines
..
README.md 1490005d2b nginx deployment il y a 1 mois
dashboard-admin-user.yaml 4f1569be6e k3s dashboard il y a 1 mois
deploy-nginx.sh 1490005d2b nginx deployment il y a 1 mois
flask-deployment-complete.yaml 00a7ae7270 nginx il y a 4 semaines
flask-deployment.yaml 4f1569be6e k3s dashboard il y a 1 mois
k8s-dashboard.yaml 6989722965 test git il y a 1 mois
nginx-deployment-nodeport.yaml b16c0e0c85 fix il y a 1 mois
nginx-deployment-with-ingress-no-class.yaml ce5874b051 fix il y a 1 mois
nginx-deployment-with-ingress.yaml ce5874b051 fix il y a 1 mois
nginx-deployment.yaml bc8035f1dc nginx il y a 4 semaines
nginx.md 00a7ae7270 nginx il y a 4 semaines

README.md

Nginx 部署文件

此目录包含用于在 k3s 集群中部署 nginx 的 YAML 文件。

文件说明

  • nginx-deployment.yaml: 包含基本的 nginx 部署和服务定义
  • nginx-deployment-with-ingress.yaml: 包含带有 ingress 规则的完整 nginx 应用部署
  • deploy-nginx.sh: 用于自动部署 nginx 的脚本

部署方法

方法 1: 使用基本部署文件

kubectl apply -f nginx-deployment.yaml

方法 2: 使用带 Ingress 的部署文件

kubectl apply -f nginx-deployment-with-ingress.yaml

方法 3: 使用部署脚本

chmod +x deploy-nginx.sh
./deploy-nginx.sh

访问 nginx 服务

如果使用了 LoadBalancer 类型的服务,可以通过外部 IP 访问:

kubectl get svc nginx-service

如果使用了 Ingress,可以通过配置的主机名访问(例如 nginx.local)。

查看部署状态

kubectl get pods,svc,ingress -l app=nginx

删除部署

kubectl delete -f nginx-deployment.yaml