admissionConfig:
pluginConfig:
openshift.io/ImagePolicy:
configuration:
kind: ImagePolicyConfig
apiVersion: v1
resolveImages: AttemptRewrite (1)
executionRules: (2)
- name: execution-denied
# Reject all images that have the annotation images.openshift.io/deny-execution set to true.
# This annotation may be set by infrastructure that wishes to flag particular images as dangerous
onResources: (3)
- resource: pods
- resource: builds
reject: true (4)
matchImageAnnotations: (5)
- key: images.openshift.io/deny-execution
value: "true"
skipOnResolutionFailure: true (6)
- name: allow-images-from-internal-registry
# allows images from the internal registry and tries to resolve them
onResources:
- resource: pods
- resource: builds
matchIntegratedRegistry: true
- name: allow-images-from-dockerhub
onResources:
- resource: pods
- resource: builds
matchRegistries:
- docker.io
resolutionRules: (7)
- targetResource:
resource: pods
localNames: true
- targetResource: (8)
group: batch
resource: jobs
localNames: true (9)
1 | Try to resolve images to an immutable image digest and update the image pull specification in the pod. |
2 | Array of rules to evaluate against incoming resources. If you only have reject==true rules, the default is allow all. If you have any accept rule, the default is deny all. |
3 | Indicates which resources to enforce rules upon. If nothing is specified, the default is pods. |
4 | Indicates that if this rule matches, the pod should be rejected. |
5 | List of annotations to match on the image object’s metadata. |
6 | If you are not able to resolve the image, do not fail the pod. |
7 | Array of rules allowing use of image streams in Kubernetes resources. The default configuration allows pods, replication controllers, replica sets, deployments, and jobs to use same-project image stream tag references in their image fields. |
8 | Identifies the group and resource to which this rule applies. If resource is * ,
this rule will apply to all resources in that group. |
9 | LocalNames will allow single segment names (for example, ruby:2.4 ) to be
interpreted as namespace-local image stream tags, but only if the resource or
target image stream has
local name
resolution enabled. |