Skip to content

Allow openshift-serverless namespace to pull images from openshift-marketplace#1663

Merged
openshift-merge-robot merged 1 commit into
openshift-knative:mainfrom
pierDipi:allow-openshift-serverless-ns-to-pull-images-from-cluster-internal-registry
Aug 1, 2022
Merged

Allow openshift-serverless namespace to pull images from openshift-marketplace#1663
openshift-merge-robot merged 1 commit into
openshift-knative:mainfrom
pierDipi:allow-openshift-serverless-ns-to-pull-images-from-cluster-internal-registry

Conversation

@pierDipi
Copy link
Copy Markdown
Member

@pierDipi pierDipi commented Aug 1, 2022

When using ON_CLUSTER_BUILDS for make images I'm getting

Failed to pull image "image-registry.openshift-image-registry.svc:5000/openshift-marketplace/knative-operator": rpc error: code = Unknown desc = reading manifest latest in image-registry.openshift-image-registry.svc:5000/openshift-marketplace/knative-operator: unauthorized: authentication required

We need to allow openshift-serverless namespace to pull images
from the namespace openshift-marketplace as documented in
https://docs.openshift.com/container-platform/4.7/openshift_images/managing_images/using-image-pull-secrets.html#images-allow-pods-to-reference-images-across-projects_using-image-pull-secrets

Apparently, the command that we already (pasted below) run is not
enough for this case:

oc adm policy add-role-to-group system:image-puller system:unauthenticated --namespace openshift-marketplace

This is blocking openshift/knative-eventing#1822, see also the same error here:
https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openshift_knative-eventing/1822/pull-ci-openshift-knative-eventing-release-v1.4-46-test-e2e-aws-ocp-46/1553039593392050176/artifacts/test-e2e-aws-ocp-46/gather-extra/artifacts/pods.json, grep for Back-off pulling image \"image-registry.openshift-image-registry.svc:5000/openshift-marketplace/knative-operator\"

Signed-off-by: Pierangelo Di Pilato pierdipi@redhat.com

@openshift-ci openshift-ci Bot requested review from jcrossley3 and mgencur August 1, 2022 09:57
@openshift-ci openshift-ci Bot added the approved label Aug 1, 2022
@pierDipi pierDipi force-pushed the allow-openshift-serverless-ns-to-pull-images-from-cluster-internal-registry branch from b4cc208 to 9e1b4b4 Compare August 1, 2022 09:57
@pierDipi
Copy link
Copy Markdown
Member Author

pierDipi commented Aug 1, 2022

Generated files job will be fixed in #1662

@pierDipi pierDipi force-pushed the allow-openshift-serverless-ns-to-pull-images-from-cluster-internal-registry branch from 9e1b4b4 to 7fba200 Compare August 1, 2022 10:07
…rketplace

When using `ON_CLUSTER_BUILDS` for `make images` I'm getting
```
Failed to pull image "image-registry.openshift-image-registry.svc:5000/openshift-marketplace/knative-operator": rpc error: code = Unknown desc = reading manifest latest in image-registry.openshift-image-registry.svc:5000/openshift-marketplace/knative-operator: unauthorized: authentication required
```

We need to allow `openshift-serverless` namespace to pull images
from the namespace `openshift-marketplace` as documented in
https://docs.openshift.com/container-platform/4.7/openshift_images/managing_images/using-image-pull-secrets.html#images-allow-pods-to-reference-images-across-projects_using-image-pull-secrets

Apparently, the command that we already (pasted below) run is not
enough for this case:
```
oc adm policy add-role-to-group system:image-puller system:unauthenticated --namespace openshift-marketplace
```

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
@pierDipi pierDipi force-pushed the allow-openshift-serverless-ns-to-pull-images-from-cluster-internal-registry branch from 7fba200 to bb4855e Compare August 1, 2022 10:08
@pierDipi
Copy link
Copy Markdown
Member Author

pierDipi commented Aug 1, 2022

/cc @aliok

@openshift-ci openshift-ci Bot requested a review from aliok August 1, 2022 10:14
Comment on lines 53 to +59
# Allow OPM to pull the serverless-bundle from openshift-marketplace ns from internal registry.
oc adm policy add-role-to-group system:image-puller system:unauthenticated --namespace openshift-marketplace

# export ON_CLUSTER_BUILDS=true; make images
# will push images to ${OLM_NAMESPACE} namespace, allow the ${OPERATORS_NAMESPACE} namespace to pull those images.
oc adm policy add-role-to-group system:image-puller system:serviceaccounts:"${OPERATORS_NAMESPACE}" --namespace "${OLM_NAMESPACE}"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other option might be:

oc adm policy add-role-to-group system:image-puller system:authenticated --namespace openshift-marketplace

but given the TODO above, I went with more minimal permissions possible without requiring to list every service account that would require keeping the list updated.

@dsimansk
Copy link
Copy Markdown
Contributor

dsimansk commented Aug 1, 2022

/lgtm

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Aug 1, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dsimansk, pierDipi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 4f5a737 into openshift-knative:main Aug 1, 2022
@pierDipi pierDipi deleted the allow-openshift-serverless-ns-to-pull-images-from-cluster-internal-registry branch August 1, 2022 13:02
@pierDipi pierDipi restored the allow-openshift-serverless-ns-to-pull-images-from-cluster-internal-registry branch February 19, 2025 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants