Skip to content

Commit

Permalink
feat: complete nocalhost server section (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinming Guo authored Apr 25, 2022
1 parent 29ffa26 commit 5cd655b
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 10 deletions.
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.
4 changes: 0 additions & 4 deletions docs/server/nh-dep.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +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.

## What's Next?

You have finished Nocalhost Server section. You can use Nocalhost to accelerate your team's development process. But we recommend you to read the [Best Prictices](https://nocalhost.dev/docs/practice/cloud/k8s-compatible) section before using Nocalhost.

0 comments on commit 5cd655b

Please sign in to comment.