To make policies available on Artifact Hub, create an artifacthub-pkg.yml file in the policy's directory.
Key Requirements:
- name: Alphanumeric characters and dashes only.
- description: This should match the value used in the
policies.kyverno.io/description annotation. - install: Provide the
kubectl apply command used to install the policy. - keywords: Must include
kyverno and the value from the policies.kyverno.io/category annotation. - readme: Should contain the description from the annotation plus a static concluding sentence.
- digest: A SHA256 hash of the policy. Note: This must be generated on a Linux system to ensure consistency with Kyverno's CI validation (Windows-generated digests may differ due to control characters).
- Updating: When updating an existing policy, recalculate the SHA256 sum and update the
digest field so Artifact Hub detects the change.
---
name: backup-all-volumes # The name of the package (only alphanum, no spaces, dashes allowed)
version: 1.0.0 # Version of the policy
displayName: Backup All Volumes # Display name of the policy
createdAt: "2023-03-29T00:00:00.000Z" # The date this package was created (RFC3339 layout)
description: >-
# The description value should be taken from the relevant annotation policies.kyverno.io/description
In order for Velero to backup volumes in a Pod using an opt-in approach, it
requires an annotation on the Pod called `backup.velero.io/backup-volumes` with the
value of a comma-separated list of the volumes mounted to that Pod. This policy
automatically annotates Pods (and Pod controllers) which refer to a PVC so that
all volumes are listed in the aforementioned annotation if a Namespace with the label
`velero-backup-pvc=true`.
install: |- # The installation instructions for the package
```shell
kubectl apply -f https://raw.githubusercontent.com/kyverno/policies/main/velero/backup-all-volumes/backup-all-volumes.yaml
```
keywords: # Keywords should always have "kyverno" and whatever the value of the policies.kyverno.io/category annotation.
- velero
- kyverno
readme: | # readme should be same as policies.kyverno.io/description annotation plus the last sentence as a static value.
In order for Velero to backup volumes in a Pod using an opt-in approach, it
requires an annotation on the Pod called `backup.velero.io/backup-volumes` with the
value of a comma-separated list of the volumes mounted to that Pod. This policy
automatically annotates Pods (and Pod controllers) which refer to a PVC so that
all volumes are listed in the aforementioned annotation if a Namespace with the label
`velero-backup-pvc=true`.
Refer to the documentation for more details on Kyverno annotations: https://artifacthub.io/docs/topics/annotations/kyverno/
annotations:
kyverno/category: "Velero"
kyverno/kubernetesVersion: "1.25"
kyverno/subject: "Pod, Annotation"
digest: 795012387c2755c61fa802fea900011c45520c2cffb27238210933ebb9a7f2c0 # The SHA256 hash String that uniquely identifies this package version