Skip to content
Open

Dev #174

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/guides/debug/remote-debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
<td rowSpan="2">Node.js</td>
<td>IntelliJ IDEA</td>
<td>Ultimate</td>
<td>Node.js plugin</td>
<td>N/A</td>
</tr>
<tr>
<td>WebStrom</td>
Expand Down Expand Up @@ -234,7 +234,7 @@ containers:
debug:
- ./debug.sh
debug:
remoteDebugPort: 9009
remoteDebugPort: 9003
...
```

Expand Down
30 changes: 28 additions & 2 deletions docs/guides/deploy/deploy-demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import useBaseUrl from '@docusaurus/useBaseUrl';

# Deploy Demo Application

Nocalhost IDE plugin has built-in demo application, you can quickly install it through the following steps:
Nocalhost IDE plugin has a built-in demo application called bookinfo. You can quickly install it through the following steps:

1. Select any namespace from the cluster tree
2. Click on the <img src={useBaseUrl('/img/icons/install-app-icon.jpg')} width="20" /> icon to deploy application
3. Select `Install Quick Demo` to install the demo application
3. Select `Deploy Demo` to install the demo application

<figure className="img-frame">
<img className="gif-img" src={useBaseUrl('/img/opt/deploy-demo.gif')} />
Expand All @@ -19,3 +19,29 @@ Quick demo application comes with port-forward configured. After demo has succes

:::

## Introduction to the bookinfo application

Bookinfo is a typical microservice architecture application, which derives from Istio samples(https://github.com/istio/istio/tree/master/samples/bookinfo). However, we commit some changes to demonstrate nocalhost better. Here are some main changes we have made:

- Simplifying different version of reviews service to one version. Nocalhost does not target on how to manage service traffic or canary deployment.
- Splitting source codes from mono-repo into five independent repositories. In fact, diffrent microservices are developed by diffrent teams with different access rules.
- Switching the framework of reviews service to spring-boot. Everyone loves spring-boot.
- Configuring GitHub Action for every microservice to automatically build Docker images.
- Adding a .nocalhost directory to support development with nocalhost.

This demo application consists of the following 5 services:

- productpage(Request Entrance): https://github.com/nocalhost/bookinfo-productpage
- reviews: https://github.com/nocalhost/bookinfo-reviews
- details: https://github.com/nocalhost/bookinfo-details
- ratings: https://github.com/nocalhost/bookinfo-ratings
- authors: https://github.com/nocalhost/bookinfo-authors

Every service has its own program language and runtime environment. All of them have been configured to use docker as the container runtime, you can find Dockerfile in their corresponding repositories.

The microservices' structure of bookinfo is shown by the following image:

<figure className="img-frame">
<img className="gif-img" src={useBaseUrl('/img/intro/structure-of-bookinfo.png')} />
<figcaption>Microservices' structure of bookinfo</figcaption>
</figure>
2 changes: 2 additions & 0 deletions docs/guides/hot-reload.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,6 @@ containers:

```

## What's Next?

Now you have understood what DevMode is and how it works. Nocalhost supports a lot of configurations that control the actions when Nocalhost enter DevMode. If you are interested in Nocalhost configurations, you can check [CONFIGURATION](https://nocalhost.dev/docs/config/config-en).
2 changes: 1 addition & 1 deletion docs/guides/remote-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ When you start the new container in Kubernetes cluster, Kubernetes will not star
<td rowSpan="2">Node.js</td>
<td>IntelliJ IDEA</td>
<td>Ultimate</td>
<td>Node.js plugin</td>
<td>N/A</td>
</tr>
<tr>
<td>WebStrom</td>
Expand Down
14 changes: 9 additions & 5 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';

:::tip JetBrains Plugin

Nocalhost does fully supports JetBrains, please refer to [Install JetBrains Plugin](./installation##install-jetbrains-plugin).
Nocalhost does fully support JetBrains, please refer to [Install JetBrains Plugin](./installation##install-jetbrains-plugin).

:::

Expand Down Expand Up @@ -100,9 +100,9 @@ We are using the bookinfo application as an example here. You can use your own a

Make sure you have successfully deployed workloads within your Kubernetes Cluster, then:

1. Expand the workloads tree, find the workload you want to develop
1. Expand the workloads tree, find the productpage workload to begin our development
2. Click <img className="svg-icon" src={useBaseUrl('/img/icons/dev_start.svg')} width="18" /> to start the `Development Mode (DevMode)`
3. Specify the source code local directory or you can clone from existing Git repository.
3. Clone source code from a Git repository (or you can associate with a local derectory).
4. Nocalhost will open a new VS Code window, and start the `DevMode` automatically.

<figure className="img-frame">
Expand All @@ -126,7 +126,7 @@ When entering DevMode, the application main process will not automatically start

:::

**2.** View the running result on [http://127.0.0.1:39080](http://127.0.0.1:39080) in your web browser
**2.** View the running result on [http://127.0.0.1:39080/productpage](http://127.0.0.1:39080/productpage) in your web browser

<figure className="img-frame">
<img className="gif-img" src={useBaseUrl('/img/opt/main-process.gif')} />
Expand All @@ -141,7 +141,7 @@ In our `bookinfo` demo, we've already set the port-forward to 39080:9080, which

### Change the code

**1.** Modify code in `productpage.py` and see change in web browser. **Do not** forget to save your change.
**1.** Modify code in `productpage.py` and see change in web browser. Find the `getProducts` function in line 379 and change the `'title'` of the return value from `'The Comedy of Errors'` to `'Hello Nocalhost'`. **Do not** forget to save your change.

**2.** Refresh the web browser and see the code change

Expand All @@ -154,6 +154,10 @@ In our `bookinfo` demo, we've already set the port-forward to 39080:9080, which

## What's Next?

Now you are ready to develop with Nocalhost. But if you still want more details about Nocalhost, you can consult [USER GUIDES](https://nocalhost.dev/docs/guides/manage-cluster), or if you are a team leader, then you can try [Nocalhost Server](https://nocalhost.dev/docs/server/server-overview) and understand how Nocalhost can improve your team's efficiency.

You can also:

- Refer to Nocalhost's [Introduction](./introduction)
- Visit our [Github Repo](https://github.com/nocalhost/nocalhost)
- Join our [Slack](https://nocalhost.slack.com/) or scan the code to join our WeChat Group
Expand Down
52 changes: 51 additions & 1 deletion docs/server/manage-app.md
Original file line number Diff line number Diff line change
@@ -1 +1,51 @@
# Manage Applications
---
title: Manage Applications
---

Nocalhost can help us manage the apps in our DevSpace. Give the URL of your Git repository, Manifest files and config files etc. Then Members of your team could deploy that particular app conveniently.

Take our bookinfo app as an example. We will demonstrate how to manage apps in Nocalhost. Select the `Application` tab in the sidebar and click the `Add Application` button.

![image.png](/img/server-ks/nh-app-create.png)

Set `Application Name` to 'bookinfo' and continue to fill other information about it:

- Select `Git` as `Kubernetes Manifest Source Type`.
- Iput `https://github.com/nocalhost/bookinfo.git` in the `Git Repo Url` box.
- Select `Manifest type` as `Manifest`.
- Leave `location config file` blank. Nocalhost will use `config.yaml` by default.
- `dirs of manifests` should be `manifest/templates`

![image.png](/img/server-ks/nh-app-config.png)

:::tip
You can view the details of configurations by visiting the Github repository of [bookinfo](https://github.com/nocalhost/bookinfo/)
:::

### Deploy bookinfo app

Open the control panel of Nocalhost plug-in of VS code. Click `Connect to Nocalhost Server` button. If you have followed our previous tutorial, the address of Nocalhost should be `http://localhost:8080`, and use the account we created before. It's e-mail address is `[email protected]` and password is `123456`. Fill all these items and click `Sign In` button.

![image.png](/img/server-ks/vsc-nocalhost-server-add.png)

You will see the `demo(nh1btih)` isolated DevSpace that we created before.

![image.png](/img/server-ks/vsc-nocalhost-server-list.png)

Click the rocket icon of `demo` DevSpace and you will see the `bookinfo` app in the app list that loaded on the top area of VS code. That app is the one we added in the previous steps.

![image.png](/img/server-ks/vsc-nocalhost-app-deploy.png)

Select that app. The deployment process will be started automatically by Nocalhost(Just use the default branch). After the deployment process you will see the following logs and pop-up notification.

![image.png](/img/server-ks/vsc-nocalhost-app-deployed.png)

You can also expand the `Workload` in Nocalhost control panel to see the details of bookinfo app.

![image.png](/img/server-ks/vsc-nocalhost-workload.png)

Then you can develop this bookinfo app like the conventional way of Nocalhost [Enter Development Mode](https://nocalhost.dev/docs/quick-start/#3-enter-development-mode). Enjoy the convenience of Nocalhost!

## What's Next?

You have finished Nocalhost Server section. You can use Nocalhost to accelerate your team's development process. We recommend you to read the [User Guides](https://nocalhost.dev/docs/guides/manage-cluster/) before take Nocalhost Server into use.
24 changes: 23 additions & 1 deletion docs/server/manage-cluster.md
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
# Manage Cluster
---
title: Manage Cluster
---

Nocalhost Server is mainly used for managing the dev environment of a team. We need to add a cluster for our team firstly.

Select the `Cluster` sidebar and click the `Add Cluster` button.

![image.png](/img/server-ks/nh-cluster-create.png)

Input your cluster's `Name` and KubeConfig file that has the **cluster-admin** privilege. Then click the Confirm button.

![image.png](/img/server-ks/nh-cluster-kubeconfig.png)

:::tip Get KubeConfig

You can use the following command to view your `KubeConfig`, copy and paste to the Nocalhost plugin.

```bash
kubectl config view --minify --raw --flattern
```

:::
33 changes: 30 additions & 3 deletions docs/server/manage-devspace-iso.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
---
title: Isolated DevSpace
---
---
title: Isolated DevSpace
---

DevSpace is a concept in Nocalhost, which represents a pre-allocated cloud develop space. A DevSpace has a certain amount of computing resources, in which developers could deploy, uninstall, develop and debug apps.

A DevSpace is corresponding to a Kubernetes namespace. Isolated DevSpace means every DevSpace is isolated from other ones. So apps in one DevSpace could only see the resources in that particular DevSpace.

## Create Isolated DevSpace

Select the DevSpace sidebar. Click `Create DevSpace` button. Select `Create DevSpace` in the pop-up dialog box.

![image.png](/img/server-ks/nh-devspace-create.png)
![image.png](/img/server-ks/nh-devspace-create-isolated.png)

Fill your DevSpace's information in the next dialog box. Set `Space Name` to `demo`. Select the aimed Cluster and Owner. You can also change other settings like limiting the resources of the DevSpace.

![image.png](/img/server-ks/nh-devspace-config.png)

After created, you will find your DevSpace in the same page.

![image.png](/img/server-ks/nh-devspace-list.png)

Now we have created a DevSpace. We can deploy our app in it and begin to develop. However, there is only one user in this DevSpace. Usually we want more than one developer to work in a single DevSpace. So we need to share this DevSpace with other users. Select the demo DevSpace we just created. Click the edit icon in the right side to enter `Edit DevSpace` page. Select the `Shared user` tag and click `Add Share` button to continue.

![image.png](/img/server-ks/nh-devspace-share.png)

Select the `test` user account we just created and set the user's privilege as `Cooperator`. If the privilege is `Viewer`, the user wouldn't be available to change the status of the DevSpace.

![image.png](/img/server-ks/nh-devspace-share-coop.png)
16 changes: 15 additions & 1 deletion docs/server/manage-user.md
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# Manage User
---
title: Manage User
---

The user in Nocalhost is different from that in Kubernetes. The Nocalhost user is designed for managing their access of resources in Nocalhost Server.

Nocalhost will create an admin account automatically, which we used to sign in previously. We should also create accounts for other members of our team.

Select the `User` tab in the sidebar and click the `Add User` button. Input the name, email and password and makesure that the `Whether to activate the use status` is enabled.

Create a user to continue. Set it's e-mail to `[email protected]` and use the password `123456`. Click the confirm button.

![image.png](/img/server-ks/nh-user-create.png)

Once the user account is created. You will see it's information in the `User` page. You can also change profile of users.
1 change: 0 additions & 1 deletion docs/server/nh-dep.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
Service dependencies can be defined through `services[*].dependLabelSelector` in the Nocalhost configuration.

**`Nocalhost Dep`** will inject an `initContainer` into the container when deploying an application. The `initContainer` will ensure that the services it depends on run successfully and then create the related container.

28 changes: 28 additions & 0 deletions docs/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Try Nocalhost
- [What's Nocalhost](https://nocalhost.dev/docs/introduction)
- [Install Nocalhost](https://nocalhost.dev/docs/installation)
- [Quick Start](https://nocalhost.dev/docs/quick-start)

## Develop with Nocalhost
- [Manage cluster](https://nocalhost.dev/docs/guides/manage-cluster)
- [Deploy demo application](https://nocalhost.dev/docs/guides/deploy/deploy-demo)
- [Enter DevMode(Replace)](https://nocalhost.dev/docs/guides/develop-service-replace-en)
- [Remote debug](https://nocalhost.dev/docs/guides/debug/vscode-debug)
- [Connect remote terminal](https://nocalhost.dev/docs/guides/debug/access-terminal)
- [View logs](https://nocalhost.dev/docs/guides/debug/log-viewer)

## Nocalhost Configuration
- [Introduction of Nocalhost configuration](https://nocalhost.dev/docs/config/config-overview-en)
- [How to configure Nocalhost](https://nocalhost.dev/docs/config/configure-en)
- [Dev configuration of Nocalhost](https://nocalhost.dev/docs/config/config-spec-en)
- [Deployment configuration of Nocalhost](https://nocalhost.dev/docs/config/config-deployment-en)

## Nocalhost Server
- [Introduction of Nocalhost Server](https://nocalhost.dev/docs/server/server-overview)
- [Use Nocalhost Server](https://nocalhost.dev/docs/server/deploy-server)
- [Upgrade repository](https://nocalhost.dev/docs/server/upgrade)
- [Manage user](https://nocalhost.dev/docs/server/manage-user)
- [Manage cluster](https://nocalhost.dev/docs/server/manage-cluster)
- [Isolated devspace](https://nocalhost.dev/docs/server/manage-devspace-iso)
- [Mesh devspace](https://nocalhost.dev/docs/server/manage-devspace-mesh)
- [Use Nocalhost Server in Kubesphere](https://nocalhost.dev/docs/server/deploy-in-kubesphere-en)
Loading