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

推荐订阅源

美团技术团队
IT之家
IT之家
博客园 - Franky
博客园_首页
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
量子位
阮一峰的网络日志
阮一峰的网络日志
月光博客
月光博客
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
M
MIT News - Artificial intelligence
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件
Jina AI
Jina AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed

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 Secure Rook-Ceph with Pod Security Admission
Nawaz Dhandala · 2026-03-31 · via OneUptime Blog

Pod Security in Modern Kubernetes

PodSecurityPolicy (PSP) was deprecated in Kubernetes 1.21 and removed in Kubernetes 1.25. For modern clusters, use Pod Security Admission (PSA) with Pod Security Standards (PSS). Rook-Ceph requires certain privileges that must be explicitly permitted at the namespace level.

Understanding Rook's Privilege Requirements

Ceph OSD pods need:

  • privileged: true to access block devices
  • hostNetwork in some configurations
  • hostPID is not required

Ceph MON and MGR pods need:

  • No special host privileges in most deployments
  • MON uses ports 6789 and 3300, MGR uses ports starting at 6800 (all above 1024)

Configuring Pod Security Admission

Apply privileged PSS to the rook-ceph namespace:

apiVersion: v1
kind: Namespace
metadata:
  name: rook-ceph
  labels:
    pod-security.kubernetes.io/enforce: privileged
    pod-security.kubernetes.io/enforce-version: latest
    pod-security.kubernetes.io/audit: privileged
    pod-security.kubernetes.io/warn: privileged

For tighter control, use restricted at the cluster level and only allow privileged in the rook-ceph namespace:

kubectl label namespace rook-ceph \
  pod-security.kubernetes.io/enforce=privileged \
  pod-security.kubernetes.io/enforce-version=latest

Restricting Application Namespaces

Application namespaces that only use Ceph storage through CSI should use restricted mode:

apiVersion: v1
kind: Namespace
metadata:
  name: production
  labels:
    pod-security.kubernetes.io/enforce: restricted
    pod-security.kubernetes.io/audit: restricted
    pod-security.kubernetes.io/warn: restricted

Security Context for Rook Operator

Set security context on the Rook operator deployment (in Helm values or direct manifest edit):

securityContext:
  runAsNonRoot: true
  readOnlyRootFilesystem: true
  allowPrivilegeEscalation: false
  capabilities:
    drop:
      - ALL

OSD Pod Security Context

OSD pods require privileged access for device management. The Rook operator automatically sets the appropriate security context for OSD pods. You can verify OSD pods are running with privileged access:

kubectl get pod -n rook-ceph -l app=rook-ceph-osd \
  -o jsonpath='{.items[0].spec.containers[0].securityContext}'

Audit PSA Violations

Check if any Rook pods would violate a stricter policy by using warn mode, which prints warnings to the client when pods are created:

kubectl label namespace rook-ceph \
  pod-security.kubernetes.io/warn=baseline \
  --overwrite

Then recreate or rollout restart a pod to see warnings in the kubectl output. You can also use dry-run to test without actually creating pods:

kubectl get pod -n rook-ceph -l app=rook-ceph-osd -o yaml | \
  kubectl apply --dry-run=server -f -

Revert to privileged after auditing:

kubectl label namespace rook-ceph \
  pod-security.kubernetes.io/warn=privileged \
  --overwrite

Summary

Pod Security Admission and Pod Security Standards replace PodSecurityPolicy in modern Kubernetes. Rook-Ceph requires the privileged enforcement level on its own namespace due to OSD device access requirements. Application namespaces should use restricted mode since they only interact with Ceph through the CSI driver and never need host-level access.