fix_de.sh
857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
echo "=== 更新前端 Deployment 配置 ==="
echo "更新前端 Deployment 使用正确的 nginx 配置:"
kubectl patch deployment frontend -n ecommerce -p '{
  "spec": {
    "template": {
      "spec": {
        "volumes": [
          {
            "name": "nginx-config",
            "configMap": {
              "name": "frontend-nginx-config"
            }
          }
        ],
        "containers": [
          {
            "name": "frontend",
            "volumeMounts": [
              {
                "name": "nginx-config",
                "mountPath": "/etc/nginx/nginx.conf",
                "subPath": "nginx.conf"
              }
            ]
          }
        ]
      }
    }
  }
}'
echo ""
echo "等待部署更新..."
sleep 10
echo "重启前端 Deployment:"
kubectl rollout restart deployment frontend -n ecommerce