Skip to content

Commit

Permalink
chore: added man page and v0.15 tutorial update
Browse files Browse the repository at this point in the history
  • Loading branch information
leon3s committed Jun 10, 2024
1 parent 8b0c53b commit b56e589
Show file tree
Hide file tree
Showing 99 changed files with 10,446 additions and 907 deletions.
2 changes: 1 addition & 1 deletion docs/guides/nanocl/advanced-usage/contexts.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ For your convenience, we created a `Statefile` that will generate the necessary
You can apply the following `Statefile` to generate the certificates and apply the `ProxyRule`:

<CodeBlock className="language-sh">
{`nanocl state apply -s nhnr.io/v${nanoclMajorVersion}/sys/enable-remote-nanocld.yml`}
{`nanocl state apply -fs nhnr.io/v${nanoclMajorVersion}/sys/enable-remote-nanocld.yml`}
</CodeBlock>

Once the `Statefile` applied, you can create the context to switch between the different daemons.
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/nanocl/advanced-usage/secret_tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ To do so we crafted a generic `Statefile` for you that can handle the job and cr
The secret will be named as follow: `cert.{domain_name}`.<br/>

<CodeBlock className="language-sh">
{`nanocl state apply -s nhnr.io/v${nanoclMajorVersion}/sys/certbot.yml -f -- --email [email protected] --domain deploy-example.com
{`nanocl state apply -fs nhnr.io/v${nanoclMajorVersion}/sys/certbot.yml -- --email [email protected] --domain deploy-example.com
`}
</CodeBlock>

Expand Down
68 changes: 1 addition & 67 deletions docs/guides/nanocl/advanced-usage/virtual-machine.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ Most Linux cloud images have it as a baseline, which allows us to set up network
## Install the default VM runtime

To facilitate networking, Nanocl starts a virtual machine inside a container using the default runtime image [nanocl-qemu][nanocl-qemu].<br/>
It is not installed by default, so you need to install it. You can easily do this by running the following command:

```sh
nanocl cargo image pull ghcr.io/next-hat/nanocl-qemu:8.0.2.0
```

## Create a VM base image

Expand Down Expand Up @@ -144,70 +140,8 @@ If you are not using Docker Desktop, you can connect to the virtual machine usin
nanocl vm inspect myvm
```

The command should output something like:

```yml
Key: myvm.global
Name: myvm
ConfigKey: e83fb53b-d645-44a6-9074-38625872fb14
NamespaceName: global
Config:
Key: e83fb53b-d645-44a6-9074-38625872fb14
CreatedAt: 2023-07-04T14:14:39.310696
Name: myvm
Version: v0.9.0
VmKey: myvm.global
Disk:
Image: ubuntu-22.myvm.global
Size: 20
HostConfig:
Cpu: 4
Memory: 2048
Kvm: true
InstanceTotal: 1
InstanceRunning: 1
Instances:
- Id: b082dcba19dfa7d177d12871e8702923dc2a95a80842001408a08c23766d012a
Names:
- /myvm.global.v
Image: ghcr.io/next-hat/nanocl-qemu:8.0.2.0
ImageID: sha256:119c0cf552aa9651fafc2fe6d7c4e13fa8cfdcd69e222506d935f4aa7a73d896
Command: /bin/sh entrypoint.sh -hda /home/leone/.nanocl/state/vms/images/ubuntu-22.myvm.global.img --nographic -accel kvm -smp 4 -m 2048M
Created: 1688480226
Ports: []
Labels:
io.nanocl.vnsp: global
io.nanocl: enabled
io.nanocl.v: myvm.global
org.opencontainers.image.source: https://github.com/next-hat/nanocl-qemu
org.opencontainers.image.description: Nanocl Qemu Runtime
State: running
Status: Up 28 seconds
HostConfig:
NetworkMode: global
NetworkSettings:
Networks:
global:
NetworkID: f2cd255919069b028aa8399582baa3e2d91ed9ca62186cb50184eb6b422b6bc4
EndpointID: ea733ed8cc6db1d8f0c594e15c41f1c6154779a37d280ae3b998bcea1405d9ed
Gateway: 10.2.0.1
IPAddress: 10.2.0.2
IPPrefixLen: 16
IPv6Gateway: ''
GlobalIPv6Address: ''
GlobalIPv6PrefixLen: 0
MacAddress: 02:42:0a:02:00:02
Mounts:
- Type: bind
Source: /home/leone/.nanocl/state/vms/images
Destination: /home/leone/.nanocl/state/vms/images
Mode: ''
RW: true
Propagation: rprivate
```
You can grab the `IPAddress`, which in this case is `10.2.0.2`.
Afterwards, you can connect using SSH with the default credentials:
Afterwards, you can connect using SSH with the default credentials: `cloud:cloud`.

```sh
ssh [email protected]
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/nanocl/advanced-usage/vpn.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Based on [hwdsl2/docker-ipsec-vpn-server](https://github.com/hwdsl2/docker-ipsec


<CodeBlock className="language-sh">
{`nanocl state apply -s nhnr.io/v${nanoclMajorVersion}/sys/vpn.yml`}
{`nanocl state apply -fs nhnr.io/v${nanoclMajorVersion}/sys/vpn.yml`}
</CodeBlock>

If you want to tweak it more than what is already possible from the `Statefile Args`, you can download it and customize it to fit your needs:
Expand All @@ -36,7 +36,7 @@ Here is the content of the VPN `Statefile`:
You can use it in the following way:

<CodeBlock className="language-sh">
{`nanocl state apply -s nhnr.io/v${nanoclMajorVersion}/sys/vpn.yml -- --namespace private --public-ip $(curl -s http://ipinfo.io/ip)`}
{`nanocl state apply -fs nhnr.io/v${nanoclMajorVersion}/sys/vpn.yml -- --namespace private --public-ip $(curl -s http://ipinfo.io/ip)`}
</CodeBlock>

From the file above, you can notice that we create a custom DNS for our VPN.<br/>
Expand Down
13 changes: 1 addition & 12 deletions docs/guides/nanocl/get-started/configure-your-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,10 @@ You can see existing resources with:
nanocl resource ls
```

Now we should add deploy-example.com to the hosts

```sh
sudo vim /etc/hosts
```

and add the following line:
```console
127.0.0.1 deploy-example.com
```

Now we can test that our proxy rule was working

```sh
curl deploy-example.com
curl --header "Host: deploy-example.com" 127.0.0.1
```

Should output:
Expand Down
Loading

0 comments on commit b56e589

Please sign in to comment.