Kyverno Policy Compliance for Db2 Operator V2
You can use Kyverno for policy management for your Db2 Operator V2 restricted‑v2 deployments. Kyverno is a Kubernetes‑native policy engine that automates security, governance, and best‑practice enforcement.
What is Kyverno
Kyverno policies are declarative and are designed to be easy to create, apply, and manage. When policies are applied to a cluster, Kyverno evaluates Kubernetes resources against defined security and best‑practice rules and reports or enforces compliance based on policy configuration.
For more information about Kyverno, see Kyverno.
Supported Kyverno policy coverage and alignment
Db2 Operator V2 restricted‑v2 deployments are validated for compatibility with Kyverno policy definitions up to version 1.17. They are designed to align with Kyverno best‑practice and Pod Security policy requirements by default, ensuring that Db2 Operator V2 workloads remain compatible with clusters where Kyverno policies are enforced, without requiring workload‑specific changes. When Kyverno policies are configured in Enforce mode, restricted‑v2 deployments are expected to satisfy the supported policy requirements.
Db2 Operator V2 supports Kyverno policy compliance within a defined scope that focuses on Kubernetes security and best‑practice standards for restricted‑v2 deployments.
- Best Practices policies
-
Best practice policies help with the following:
- Improves security posture
- Increases reliability and stability
- Ensures consistency across Db2 Operator V2 workloads
Best Practices policies can be configured to run in either Audit mode or Enforce mode.
- Pod Security policies
- Pod Security policies can be configured to run in either Audit mode or Enforce mode and enforce pod‑level security controls beyond the default Kubernetes mechanisms.
Db2 Operator V2 restricted‑v2 deployments are designed to align with the controls evaluated by the supported Kyverno policy categories. This alignment ensures compatibility with clusters where Kyverno policies are enforced.
- Pod security
- No use of
hostIPC,hostPID, orhostNetwork. - No privileged containers.
- Enforced non‑root execution (
runAsNonRoot). allowPrivilegeEscalation: false.- Seccomp profile set to
RuntimeDefault.
- No use of
- Container security best practices
- Read‑only root file system where applicable.
- Dropped Linux capabilities, retaining only those required.
- No root user execution
- Controlled use of writable volumes.
- Image and registry usage
- Compatibility with trusted or approved container registries.
- Avoidance of mutable image tags such as latest.
- Resource and reliability configuration
- Defined CPU and memory requests and limits.
- Configured liveness and readiness probes.
- Volume and storage usage
- No use of
hostPathvolumes. - Use of persistent volume claims (PVCs) and compliant ephemeral storage.
- No use of
- Network exposure controls
- No use of
externalIPsin Services. - No use of
NodePortServices.Important: To comply with Kyverno policies that disallow NodePort Services, deploy the Db2 Operator V2 Db2uInstance custom resource with the following setting:environment: disableNodePortService: true
- No use of
Policy evaluation modes
- Audit mode
- Evaluates Db2 Operator V2 Kubernetes resources against policy rules and reports violations without blocking deployment.
- Enforce mode
- Prevents non‑compliant Db2 Operator V2 Kubernetes resources from being created or updated.