Contexts
Contexts
Context is holding certificates, keys, control plane URL, and name of the agent. They are used for authentication against the simplecontainer.
The authentication is done via mTLS using certificates when simplecontainer node is started certificates are generated under ~/.ssh/simplecontainer
. Certificates for the smr CLI are bundles as .pem
file with name of the agent that is running it.
There are a few commands to help out while using smr CLI:
smr context export
smr context export <<< https://smr.example.com
This command is used for the exporting of the current context for external usage. It exports context encrypts it and saves the encryption key at $HOME/smr/smr/contexts/$(smr context).key
This can used later for importing.
Can be utilized for distributing contexts for developers or as a service account for machine authentication.
smr context import
smr context import {{exported}} <<< {{key}}
This command is used for the importing the exported context. Afterward, smr CLI can be used for communication to the external simplecontainer.
smr context switch
smr context switch
This command is used for switching the current context so you can communicate with different simplecontainer nodes.
Another form is smr context switch {{name}}
where name is the name of the agent.
smr context connect
smr context connect https://localhost:1443 $HOME/.ssh/simplecontainer/root.pem --context smr-agent-1
This command is used for connecting to the simplecontainer node when .pem
bundle is present on the local machine - this is mainly used on the localhost when starting the simplecontainer node.
Otherwise it is recommended to use context and import.
smr context
smr context
This command prints out the current context.