Skip to content
This repository has been archived by the owner on Feb 14, 2025. It is now read-only.

Pod fails when deploying on Red Hat Openshift #60

Open
bschonec opened this issue Apr 1, 2024 · 4 comments
Open

Pod fails when deploying on Red Hat Openshift #60

bschonec opened this issue Apr 1, 2024 · 4 comments

Comments

@bschonec
Copy link
Contributor

bschonec commented Apr 1, 2024

In Red Hat Openshift 4.1, the puppetdb pod crashes after a successful build.

Steps I used to produce:

  1. Created OpenShift project
  2. As the Developer user, click Add then "Git Repository/Import from Git"
  3. In the "Git Repo Url", enter https://github.com/voxpupuli/container-puppetdb.git (The Ruby 3.1 (UBI 8) Builder image is selected automatically.)
  4. Click Create

After Build completes successfully, but the Pod continuously crashes with the following error:

You might consider adding 'puma' into your Gemfile.
ERROR: Rubygem Rack is not installed in the present image.
       Add rack to your Gemfile in order to start the web server.

I'm a novice at Openshift so I don't have much else to provide. I know next to nothing about Ruby but perhaps the Gemfile or Rakefile need to be updated to include the Rack gem?

@rwaffen
Copy link
Member

rwaffen commented Apr 2, 2024

I'll take a look at this.

@rwaffen
Copy link
Member

rwaffen commented Apr 5, 2024

sry, we have no openshift knwoledge atm. but as far as i understand you try to build the container yourself from this repository?

we kindly recommend using the pre-builded images we provide on ghcr and docker hub.

we have version tags like 8.3.0-v1.3.0 or up2date builds on push with 8.3.0-main. same goes for the 7 release of puppetdb.

@bschonec
Copy link
Contributor Author

bschonec commented Apr 5, 2024

@rwaffen, thank you for your attention to this. The pre-built image doesn't work, either probably because of OpenShift's requirement that pods run as a non-root, random-ish UID. I'm working on a fix for that as well, but my OS knowledge is lacking.

I got past these errors by adding puma and rack to the Gemfile but I don't know how that affects builds on non-OpenShift platforms. Is there a way in the Gemfile to do something like:

if $BUILDENVIRONMENT = 'OPENSHIFT' then
  include gem rack
  include gem puma
end

??

@rwaffen
Copy link
Member

rwaffen commented May 31, 2024

sry for late reply:

you could try

# add a gem when env var test is set to true
gem 'rspec', '~> 3.0' if ENV['test'] == 'true'

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants