Skip to content

Commit 685f83b

Browse files
authored
Merge pull request #687 from MetaCell/doc/tutorial-update
Doc/tutorial update
2 parents 5e5052f + 9ab6910 commit 685f83b

2 files changed

Lines changed: 79 additions & 1 deletion

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
2+
### The first thing to check
3+
4+
> Make sure you have JDK installed in your WSL system. Without this, the code is not generated! (with harness-application command). A bunch of errors that I had was solved by this step. In addition, test if you have all the basic requirements needed for the Cloud-Harness + other requirements needed to set up.
5+
6+
Please check if you are running **Kubernetes with Docker Desktop.**
7+
8+
If you have Codecloud VS extension, make sure to check that you have docker-desktop ACTIVE. You can also check the namespace which by default is set to `default`
9+
10+
### Setting namespaces and with `docker-desktop` context
11+
12+
> The commands related to minikube from the tutorial are not needed in the case of docker-desktop.
13+
14+
We create namespaces inside docker-desktop… for our case of following the tutorial, it is azathoth
15+
16+
```
17+
kubectl create ns azathoth
18+
```
19+
20+
If want to change the namespace while keeping the context same (i.e. docker-desktop) then the following is the command. This is because the default namespace is `default`
21+
22+
```
23+
kubectl config set-context --current --namespace=azathoth
24+
```
25+
26+
### Deployment command distinction
27+
28+
Use the following command when you want your application installed inside the cloud-harness directory (very less likely; that one would use this)
29+
30+
```
31+
harness-deployment . -u -dtls -l -d azathoth.local -e local -n azathoth
32+
```
33+
34+
Otherwise (mostly how we use it)
35+
36+
```
37+
harness-deployment cloud-harness . -u -dtls -l -d azathoth.local -e local -n azathoth
38+
```
39+
40+
### About host file issue
41+
42+
To be able to visit links like - [http://clockdate.azathoth.local/](http://clockdate.azathoth.local/), or [http://clockdate.azathoth.local/api/ping](http://clockdate.azathoth.local/api/ping), we need to update the host file. Make note that the host file is of Windows (and not for the subsystem), which can be found here:
43+
44+
```
45+
C:\Windows\System32\drivers\etc\hosts
46+
```
47+
48+
(NOTE: We might be able to work with Linux hosts if we enable - *_Add the .docker.internal names to the host's etc/hosts file (Requires password)_ in the General settings of docker desktop. But I haven’t tested that. )
49+
50+
### If Running CLOUD HARNESS for the first time!
51+
52+
There are certain scripts that need to be run when running the CloudHarness and its dependent applications for the first time in a system. These are `sc.yaml` and `cluster-init.sh` which can be found in the following path w.r.t. cloud-harness.
53+
54+
```
55+
kubectl apply -f cloudharness/deployment/sc.yaml
56+
```
57+
58+
```
59+
cd cloud-harness/infrastructure/cluster-configuration && bash cluster-init.sh
60+
```
61+
62+
These are one-time setup scripts needed to be run.
63+
64+
### About Frontend issues
65+
66+
If the [clockdate.azathoth.local](http://clockdate.azathoth.local/) doesn’t return the frontend part!
67+
68+
When the frontend is generated through the “harness-application”, the package-lock.json is required which is not mentioned in the docs. Therefore one must have to do the `npm i —legacy-peer-deps` before proceeding with the “scaffold run” command.
69+
70+

docs/tutorials/simple-date-clock-application.adoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,15 @@ If everything is good, you're in the right path to use {ch}!
7171

7272
== How to setup your local cluster using minikube (if not done yet)
7373

74+
7475
{ch} is designed to help you generate all the required artifacts for a deployment on a Kubernetes cluster.
7576
For a local deployment, you can use minikube, which is basically https://minikube.sigs.k8s.io/docs/start/[a small {kub} cluster on your machine].
7677

78+
79+
[IMPORTANT - WSL2]
80+
If you're following this tutorial in a Windows WSL2 - then check => link:./cloud-harness-wsl2-setup.md[cloud-harness-wsl2-setup] for help!
81+
82+
7783
[IMPORTANT]
7884
The setup of a {kub} cluster is not mandatory to use {ch}.
7985
This step is proposed in this tutorial to show you how to deploy an application generated with {ch} on a local cluster and to appreciate how much {ch} reduces the pain of writing deployment configuration artifacts.
@@ -147,7 +153,7 @@ If you don't create the namespace, the deployment will fail!
147153
[source,bash]
148154
----
149155
# ran from the cloud-harness repository root
150-
harness-deployment . -u -dtls -l -d azathoth.local -e local -n azathoth.local
156+
harness-deployment . -u -dtls -l -d azathoth.local -e local -n azathoth
151157
----
152158

153159
In the state of the repository I have on my machine, the apps and services that will be deployed and that `harness-deployment` generated the configuration for are:
@@ -307,6 +313,8 @@ The file tree should now be the following.
307313

308314
Now you can build/deploy/run it using `skaffold`.
309315

316+
Before running `skaffold run` go inside the newly created application using harness-application; and make sure the frontend for the application contains package-lock.json. If not then install the dependencies by running `npm i --legacy-peer-deps`.
317+
310318
.Building/deploying/running the webapp with skaffold
311319
[source,bash]
312320
----

0 commit comments

Comments
 (0)