Upgrade to Pro — share decks privately, control downloads, hide ads and more …

OpenShiftのクラスターバックアップリストア / OpenShift Cluster Backup Restore

OpenShiftのクラスターバックアップリストア / OpenShift Cluster Backup Restore

OpenShift.RUN 2022で話した内容です。

Takuya Utsunomiya

January 21, 2022
Tweet

More Decks by Takuya Utsunomiya

Other Decks in Technology

Transcript

  1. kind: HumanBeings metadata: name: 宇都宮 卓也 spec: group: レッドハット株式会社 title:

    ソリューションアーキテクト born: 大阪 age: 40歳 favorites: technology: ストレージ hobby: [“プロレス観戦”,“将棋観戦”] drink: [“ビール”, “ワイン”] annoyance: [“最近目が霞む”, “肩が痛い”] うつぼ @japan_rook Japan Rook https://rook.connpass.com/ Cloud Native Data Community https://cndata.connpass.com/ https://www.redhat.com/ja/resource s/openshift-4-first-step-guide-step-t o-enterprise-kubernetes-ebook https://www.shoeisha.co.jp/ book/detail/9784798175027 $ whoami OpenShiftのクラスターバックアップ/リストア 2
  2. 3 バックアップ/リストアの基本 OpenShiftのクラスターバックアップ/リストア 様々なリストアが必要となる原因 • 物理障害 ◦ 機器故障、NW断、... • 論理障害

    ◦ オペミス、ファイルシステム破損、 ... • (広域)災害 ◦ 火災、地震、... • セキュリティ事故 ◦ 攻撃、ランサムウェア、… サービスへの影響に直結 • RTO (Recovery Time Objective) ◦ 復旧するまでの時間 • RPO (Recovery Point Objective) ◦ 復旧すべき過去の地点 想定するリストアを実施する状況 いつまでに、どの地点まで戻したいか 状況ごとに、サービスレベルを守れるバックアップ方法を採用すべき
  3. 4 サービスレベルに合わせたデータ保護の方法 OpenShiftのクラスターバックアップ/リストア • データセンター障害からの保護: ◦ 電力網/空調設備の故障 ◦ 火災など人的災害 ◦

    洪水、地震など地理的規模の自然災害 • 非同期ミラーリングによるリモートの Standby/HotSiteへのFailover WAN DR Metro HA-DR • システム全体障害からの保護: ◦ ハードウェアコンポーネント、システム、ま たはラックレベルの障害 ◦ 電源系統/空調設備の故障 • 同期ミラーリングによるアベイラビリ ティゾーン間の自動Failover ローカルバックアップ • 次の事象からの保護: ◦ 論理障害とアプリケーションのバグ ◦ 誤った削除などユーザーエラー ◦ 悪意ある人/ソフト • 過去の一時点へのリストア • ローカルのSnapshot
  4. 6 [参考]バックアップとミラーリングは別物 OpenShiftのクラスターバックアップ/リストア バックアップ (リモート)ミラーリング 意義 本番のある一時点の断面を別の領域に保管する こと 本番と全く同じ状態をリアルタイムで (離れた)別

    の領域で動かすこと リカバリーポイント バックアップした時点 直前に戻せる 世代 複数持てる 最新一世代だけ 災害の耐性 耐えられない (リモートミラーなら)耐えられる データの上書き されない される 論理障害の耐性 耐えられる 耐えられない 同期/非同期 非同期 同期、非同期両方できる
  5. 7 OpenShiftのバックアップの難しさ OpenShiftのクラスターバックアップ/リストア • アプリケーションやデータの整合性を考慮すると、バックアップ対象 (スコープ)が多い。 • バックアップの手法は色々あるが、それぞれ対応するスコープが異なり、プラットフォームや構成によって実施できる手法が 限られる。 •

    一つで全部完璧にバックアップするのは難しいため、複数組み合わせて実施すべき。 アプリ/ミドルウェア のバックアップ Etcd バックアップ 基盤ストレージ のバックアップ バックアップツール 対象 アプリ/ミドルウェア層 ◦ - △ ◦ OpenShift ユーザ構成 (Kubernetes Namespace) - ◦ △ ◦ OpenShift クラスタ構成 (Kubernetes Namespace) - ◦ △ ◦ OpenShift 永続ボリューム - - ◦ ◦ ホストのディスク - - ◦ -
  6. 8 インフラチームとユーザの責任分界点 OpenShiftのクラスターバックアップ/リストア ユースケースの例 対応方針の例 (インフラ側) 対応方針の例 (ユーザ側) ユーザが誤って Deployment

    などのオブジェクト (マニフェスト) を削除した場合の復旧プロセスや 責任範囲をどう扱うか ユーザが管理するマニフェストはクラスタ管 理者が対応する範囲でないため、ユーザの 責任で対応する GitOpsを前提にあらゆるマニフェストを Git リ ポジトリで管理する ユーザが誤って PV 上のファイルなどを削除した 場合の復旧プロセスや責任範囲をどう扱うか ストレージ基盤障害に対する復旧を前提と するため、ユーザの責任で対応する 一定の RPO を前提に CSI Driver が提供する スナップショットを利用する 外部の Object Storage に PV のバックアップ を取得する ストレージ基盤の障害によってユーザが使用する PVが失われてしまった場合の復旧プロセスや責 任範囲をどう扱うか インフラ側で取得する最新のバックアップか らリストアする 外部の Object Storage に取得していた最新 のバックアップからリストアする ╳ インフラ側でユーザのリソースを含めてバックアップ /リストアを面倒見る ⃝ ユーザが独自にバックアップ /リストアするようにしておく • どこまでインフラ側でリストアし、どこからユーザ側でリストアする、の責任分界点は明確に計画しておくこと
  7. 9 Etcdのクラスターバックアップ/リストア OpenShiftのクラスターバックアップ/リストア • OpenShiftが提供しているスクリプトを実行 ◦ CoreOSにスクリプトが仕込んである。 ◦ master nodeに入って実行するだけ。

    • クラスター全体のバックアップ/リストア ◦ リストア時はクラスター全体のリソースが復元される。 ◦ 1台でもmasterが生きていればリストアできる。 • 注意点 ◦ ストレージ(PV)のデータはバックアップされないた め、リストアできない。 ◦ 特定のNamespaceだけ、など部分的なリストアはで きない。 ◦ 別のクラスタにリストアはできない。 [root@services ~]# oc debug node/master0 Starting pod/master0-debug ... To use host binaries, run `chroot /host` Pod IP: 172.16.0.10 If you don't see a command prompt, try pressing enter. sh-4.4# chroot /host sh-4.4# /usr/local/bin/cluster-backup.sh /home/core/backup/ found latest kube-apiserver: /etc/kubernetes/static-pod-resources/kube-apiserver-pod-20 found latest kube-controller-manager: /etc/kubernetes/static-pod-resources/kube-controller-manager-pod-8 found latest kube-scheduler: /etc/kubernetes/static-pod-resources/kube-scheduler-pod-9 found latest etcd: /etc/kubernetes/static-pod-resources/etcd-pod-4 etcdctl is already installed {"level":"info","ts":1642661012.619663,"caller":"snapshot/v3_snapshot.go:68","msg":"created temporary db file","path":"/home/core/backup//snapshot_2022-01-20_064332.db.part"} {"level":"info","ts":1642661012.6269116,"logger":"client","caller":"v3/maintenance.go:211", "msg":"opened snapshot stream; downloading"} {"level":"info","ts":1642661012.6271513,"caller":"snapshot/v3_snapshot.go:76","msg":"fetchi ng snapshot","endpoint":"https://172.16.0.10:2379"} {"level":"info","ts":1642661013.1581688,"logger":"client","caller":"v3/maintenance.go:219", "msg":"completed snapshot read; closing"} {"level":"info","ts":1642661013.4697661,"caller":"snapshot/v3_snapshot.go:91","msg":"fetche d snapshot","endpoint":"https://172.16.0.10:2379","size":"81 MB","took":"now"} {"level":"info","ts":1642661013.4698682,"caller":"snapshot/v3_snapshot.go:100","msg":"saved ","path":"/home/core/backup//snapshot_2022-01-20_064332.db"} Snapshot saved at /home/core/backup//snapshot_2022-01-20_064332.db Deprecated: Use `etcdutl snapshot status` instead. {"hash":678588886,"revision":36324472,"totalKey":11757,"totalSize":81399808} snapshot db and kube resources are successfully saved to /home/core/backup/ sh-4.4# ls -l /home/core/backup/ total 79576 -rw-------. 1 root root 81399840 Jan 20 06:43 snapshot_2022-01-20_064332.db -rw-------. 1 root root 78742 Jan 20 06:43static_kuberesources_2022-01-20_064332.tar.gz
  8. 11 OpenShift API for Data Protection (OADP) OpenShiftのクラスターバックアップ/リストア • Veleroベースのバックアップ/リストアのFramework&API。

    • クラスターリソースとユーザーアプリケーションのマニフェストと PVをバックアップ/リストアできる。 • OperatorHubからインストールできる。 • 他のツールから連携して使われることがメイン。 Velero Plugin Interface Backup ISV Product Policy, Scheduling, Governance, Compliance, Reporting, etc OADP Focus Velero API As defined by upstream community k8s CSI Snapshot API velero-csi Plugin Data Mover Plugin by Backup ISV Backup ISV / 3rd Party Community / Upstream Backup Storage Location Plugins S3, Azure Blob, Google Cloud, etc Backup Storage Location Plugins S3, Azure Blob, Google Cloud, etc Backup Storage Location Plugins S3, Azure Blob, Google Cloud, etc Backup Restore Backup Storage Location Volume Snapshot Location Application Defined by Namespace and/or Label Selector Velero Custom Resources k8s Resource Plugins per Kind Backup/Restore k8s Resource Plugins per Kind Backup/Restore k8s Resource Plugins per Kind Backup/Restore Volume Snapshot Location Plugins Volume Snapshot Location Plugins Volume Snapshot Location Plugins Data Mover Controller
  9. IBM Spectrum Protect Plus for OpenShift Market leading backup and

    recovery for Kubernetes and Red Hat OpenShift Value proposition • Simplified data access: Rapid access to revenue producing data • Native Kubernetes integration: kubectl CLI, intuitive developer familiarity & simplicity, faster adoption • Consistent experience: Self-service— developers protect & reuse their own data with compliant SLAs • Dynamic scale: Uses OpenShift API for data resilience, integrated with OADP & OpenShift CSI snapshots • Certified technology: Available through Red Hat OpenShift Operator Hub and Marketplace Benefits • Drive operational efficiency: Unify and automate data protection processes across physical, virtual machines, and containerized infrastructure • Maximize developer productivity: familiar Kubernetes CLI & SLA policies for persistent volume backup & recovery • Lower storage costs: CSI snapshot support spans both container native and container ready storage • Ensure data security: Container data can be replicated and security stored in immutable IBM Cloud Object Storage or IBM Tape Key differentiators • Enterprise backup and recovery for critical workloads now extended to Kubernetes • Resilience for your data in context of applications and container infrastructure • Integrated with OpenShift tools like OpenShift API for Data Protection and OpenShift CSI snapshots • Extended support through IBM data platforms and CloudPaks Proof points • Solution Brief • Demo • IBM Solution Brief • Blog post • Deployment Tech Note • SpectrumCast (video) OpenShiftのクラスターバックアップ/リストア 12
  10. Kasten K10 Data Protection for OpenShift Clear market leader for

    Kubernetes backup and DR for OpenShift Value proposition • Application-centric: Multi-layered backup with granular restores • Integrated: OpenShift integrations including OpenShift Container Storage • Operator Hub: Certified to work with Red Hat OpenShift • Freedom of Choice: Deploy on-premise and/or clouds Use cases • Kubernetes Backup and DR: Storage and database integration Cross-Region/Cluster/Account • Kubernetes App Mobility: Complete application (storage, K8s & data services) Cross-Region/DC/Cloud, and Kubernetes distribution Benefits • More secure and resilient: Policy-based automation for backup and DR. Flexible consistency options including storage, logical, etc. • DevOps speed and scale: More secure self-service protection and recovery. Extensible workflows in shift-left environments. Key differentiators • Easy installation and Certified Operator: Built and tested to exacting standards and ready to deploy with OpenShift • Deep K10 and OCS 4 integration for resilience and durability: Perform durable backups of OCS storage classes, metadata, and local persistence of the backup to minimize restore time • Diverse workloads and freedom of choice: Global application portability and protection policies without development or application code changes • Security and automation for scale: Wide choice of authentication tools, secure access to the K10 dashboard and APIs, flexible permissions model Proof points • Website • Solution Brief • Demos: Local recovery | Disaster recovery • Kasten Blog post • Solution Guide OpenShiftのクラスターバックアップ/リストア 13
  11. TrilioVault Data Protection for OpenShift Protect your entire kubernetes applications

    with enterprise-grade backup and recovery Value proposition • Application-centric: Protects data, metadata, and Kubernetes objects • Infrastructure compatibility & cloud agnostic: Compatible with any storage (CSI, NFS, S3), or any cloud (private, AWS, GCP, Azure, IBM) • Native to Kubernetes & OpenShift: Packaged as an operator, deployed as a CRD, and API with all facilities (CSI) • Application deployment & ecosystem tooling: Helm, Operators, Labels, Prometheus, Fluentd, Grafana • Certified technology: Red Hat OpenShift Operator certification & IBM Cloud Pak certified for data, multicloud management, and applications Benefits • Nondisruptive: Lightweight Kubernetes API and CSI Snapshots to backup/capture entire application • Efficient: Use Snapshots that are incrementally updated forever • Robust restoration/recovery: To any Kubernetes or OpenShift Cluster running in public, private, or hybrid cloud • Use cases: Support for backup/restore, migrations, DR, and application mobility Key differentiators • Horizontal scale: Deployed within any Kubernetes cluster or namespace • Deployment: Operator or Helm-based • Open backup format: Nonproprietary Open Universal Schema (QCOW2) Proof points • Website • Solution Brief • Demos: Local recovery | Disaster recovery • Product: OperatorHub | Marketplace • Deployment Guide • Blog post • Webinar • OpenShift Commons Briefing (video) OpenShiftのクラスターバックアップ/リストア 14
  12. 15 [参考] Red Hat Advanced Cluster Management for Kubernetesを使ったDR OpenShiftのクラスターバックアップ/リストア

    Data Center 2 ManagedCluster 2 PASSIVE NAMESPACE PVs RESOURCES RESOURCES RESOURCES PVs PVs Volsync - Asynchronous Data Replication Data Center 1 ManagedCluster 1 NAMESPACE ACTIVE PVs RESOURCES RESOURCES RESOURCES PVs PVs RPO/RTOを極力短くできるDRソリューション • ACMの管理下のクラスタ間で、リソースと PV をレプリケーション • 自動的なクラスタFailover-Failback • Red Hat OpenShift Data Foundation(ODF) のミラーリング機能によるデータ転送 ◦ ODFを使わない場合は、 Volsyncを使用 Tech Preview
  13. linkedin.com/company/red-hat youtube.com/user/RedHatVideos facebook.com/redhatinc twitter.com/RedHat Red Hat is the world’s leading

    provider of enterprise open source software solutions. Award-winning support, training, and consulting services make Red Hat a trusted adviser to the Fortune 500. Thank you