Tinkerwell allows you to run your code inside a Kubernetes cluster, making it easy to test and debug applications directly in your containerized environment.
To use Kubernetes with Tinkerwell, click on the Runtime Settings icon in the toolbar and select Kubernetes.
You need a running Kubernetes cluster and kubectl
installed on your system. Tinkerwell will use your default Kubernetes configuration file located at ~/.kube/config
to connect to your cluster.
If no configuration file is found at the default location, you can add your own in the Advanced settings in the Runtime Settings. This file will be saved relative to your current working directory and will also be available the next time you open the settings. If you no longer need a custom configuration file for the project, you can remove the reference by selecting the file in the dropdown and clicking the delete button. The file itself will not be removed.
After validating the configuration file, Tinkerwell will read the available contexts and pods from your cluster and attempt to determine the correct working directory for the first pod automatically. As soon as you change the pod, the auto-detection for the working directory will run again.
Make sure to check the Use Kubernetes checkbox to ensure your code runs inside the selected Kubernetes environment.
If you first connect to a remote host via SSH, you can then select a Kubernetes cluster to run your code. In this case, Tinkerwell will look for the default configuration file in /home/forge/.kube/config
.
You can override this path per connection if your Kubernetes configuration is stored elsewhere. The process to connect to a pod and execute code remains the same as in the local section.