Update .gitea/workflows/deploy.yaml
Deploy Dashboard Monitor ke K3s / deploy (push) Failing after 4s
Details
Deploy Dashboard Monitor ke K3s / deploy (push) Failing after 4s
Details
This commit is contained in:
parent
b8aa5a7784
commit
8f695a09eb
|
|
@ -1,32 +1,15 @@
|
||||||
name: Deploy Dashboard Monitor ke K3s
|
name: Deploy Dashboard Monitor ke K3s
|
||||||
on:
|
on: [push]
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 1. Tarik Kode dari Repo
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: 2. Deploy Langsung ke Kubernetes
|
- name: Deploy via SSH Lokal
|
||||||
run: |
|
run: |
|
||||||
echo "=> Mendownload kubectl resmi..."
|
# SSH ke localhost dan jalankan perintah kubectl langsung di VPS
|
||||||
curl -LO "https://dl.k8s.io/release/v1.28.2/bin/linux/amd64/kubectl"
|
# Ini mem-bypass masalah Secrets dan Kubeconfig Base64
|
||||||
chmod +x kubectl
|
ssh -o StrictHostKeyChecking=no root@localhost "KUBECONFIG=/etc/rancher/k3s/k3s.yaml kubectl apply -f dashdot-deploy.yaml"
|
||||||
|
ssh -o StrictHostKeyChecking=no root@localhost "KUBECONFIG=/etc/rancher/k3s/k3s.yaml rollout status deployment/dashdot"
|
||||||
echo "=> Merakit kunci rahasia K3s..."
|
|
||||||
# Mengubah base64 secret kembali menjadi file yaml
|
|
||||||
echo "${{ secrets.KUBECONFIG }}" | base64 -d > kubeconfig.yaml
|
|
||||||
chmod 600 kubeconfig.yaml
|
|
||||||
|
|
||||||
echo "=> Mengetes koneksi ke cluster..."
|
|
||||||
./kubectl --kubeconfig=kubeconfig.yaml get nodes
|
|
||||||
|
|
||||||
echo "=> Mengirim perintah deploy..."
|
|
||||||
./kubectl --kubeconfig=kubeconfig.yaml apply -f dashdot-deploy.yaml
|
|
||||||
|
|
||||||
echo "=> Menunggu rollout selesai..."
|
|
||||||
./kubectl --kubeconfig=kubeconfig.yaml rollout status deployment/dashdot
|
|
||||||
Loading…
Reference in New Issue