k8simagedigests
Basic Information
Function
The container image must contain digest.
Policy Example
The following policy instance shows the types of resources for which the policy definition takes effect.
apiVersion: constraints.gatekeeper.sh/v1beta1 kind: K8sImageDigests metadata: name: container-image-must-have-digest spec: match: kinds: - apiGroups: [""] kinds: ["Pod"] namespaces: - "default"
Resource Definition That Complies with the Policy
The container image contains digest, which complies with the policy instance.
apiVersion: v1 kind: Pod metadata: name: opa-allowed spec: containers: - name: opa image: openpolicyagent/opa:0.9.2@sha256:04ff8fce2afd1a3bc26260348e5b290e8d945b1fad4b4c16d22834c2f3a1814a
Resource Definition That Does Not Comply with the Policy
The container image does not contain digest, which does not comply with the policy instance.
apiVersion: v1 kind: Pod metadata: name: opa-disallowed spec: containers: - name: opa image: openpolicyagent/opa:0.9.2
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot