diff --git a/Dockerfile b/Dockerfile index 7a8d50a..553d9c1 100755 --- a/Dockerfile +++ b/Dockerfile @@ -5,10 +5,12 @@ label maintainer="Hossam Hammady " ENV NEW_RELIC_LOG=stdout ENV NEW_RELIC_AUTOSTART_DENYLISTED_CONSTANTS=Scaltainer +RUN gem install bundler --version 2.2.19 + WORKDIR /home COPY / /home/ RUN bundle install && bundle exec rake install -ENTRYPOINT ["scaltainer"] +ENTRYPOINT ["bundle", "exec", "scaltainer"] CMD ["-h"] diff --git a/Gemfile.lock b/Gemfile.lock index d85f038..a76ad2d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -100,7 +100,7 @@ PLATFORMS ruby DEPENDENCIES - bundler (~> 1.15) + bundler (>= 2.2.10) coderay (~> 1.1) coveralls (~> 0.8) rake (>= 12.3.3) @@ -108,4 +108,4 @@ DEPENDENCIES scaltainer! BUNDLED WITH - 1.17.3 + 2.2.19 diff --git a/README.md b/README.md index c9afb28..bc37219 100644 --- a/README.md +++ b/README.md @@ -22,15 +22,15 @@ Install using rubygems: For Docker swarm: - scaltainer -o swarm + bundle exec scaltainer -o swarm Or simply: - scaltainer + bundle exec scaltainer For Kubernetes: - scaltainer -o kubernetes + bundle exec scaltainer -o kubernetes This will do a one-time check on the running docker service replicas @@ -38,7 +38,7 @@ or Kubernetes replication controllers, replica sets, or deployments. Then it sends scaling out/in commands to the cluster as appropriate. Configuration is read from `scaltainer.yml` by default. If you want to read from another file add `-f yourconfig.yml`: - scaltainer -f yourconfig.yml + bundle exec scaltainer -f yourconfig.yml Note that after each run a new file is created (`yourconfig.yml.state`) which stores the state of the previous run. This is because there are some configuration parameters (like sensitivity) need to @@ -46,19 +46,19 @@ remember previous runs. If you want to specify a different location for the state file, add the `--state-file` parameter. Example: - scaltainer -f /path/to/configuration/file.yml --state-file /path/to/different/state/file.yml + bundle exec scaltainer -f /path/to/configuration/file.yml --state-file /path/to/different/state/file.yml Typically one would want to repeatedly call scaltainer every minute or so. To do this specify the wait time between repetitions using the `-w` parameter in seconds: - scaltainer -w 60 + bundle exec scaltainer -w 60 This will repeatedly call scaltainer every 60 seconds, sleeping in-between. If you would like to monitor the changes in scaling out and in. You can install Prometheus and add a configuration parameter pointing to its Push Gateway: - scaltainer -g prometheus-pushgateway.monitoring.svc.cluster.local:9091 + bundle exec scaltainer -g prometheus-pushgateway.monitoring.svc.cluster.local:9091 Where `prometheus-pushgateway.monitoring.svc.cluster.local:9091` is the address of the push gateway. For Kubernetes environments the above denotes the gateway service diff --git a/scaltainer.gemspec b/scaltainer.gemspec index b28c3f3..cc8e307 100644 --- a/scaltainer.gemspec +++ b/scaltainer.gemspec @@ -22,7 +22,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_development_dependency "bundler", "~> 1.15" + spec.add_development_dependency "bundler", ">= 2.2.10" spec.add_development_dependency "rake", ">= 12.3.3" spec.add_development_dependency 'rspec', '~> 3.5' spec.add_development_dependency 'coderay', '~> 1.1'