This commit is contained in:
@@ -33,13 +33,30 @@ jobs:
|
|||||||
-t localhost:5000/frontend:latest .
|
-t localhost:5000/frontend:latest .
|
||||||
docker push localhost:5000/frontend:latest
|
docker push localhost:5000/frontend:latest
|
||||||
|
|
||||||
|
- name: Debug kubeconfig
|
||||||
|
run: |
|
||||||
|
echo "=== 1. Check if /root/.kube/config exists ==="
|
||||||
|
ls -la /root/.kube/
|
||||||
|
|
||||||
|
echo -e "\n=== 2. Show kubeconfig content (redacted) ==="
|
||||||
|
cat /root/.kube/config | grep -v "certificate\|key" # 隐藏敏感字段
|
||||||
|
|
||||||
|
echo -e "\n=== 3. Check server address ==="
|
||||||
|
grep "server:" /root/.kube/config
|
||||||
|
|
||||||
|
echo -e "\n=== 4. Test kubectl cluster-info ==="
|
||||||
|
kubectl cluster-info --kubeconfig=/root/.kube/config
|
||||||
|
|
||||||
|
echo -e "\n=== 5. Test kubectl get nodes (quick API test) ==="
|
||||||
|
kubectl get nodes --kubeconfig=/root/.kube/config
|
||||||
|
|
||||||
- name: Deploy to K3s
|
- name: Deploy to K3s
|
||||||
run: |
|
run: |
|
||||||
cd apps/deploy
|
cd apps/deploy
|
||||||
kubectl apply -f postgres-deployment.yaml
|
kubectl apply -f postgres-deployment.yaml --kubeconfig=/root/.kube/config
|
||||||
kubectl apply -f backend-deployment.yaml
|
kubectl apply -f backend-deployment.yaml --kubeconfig=/root/.kube/config
|
||||||
kubectl apply -f frontend-deployment.yaml
|
kubectl apply -f frontend-deployment.yaml --kubeconfig=/root/.kube/config
|
||||||
kubectl rollout restart deployment/backend
|
kubectl rollout restart deployment/backend --kubeconfig=/root/.kube/config
|
||||||
kubectl rollout restart deployment/frontend
|
kubectl rollout restart deployment/frontend --kubeconfig=/root/.kube/config
|
||||||
kubectl rollout status deployment/backend --timeout=120s
|
kubectl rollout status deployment/backend --timeout=120s --kubeconfig=/root/.kube/config
|
||||||
kubectl rollout status deployment/frontend --timeout=120s
|
kubectl rollout status deployment/frontend --timeout=120s --kubeconfig=/root/.kube/config
|
||||||
|
|||||||
Reference in New Issue
Block a user