惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
IT之家
IT之家
博客园 - Franky
Stack Overflow Blog
Stack Overflow Blog
宝玉的分享
宝玉的分享
Recent Announcements
Recent Announcements
Engineering at Meta
Engineering at Meta
S
SegmentFault 最新的问题
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
H
Help Net Security
V
V2EX
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
博客园 - 叶小钗
J
Java Code Geeks
博客园 - 【当耐特】
月光博客
月光博客
爱范儿
爱范儿
人人都是产品经理
人人都是产品经理
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件

OneUptime Blog

How to Monitor Azure App Services (PaaS) with OpenTelemetry Grafana Stack vs OneUptime: DIY Observability or Unified Platform? Your AI Workloads Are About to Blow Up Your Observability Bill The Great Observability Consolidation Is Here How to Write Custom Object Classes for Ceph How to Write Custom Ceph Manager Modules How to Write a ceph.conf Configuration File How to Use Rook-Ceph with OpenShift How to Use Rook-Ceph with Longhorn for Comparison How to Configure Volume Snapshot Class for RBD in Rook How to Configure VolumeReplicationClass Scheduling Intervals in Rook How to Set Up Volume Replication with Rook-Ceph How to Create Volume Group Snapshots with Rook CSI How to Visualize Ceph Network Performance in Grafana How to Enable Virtual Host-Style Bucket Access in Rook How to View Runtime Configuration via Admin Socket How to View Quota Settings and Update Stats in Ceph RGW How to View PG Scaling Recommendations with autoscale-status How to View PG Distribution via Admin Socket How to View Performance Metrics in the Ceph Dashboard How to View OSD Performance Counters in Ceph How to View Connection Status via Admin Socket How to View Ceph Cluster Summary Dashboard via CLI How to Version Control Rook-Ceph Configuration How to Version Control Ceph Infrastructure with Terraform How to Verify Kubernetes Node Requirements for Rook-Ceph Deployment How to Verify Health Before and After Rook Upgrades How to Verify Data Integrity with Deep Scrubbing How to Verify Complete Rook-Ceph Cleanup How to Verify Backup Integrity from Ceph Snapshots
How to Integrate HashiCorp Vault with Rook-Ceph (Token Auth)
Nawaz Dhandala · 2026-03-31 · via OneUptime Blog

Overview

HashiCorp Vault is the most widely used KMS backend for Rook-Ceph encryption. Token authentication is the simplest Vault auth method - a long-lived Vault token is stored as a Kubernetes Secret, and Rook uses it to read and write encryption keys. This approach is suitable for environments where Vault is not running in Kubernetes.

Prerequisites

  • HashiCorp Vault accessible from the Kubernetes cluster
  • A Vault token with read/write access to the secrets path
  • Rook-Ceph with CSI encryption support enabled

Step 1 - Configure Vault

Enable the KV secrets engine and create a policy for Rook:

# Enable KV secrets engine at path secret/
vault secrets enable -path=secret kv-v2

# Create a Vault policy for Rook encryption keys
vault policy write rook-ceph-encryption - <<EOF
path "secret/data/rook-ceph/*" {
  capabilities = ["create", "read", "update", "delete", "list"]
}
path "secret/metadata/rook-ceph/*" {
  capabilities = ["list", "delete"]
}
EOF

# Create a token with the policy
vault token create -policy=rook-ceph-encryption -ttl=0 -orphan

Step 2 - Store the Vault Token as a Kubernetes Secret

kubectl create secret generic rook-vault-token \
  --from-literal=token="<vault-token>" \
  -n rook-ceph

Step 3 - Configure the KMS ConfigMap

apiVersion: v1
kind: ConfigMap
metadata:
  name: rook-ceph-csi-kms-config
  namespace: rook-ceph
data:
  config.json: |-
    {
      "vault-token-kms": {
        "encryptionKMSType": "vault",
        "vaultAddress": "https://vault.example.com:8200",
        "vaultBackend": "v2",
        "vaultBackendPath": "secret/",
        "vaultDestroyKeys": "true",
        "vaultCAFromSecret": "vault-ca-cert",
        "vaultTokenSecretName": "rook-vault-token"
      }
    }
kubectl apply -f kms-config.yaml

Step 4 - Reference the KMS in the CephCluster

apiVersion: ceph.rook.io/v1
kind: CephCluster
metadata:
  name: rook-ceph
  namespace: rook-ceph
spec:
  security:
    kms:
      connectionDetails:
        KMS_PROVIDER: vault
        VAULT_ADDR: https://vault.example.com:8200
        VAULT_BACKEND_PATH: secret
        VAULT_AUTH_METHOD: token
      tokenSecretName: rook-vault-token

Step 5 - Verify Vault Integration

Create an encrypted StorageClass that references the KMS:

parameters:
  encrypted: "true"
  encryptionKMSID: vault-token-kms

Create a test PVC and check Vault for the created key:

vault kv list secret/rook-ceph/

You should see key entries for each encrypted volume.

Token Renewal Considerations

Vault tokens expire unless configured as non-expiring (-ttl=0). For tokens with TTLs, implement a renewal CronJob:

vault token renew <token>

Or switch to Kubernetes auth (covered in a separate guide) which handles renewal automatically.

Summary

Vault token authentication is the fastest way to integrate HashiCorp Vault with Rook-Ceph encryption. A Vault token stored as a Kubernetes Secret provides Rook access to the KV secrets engine for storing and retrieving per-volume encryption keys. For production environments, consider migrating to Kubernetes auth method for automatic token renewal.