Kubernetes Snippets

View Source

Connecting to a Cluster

See Remote Access

You'll need to exit the iex session(ctrl+c 2x) to get back to your shell

Copy File To Pod

Find a pod running the API service:

kubectl get po | grep api

Copy the CSV file to the pod:

kubectl cp -n default '/Users/path/to/local/csv_file.csv' <pod-id>:tmp/csv_file.csv

Note

The kubectl cp cmd also works with directories. The path above would look like this:

/Users/path/to/csvs/ <pod-id>:tmp/csvs

Confirm the application has access to the file

exec into the pod

kubectl exec -it <pod-id> -- "vetspire/bin/vetspire" "remote"

Make sure the file exists

File.exists?("tmp/csv_file.csv")