You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Launch options provide you a way to add other volumes, add environment variables, or anything else you would need to do to run ocm-container the way you want to.
NOTE: Using the flag for launch options will then NOT use the environment variableOCM_CONTAINER_LAUNCH_OPTS
We've built in functionality to simplify the cluster login steps. Now within the contianer you can runsre-login cluster-id and it will refresh your ocm login, create a tunnel within the container if necessary, and then log-in to the cluster.
sre-login accepts both a cluster-name or a cluster-id. If the cluster-name is not unique, it will not ask which one, but display the clusters and exit.
Advanced scripting with ocm-container
We've recently added the ability to run a script within the container so that you can run ocm-container within a script.
Given the following shell script saved on the local machine in~/myproject/in-container.sh:
cat ~/myproject/in-container.sh#!/bin/bash# source this so we get all of the goodness of ocm-containersource /root/.bashrc# get the version of the clusteroc version >> report.txt
We can run that on-container with the following script which runs on the host (~/myproject/on-host.sh):
Would loop through all clusters listed inclusters.txt and then runoc version on the cluster, and add the output into report.txt and then it would exit the container, and move to the next container and do the same.
Troubleshooting
SSH Config
If you're on a mac and you get an error similar to:
Cluster is internal. Initializing Tunnel... /root/.ssh/config: line 34: Bad configuration option: usekeychain
you might need to add something similar to the following to your ssh config:
UseKeychain is a MacOS specific directive which may cause issues on the linux container that ocm-container runs within. Adding theIgnoreUnknown UseKeychain directive tells the ssh config to ignore that directive when it's unknown so it will not throw errors.
Podman/M1 MacOS Instructions
OCM Container runs as a paired down version on new M1 macs. Work is ongoing in thearm64 branch towards this effort.
The process is mostly the same. Assuming you have podman setup, with the following mounts on the podman machine: