Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run bundle{-upgrade} should able to pull image from insecure registry #4815

Closed
avalluri opened this issue Apr 20, 2021 · 4 comments · Fixed by #4816
Closed

run bundle{-upgrade} should able to pull image from insecure registry #4815

avalluri opened this issue Apr 20, 2021 · 4 comments · Fixed by #4816
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. olm-integration Issue relates to the OLM integration
Milestone

Comments

@avalluri
Copy link
Contributor

Feature Request

Optional support for operator-sdk run bundle/bundle-upgrade pulling the bundle image from an insecure container registry.

Describe the problem you need a feature to resolve.

I run a local insecure docker image for testing. I push the generated operator bundle image to the local docker registry.
Running the operator-sdk run bundle localhost:5000/pmem-csi-bundle:v0.9.0 fails to install the operator:

$ operator-sdk run bundle localhost:5000/pmem-csi-bundle:v0.9.0 --verbose
FATA[0000] Failed to run bundle: pull bundle image: error pulling image localhost:5000/pmem-csi-bundle:v0.9.0: error resolving name : failed to do request: Head "https://localhost:5000/v2/pmem-csi-bundle/manifests/v0.9.0": http: server gave HTTP response to HTTPS client 

Describe the solution you'd like.

The opm tool already supports pulling images from the insecure registery when asked using --skip-tls, operator-sdk could make used of this to support insecure registries. Provide a command-line argument for operator-sdk run bundle to enable/disable the --skip-tls :

 `$ operator-sdk run bundle <bundleImage> [--allow-insecrue]`
@estroz estroz added kind/feature Categorizes issue or PR as related to a new feature. olm-integration Issue relates to the OLM integration labels Apr 20, 2021
@estroz
Copy link
Member

estroz commented Apr 20, 2021

/cc @jmrodri @Venkat19967

@jmrodri
Copy link
Member

jmrodri commented Apr 21, 2021

@avalluri Thank you for the PR and issue. We have @Venkat19967 working on part of this and realized we were going down the same path as you with the skiptls :)

@Venkat19967 is working on using a local registry to allow us to e2e test the run bundle feature in CI.

@jberkhahn jberkhahn added this to the v1.7.0 milestone Apr 26, 2021
@Venkat19967
Copy link
Contributor

@avalluri Thank you for working on this flag. It is very helpful

@estroz estroz modified the milestones: v1.7.0, v1.8.0 Apr 28, 2021
@hj-johannes-lee
Copy link

hj-johannes-lee commented Apr 12, 2022

Hello, I am trying to run with insecure registry running on localhost as the example in the issue.

$ operator-sdk version
operator-sdk version: "v1.19.0", commit: "728682c347f6335ee2a610e08790a5e1411508f4", kubernetes version: "1.23", go version: "go1.17.8", GOOS: "linux", GOARCH: "amd64"

$operator-sdk run bundle localhost:5000/test:devel -n testoperator --skip-tls

$kubectl logs -n testoperator   localhost-5000-test-devel
...
time="2022-04-12T21:30:43Z" level=info msg="adding to the registry" bundles="[localhost:5000/test:devel]"
time="2022-04-12T21:30:43Z" level=info msg="trying next host" error="failed to do request: Head \"http://localhost:5000/v2/test/manifests/devel\": dial tcp 127.0.0.1:5000: connect: connection refused" host="localhost:5000"
time="2022-04-12T21:30:43Z" level=error msg="permissive mode disabled" bundles="[localhost:5000/test:devel]" error="[error resolving name : failed to do request: Head \"http://localhost:5000/v2/test/manifests/devel\": dial tcp 127.0.0.1:5000: connect: connection refused, image \"localhost:5000/test:devel\": not found]"
Error: [error resolving name : failed to do request: Head "http://localhost:5000/v2/test/manifests/devel": dial tcp 127.0.0.1:5000: connect: connection refused, image "localhost:5000/test:devel": not found]
Usage:
  opm registry add [flags]

Flags:
  -b, --bundle-images strings   comma separated list of links to bundle image
...

$kubectl describe pod -n testoperator   localhost-5000-test-devel
...
    Command:
      sh
      -c
      mkdir -p /database && \
      opm registry add -d /database/index.db -b localhost:5000/test:devel --mode=semver --skip-tls=true && \
      opm registry serve -d /database/index.db -p 50051

It still does not work for the 'localhost' the container's localhost is not the host's localhost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. olm-integration Issue relates to the OLM integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants