Skip to content

antony@notes:~/kubernetes$ cat "動手實作-veeam-kasten.md"

動手實作 veeam kasten

2025-08-07· kubernetes

動手實作 Veeam Kasten

先決條件

支援平台

作業系統架構是否支援 FIPSVeeam Repository ExportsvSphere Block Mode Exports
Linuxx86_64 (amd64)
LinuxArm (arm64/v8)
LinuxPower (ppc64le)不適用

快速開始安裝

  1. adding the Kasten repository to your Helm client:

    helm repo add kasten https://charts.kasten.io/
    helm repo update
  2. Run the following to initiate the install into the kasten-io namespace:

    helm install k10 kasten/k10 \
      --namespace=kasten-io \
      --create-namespace \
      --version=8.0.2
  3. After the previous helm command returns, monitor the Pod status until all Pods have reached a fully “READY” state (i.e. 1/1, 2/2, etc.), as shown below (~2 minutes):

    watch "kubectl get pods -n kasten-io"

    執行結果 :

    Every 2.0s: kubectl get pods -n kasten-io                                   c1: Thu Aug  7 15:39:01 2025
    NAME                                     READY   STATUS    RESTARTS      AGE
    aggregatedapis-svc-7bb54699bf-r2v52      1/1     Running   1 (85m ago)   85m
    auth-svc-6478997bd4-s2d84                1/1     Running   0             85m
    catalog-svc-6b86c49dd4-7dgn7             2/2     Running   0             85m
    controllermanager-svc-867bbb788b-s4h5b   1/1     Running   0             85m
    crypto-svc-6496ffd558-xh54x              4/4     Running   0             85m
    dashboardbff-svc-5d9c4494d5-84z2g        2/2     Running   0             85m
    executor-svc-5895f744f5-6clhv            1/1     Running   0             85m
    executor-svc-5895f744f5-p8lsj            1/1     Running   0             85m
    executor-svc-5895f744f5-qm4bw            1/1     Running   0             85m
    frontend-svc-869cd877f8-msprr            1/1     Running   0             85m
    gateway-55fdbb977c-k8wbj                 1/1     Running   0             85m
    jobs-svc-78988bc957-7c89r                1/1     Running   0             85m
    kanister-svc-795b4b9947-rnrwn            1/1     Running   0             85m
    logging-svc-fbd98b769-7gq6r              1/1     Running   0             85m
    metering-svc-6988c4c6c8-rmhnx            1/1     Running   0             85m
    prometheus-server-54dcdf4b9d-pqvxh       2/2     Running   0             85m
    state-svc-6dc8f8c55d-4dcq8               2/2     Running   0             85m
  4. 連接到 Web UI

    # 取得 ens18 網卡的 ip
    IP=$(ip -4 -o addr show dev ens18 \
         | awk '{print $4}' \
         | cut -d/ -f1)
    
    kubectl -n kasten-io port-forward --address ${IP} service/gateway 8080:80 &

    執行結果 :

    [1] 5784
    Forwarding from 192.168.11.71:8080 -> 8000

    Veeam Kasten dashboard 會在 http://192.168.11.71:8080/k10/#/

設定 Primary Storage

在我們開始保護應用程式之前,Kasten 必須能夠對叢集所使用的儲存體執行快照功能。 Kasten 可以與任何已實作 VolumeSnapshot API 支援的 CSI (Container Storage Interface) 儲存供應程式 (storage provisioner) 搭配使用,同時也提供直接的 API 整合,以支援非 CSI 的供應程式或啟用非 CSI 的功能。

  1. 列出叢集中的 VolumeSnapshotClasses

    kubectl describe volumesnapshotclasses

    執行結果 :

    Name:             longhorn
    Namespace:
    Labels:           <none>
    Annotations:      <none>
    API Version:      snapshot.storage.k8s.io/v1
    Deletion Policy:  Delete
    Driver:           driver.longhorn.io
    Kind:             VolumeSnapshotClass
    Metadata:
      Creation Timestamp:  2025-08-07T07:37:39Z
      Generation:          1
      Resource Version:    692621
      UID:                 e2b6a677-0a38-4f2f-86e8-8cb356d636ea
    Events:                <none>
  2. 添加必要的 Kasten annotation 給 VolumeSnapshotClass:

    kubectl annotate volumesnapshotclass longhorn \
      k10.kasten.io/is-snapshot-class=true

    這麼做的目的,是為了讓 Kasten 在備份期間向 Kubernetes API server 提出請求以建立 PersistentVolumeClaims 的快照時,可以識別要參照哪一個 VolumeSnapshotClass。

  3. Kasten 內建一個工具,可以在部署過程中執行,以快速索引並驗證叢集的儲存設定。這包括識別可用的 StorageClasses,以及其關聯的 VolumeSnapshotClass 是否已套用 Kasten annotation。您可以選擇透過執行以下指令,在叢集上進行測試:

    curl https://docs.kasten.io/downloads/latest/tools/k10_primer.sh | bash

    執行結果:

    Namespace option not provided, using default namespace
    Checking for tools
     --> Found kubectl
     --> Found helm
     --> Found jq
     --> Found cat
     --> Found base64
     --> Found tr
    Checking if the Kasten Helm repo is present
     --> The Kasten Helm repo was found
    Checking for required Helm version (>= v3.11.0)
     --> Helm binary version meet the requirements
    K10Primer image
     --> Using Image (gcr.io/kasten-images/k10tools:8.0.5) to run test
    Checking access to the Kubernetes context kubernetes-admin@topgun
     --> Able to access the default Kubernetes namespace
    K10 Kanister tools image
     --> Using Kanister tools image (gcr.io/kasten-images/k10tools:8.0.5) to run test
    
    Running K10Primer Job in cluster with command
         ./k10tools primer
    serviceaccount/k10-primer created
    clusterrolebinding.rbac.authorization.k8s.io/k10-primer created
    job.batch/k10primer created
    Pod k10primer-wqmb7 is in Pending phase
    Pod k10primer-wqmb7 is in Pending phase
    Pod k10primer-wqmb7 is in Pending phase
    Pod k10primer-wqmb7 is in Pending phase
    Pod k10primer-wqmb7 is in Pending phase
    Pod k10primer-wqmb7 is in Pending phase
    Pod k10primer-wqmb7 is in Pending phase
    Pod k10primer-wqmb7 is in Pending phase
    Pod Ready!
    ================================================================
    Kubernetes Version Check:
      current kubernetes version (v1.33.2) is not supported. Supported versions: [1.28 1.29 1.30 1.31 1.32]  -  Error
    
    RBAC Check:
      Kubernetes RBAC is enabled  -  OK
    
    Aggregated Layer Check:
      The Kubernetes Aggregated Layer is enabled  -  OK
    
    CSI Capabilities Check:
      Using CSI GroupVersion snapshot.storage.k8s.io/v1  -  OK
    
    Validating Provisioners:
    driver.longhorn.io:
      Is a CSI Provisioner  -  OK
      Storage Classes:
        longhorn
          Valid Storage Class  -  OK
        longhorn-static
          Valid Storage Class  -  OK
      Volume Snapshot Classes:
        longhorn
          Has k10.kasten.io/is-snapshot-class annotation set to true  -  OK
          Has deletionPolicy 'Delete'  -  OK
    
    Validate Generic Volume Snapshot:
      Pod created successfully  -  OK
      GVS Backup command executed successfully  -  OK
      Pod deleted successfully  -  OK
    ================================================================
    serviceaccount "k10-primer" deleted
    clusterrolebinding.rbac.authorization.k8s.io "k10-primer" deleted
    job.batch "k10primer" deleted

設定 Location Profile

您現在已設定好使用 Kasten 對 Kubernetes 應用程式執行本機快照所需的一切 — 但快照不等於備份! 為了在本地叢集或主要儲存空間受損時能夠還原,應將一份資料副本匯出到其他位置。

這些備份目標的設定被稱為 Location Profiles。Kasten 支援多種選項,包括:

  • AWS S3
  • Azure Blob
  • Google Cloud Storage
  • S3-Compatible
  • NFS
  • SMB
  • Veeam Backup & Replication

提醒您,您的實驗室環境中已經預先部署了一台 MinIO 物件儲存伺服器。