Ideally, you should set up observability so that manual debugging is not needed.
Opta provides 2 helpful commands to help with debugging:
This will show you logs from all your app instances.
SSH into an instance
This will open up a shell into one of your app instances.
Opta uses kubernetes under the hood, so we recommend using the standard
kubectl for most debugging use cases. This page will give you
a brief tutorial on how to use this tool.
On mac, you can install it via:
brew install kubectl
More detailed instructions are available on the offical site
Before you can use
kubectl, you need to connect it to your kubernetes cluster
(created by opta). This is pretty simple in the Opta world! Just run:
Kubernetes uses the word “pod” for containers[^1]. So every service will have one or more pods (as specified in your Opta yml).
You can see the pods for a given service by running:
kubectl get pods -n <service-name>
If this doesn’t show any pods, that means your service hasn’t been deployed. Check out the deployment docs to fix that.
<service-name> is specified in your Opta yml:
meta: name: blah # service-name modules: app: # module-name type: k8s-service
Opta supports a verbose debug state wherein the log level is set to debug, and the auto-generated terraform files and
directories are preserved after execution. This configuration serves for troubleshooting errors in deployment and
preserving the full terraform infrastructure as code for the archives or other reasons. To enable this state, simply
OPTA_DEBUG environment variables to some value like so: