Closed ghost closed 2 years ago
Hello, thanks for reporting this issue.
This is how Cuber works:
launcher
command before the actual command if you use buildpackslauncher
prefix, if you provide a custom DockerfileCheck out this file: https://github.com/cuber-cloud/cuber-gem/blob/master/lib/cuber/commands/run.rb
Cuber detects whether you are using buildpacks or not based on an annotation that keeps in the K8s cluster (i.e. it keeps a note saying if the last deploy used buildpacks or not).
In your case it seems that Cuber finds the annotation, and thus adds the launcher
prefix.
The line that generates the annotation seems correct.
Can you try to run cuber deploy
again and see if that fixes the annotation and the issue? You can easily inspect the annotation on the namespace using K8s lens.
If you can inspect the annotations on the namespace using K8s lens (or any other tool) and tell me what is the current value, that would help solving this issue.
I was able to reproduce the problem, I'll release a fix as soon as possible.
Installed K8 Lens, it made me feel powerful, sorry for being a slow poke. Just started to learn what Kubernetes is yesterday.
Have worked with people who know it well, some of the stuff they have said to me helped.
Thank you.
@leigh-mackay I have just released v1.2.1 of this gem which fixes this issue.
Running
cuber run rails console
Produces this error
Running the kubectl command without launcher works.
kubectl --kubeconfig kubeconfig.yml -n myapp exec -it pod-rails-console-20220608085854 -- rails console
Produces a rails console and pod and works perfectly.
Loading production environment (Rails 7.0.3) irb(main):001:0>
My Docker file is Identical to the docs except for addition of libvips42
FROM ruby:3.0.2 ARG RAILS_ENV=production RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list RUN apt-get update && apt-get install -y nodejs yarn postgresql-client default-mysql-client libvips42 RUN mkdir /app WORKDIR /app COPY Gemfile Gemfile.lock ./ RUN gem install bundler RUN bundle config set without 'development test' RUN bundle install COPY . . RUN SECRET_KEY_BASE=
bin/rake secret
rails assets:precompile EXPOSE 8080 CMD ["rails", "server", "-b", "0.0.0.0", "-p", "8080"]If I switch and use 'heroku/buildpacks:20' everything works, only issue with the heroku setup was it does not have vips out of the box so I'm preferring the Dockerfile setup.