DevSpace allows you to develop applications directly inside a Kubernetes cluster.
Nocalhost build-in a cluster inspector. You can use the cluster inspector to browse resources in the Kubernetes cluster, deploy your application and select the workload that wants to develop and debug.
Nocalhost uses the following icons to describe the status of different Kubernetes resources in cluster inspector.
|Cluster||Active||Connected to cluster|
|Inactive||Unable to connect to cluster|
|Read Only||This DevSpace/Namespace is readonly, can not operate|
|Application||Active||Application is able to operate|
|Inactive||Application is inactive, unable to operate|
|Loading||Installation or uninstallation|
|Development Mode||Start DevMode||The workload is in DevMode|
|End DevMode||End DevMode|
|Others||Others enabled DevMode|
|DevMode and Port-Forwarding||In DevMode and port-forwarding enabled|
|DevMode and Port-Forwarding, enabled by others||Others enable the workload into DevMode and port-forwarding|
|Nocalhost Configs||Normal||This workload has Nocalhost configurations|
|Warning||Nocalhost configurations is empty|
|Workload Status||Not Ready||This workload is not ready, e.g. deploying|
|Running||This workload is running|
|Failed||This workload has failed to run|
|Unknown||This workload status is unknown|
There are some configurations that you need to take care of before DevMode.
Before developing the application, you need to tell Nocalhost the location of your source code, so Nocalhost can synchronize files to the remote container. You can either specify a local directory or clone your source code from the Git repository through Nocalhost.
You can Associate Local Directory before entering DevMode. Alternatively, Nocalhost will check the directory path. If you do not have an associated directory, Nocalhost will pop the selection menu to ask you to `specify the source directory. You can Open Local Directory or Clone from Git Repo.
You can associate the local source code directory to a workload before entering DevMode. Once you associated this directory, Nocalhost will save this directory path in the database.
When you entering DevMode, Nocalhost will use this path directory without asking for input.
- Select the workload
- Right-click and select the
Associate Local DIR
- Choose the local directory and confirm the selection
If you have associated the directory in one IDE already, once you develop the same workload in the other IDE, Nocalhost will still use the directory path set before.
For example, when a workload is associated with a directory in VS Code, then switch to IDEA. Nocalhost will firstly use the directory you associated in VS Code until you associate again.
You can select any local directory and confirm the selection. Nocalhost will save the directory path in the database.
Nocalhost will not clone source code from Git if you have already associated or opened the directory.
Nocalhost can help you to clone the source code from the Git repository within the IDE.
If you choose
Clone from Git Repository, Nocalhost will try to clone the source code from URL according to the
dev.gitUrl section or ask you to input the Git URL.
Nocalhost will associate the directory to the clone directory automatically after codes are cloned.
Nocalhost will replace the workload containers when entering DevMode by development container. Nocalhost will loads the
container[*].dev section from the Nocalhost configuration.
Nocalhost needs to know which
development image to use before entering DevMode. Nocalhost will use
dev.image configuration or ask you to input the image name or URL.
You can use the docker image provide by us or use any custom image for
Container image will handle by Kubernetes, read more to learn about Kubernetes image management.
- Expand the cluster inspector
- Select the workload you want to develop and click
- Select the container if you have more than one container in this workload
If you have more than one container in a workload, you can only select one container to enter DevMode.
When entering DevMoe will do the following:
- Replace Pods according to your
- Forward ports according to your
- Sync file changes between your local project directory and the Kubernetes pods according to the
- Open a terminal right within IDE after the container started. The opened working directory is according to your
Once the terminal session starts, you start your application and work inside your container.
You can also use the remote run to run all the commands according to
Make sure you have done the following before developing:
- Start process inside the container or use the remote run to run your application.
- The port-forwarding you configured has successfully started or configure the port-forwarding in IDE
Nocalhost will monitor the local files change and synchronize the changes to the remote containers. You can check the synchronization status in IDE's status bar.
If the file synchronization has disconnected, the status will change to
Nocalhost sidecar disconnected. In this case, you can just click the status bar, Nocalhost will reconnect the file synchronization.
If you close the developing IDE window and want to reopen it again. Just right-click the workload which in DevMode and choose
Open Project only works in development mode.
When you finish developing, you can now end DevMode.
- VS Code: Click the icon
- JetBrains: Right click the workload that in DevMode and select
When ending DevMode, Nocalhost runs the following process:
- Stop file synchronization and port-forwarding (if any)
- Stop the DevContainer
- Delete the current versioned Pod
- reset pod - Recreating and start the original versioned Pod
Nocalhost can help you to roll back any Pod to its original version by
For example, reset the
productpage deployment, and you should see similar messages below:
Stopping port forwardAnnotation nocalhost.origin.spec.json found, use it Deleting current revision... Recreating original revision...Service productpage has been reset.
Nocalhost has a built-in manifest editor that allows you to edit and apply the Kubernetes manifest within IDE. After modification, Nocalhost can apply the new manifest directly.
You can not able to edit the manifest if the workload is in DevMode.