Let's look at some basic kubectl output options.
Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).
We can start with:
kubectl get no
| require 'cucumber' | |
| require 'selenium-webdriver' | |
| # require 'cukehub' # optional, but recommended. See cukehub.com for more details | |
| caps = Selenium::WebDriver::Remote::Capabilities.chrome(chromeOptions: { binary: "/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary", | |
| args: [ "--headless" ]}) | |
| Before do | |
| @browser = Selenium::WebDriver.for :chrome, desired_capabilities: caps | |
| end |
| DUMP | |
| // pod-name name of the postgres pod | |
| // postgres-user database user that is able to access the database | |
| // database-name name of the database | |
| kubectl exec [pod-name] -- bash -c "pg_dump -U [postgres-user] [database-name]" > database.sql | |
| RESTORE | |
| // pod-name name of the postgres pod | |
| // postgres-user database user that is able to access the database | |
| // database-name name of the database |
| # Example YAML configuration for the sidecar pattern. | |
| # It defines a main application container which writes | |
| # the current date to a log file every five seconds. | |
| # The sidecar container is nginx serving that log file. | |
| # (In practice, your sidecar is likely to be a log collection | |
| # container that uploads to external storage.) | |
| # To run: |
If your master.key has been compromised, you might want to regenerate it.
No key regeneration feature at the moment. We have to do it manually.
rails credentials:show somewhere temporarily.config/master.key and config/credentials.yml.encEDITOR=vim rails credentials:edit in the terminal: This command will create a new master.key and credentials.yml.enc if they do not exist.config/credentials.yml.enc| ARG RUBY_VERSION | |
| # === Base image === | |
| FROM ruby:${RUBY_VERSION}-slim-buster as base | |
| ARG NODE_MAJOR | |
| ARG POSTGRES_VERSION | |
| ARG BUNDLER_VERSION | |
| ARG YARN_VERSION | |
| # Common dependencies |
| FROM debian:buster-slim | |
| ARG RUBY_VERSION=2.7.1-jemalloc | |
| # RUN with pipe recommendation: https://github.com/hadolint/hadolint/wiki/DL4006 | |
| SHELL ["/bin/bash", "-o", "pipefail", "-c"] | |
| RUN apt-get update -q \ | |
| && apt-get dist-upgrade --assume-yes \ | |
| && apt-get install --assume-yes -q --no-install-recommends \ | |
| curl \ |