Skip to content

Commit

Permalink
Add Install document for Sandbox (#63)
Browse files Browse the repository at this point in the history
This change includes the steps required for installing Nephio components
and dependencies on a local Virtual Machine

Closes: nephio-project/nephio#350

/cc @johnbelamaric

---------

Signed-off-by: Victor Morales <v.morales@samsung.com>
  • Loading branch information
electrocucaracha authored Sep 12, 2023
1 parent 8473b3c commit 1acfd3b
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ apiextensions
apis
apiVersion
ArgoCD
args
ASNs
ausf
auth
Expand Down Expand Up @@ -65,6 +66,7 @@ capi
carte
cbd
ccd
cdd
cea
Cfg
cidr
Expand Down Expand Up @@ -95,7 +97,9 @@ configsync
configurationTemplateValues
containerd
containerlab
containerPath
containerregistry
coreDNS
cp
CPUS
cq
Expand All @@ -122,10 +126,12 @@ dabd
DataNetwork
datanetworknames
datanetworks
dataplane
dcd
dce
dcedc
dcfb
dd
ddd
dde
declaratively
Expand All @@ -138,17 +144,21 @@ dfd
Dnn
DnnList
DNS
downstreamTargets
dropdown
dv
dwmps
dXix
ead
eadd
ealenn
eb
eca
ecc
ecd
ece
edb
edcf
ee
eed
ef
Expand All @@ -163,11 +173,13 @@ EOL
esigohA
estration
etag
etcd
eth
ethernets
eurecom
eval
ExploreSandbox
extraMounts
fae
Fanout
fb
Expand All @@ -182,6 +194,7 @@ fcf
fdb
fdec
fdf
ffa
ffc
ffcd
ffd
Expand Down Expand Up @@ -235,6 +248,7 @@ hoc
HorizontalPodAutoscaling
hostIP
hostname
hostPath
Howto
hqq
href
Expand Down Expand Up @@ -284,6 +298,7 @@ krmapihost
krmapihosting
kube
kubeadm
kubeadmin
kubebuilder
kubebyexample
KubeCon
Expand All @@ -297,7 +312,9 @@ LdATSzf
LFN
LFNDeveloperEventTopicsFebruary
lfnetworking
Libvirt
lifecycle
linkThroughput
linuxfoundation
lml
loadbalancer
Expand All @@ -313,7 +330,9 @@ Makefile
ManagementCluster
masterInterface
matysiaq
maxDownlinkThroughput
MaxRetrans
maxUplinkThroughput
mdev
mEf
metallb
Expand Down Expand Up @@ -494,6 +513,7 @@ telecom
templated
tf
tfb
throughputs
tk
TLS
tmp
Expand All @@ -519,6 +539,7 @@ Undeploys
updateStrategy
upf
upfcfg
UPFDeployment
upfdeployments
upstreamlock
userid
Expand All @@ -528,6 +549,7 @@ Util
utils
Vagrantfile
VCPU
vCPUs
virtualbox
vlan
vlanindex
Expand Down
102 changes: 102 additions & 0 deletions install-guide/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,107 @@ In this guide, you will set up Nephio running in a single VM with:

## Provisioning Your Sandbox VM

In addition to the general prerequisites, you will need:

* Access to a Virtual Machine provided by an hypervisor ([VirtualBox](https://www.virtualbox.org/), [Libvirt](https://libvirt.org/)) and running an OS supported by Nephio (Ubuntu 20.04/22.04, Fedora 34) with a minimum of 8vCPUs and 8 GB in RAM.
* [Kubernetes IN Docker](https://kind.sigs.k8s.io/) (`kind`) installed and set up your workstation.

## Provisioning Your Management Cluster

The Cluster API services require communication with the Docker socket for creation of workload clusters. The command below creates an All-in-One Nephio management cluster through the KinD tool, mapping the `/var/run/docker.sock` socket file for Cluster API communication.

```bash
cat << EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: kindest/node:v1.27.1
extraMounts:
- hostPath: /var/run/docker.sock
containerPath: /var/run/docker.sock
EOF
```

## Gitea Installation

While you may use other Git providers as well, Gitea is required in the R1
setup. To install Gitea, use `kpt`. From your `nephio-install` directory, run:

Gitea package has services that use front-end and database services, these services require authentication information.
This information needs to be created as secret resources that belong to the `gitea` namespace.

```bash
kubectl create namespace gitea
kubectl create secret generic gitea-postgresql -n gitea \
--from-literal=postgres-password=secret \
--from-literal=password=secret
kubectl label secret -n gitea gitea-postgresql app.kubernetes.io/name=postgresql
kubectl label secret -n gitea gitea-postgresql app.kubernetes.io/instance=gitea
kubectl create secret generic git-user-secret -n gitea \
--type='kubernetes.io/basic-auth' \
--from-literal=username=nephio \
--from-literal=password=secret
```

Once those resources are created, you can proceed to install the gitea package.

```bash
kpt pkg get --for-deployment https://github.com/nephio-project/nephio-example-packages/gitea@v1.0.1
kpt fn render gitea
kpt live init gitea
kpt live apply gitea --reconcile-timeout 15m --output=table
```

## Common Dependencies

There are a few dependencies that are common across most installations, and do
not require any installation-specific setup. You should install these next, as
described in the [common dependencies documentation](common-dependencies.md).

## Common Components

With the necessary dependencies now installed, you can now install the essential
Nephio components. This is documented in the [common components
documentation](common-components.md).

## Provisioning Cluster API

For managing the Kubernetes cluster infrastructure, it is necessary to install [Cluster API project](https://cluster-api.sigs.k8s.io/). This package depends on [cert-manager project](https://cert-manager.io/) to generate certificates.

```bash
kpt pkg get --for-deployment https://github.com/nephio-project/nephio-example-packages/cert-manager@v1.0.1
kpt fn render cert-manager
kpt live init cert-manager
kpt live apply cert-manager --reconcile-timeout 15m --output=table
```

Once `cert-manager` is installed, you can proceed with the installation of Cluster API components

```bash
kpt pkg get --for-deployment https://github.com/nephio-project/nephio-example-packages/cluster-capi@v1.0.1
kpt fn render cluster-capi
kpt live init cluster-capi
kpt live apply cluster-capi --reconcile-timeout 15m --output=table
```

Cluster API uses infrastructure providers to provision cloud resources required by the clusters. You can manage local
resources with the Docker provider, it can be installed with the followed package.

```bash
kpt pkg get --for-deployment https://github.com/nephio-project/nephio-example-packages/cluster-capi-infrastructure-docker@v1.0.1
kpt fn render cluster-capi-infrastructure-docker
kpt live init cluster-capi-infrastructure-docker
kpt live apply cluster-capi-infrastructure-docker --reconcile-timeout 15m --output=table
```

The last step is required for defining cluster, machine and kubeadmin templates for controller and worker docker machines.
These templates define the kubelet args, etcd and coreDNS configuration and image repository as other things.


```bash
kpt pkg get --for-deployment https://github.com/nephio-project/nephio-example-packages/cluster-capi-kind-docker-templates@v1.0.1
kpt fn render cluster-capi-kind-docker-templates
kpt live init cluster-capi-kind-docker-templates
kpt live apply cluster-capi-kind-docker-templates --reconcile-timeout 15m --output=table
```
4 changes: 2 additions & 2 deletions user-guide/exercises.md
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ After the package is approved, the results can be observed in Nephio Web UI. Hea

![Throughput values](UPF-Capacity-4.png)

Inside the package, you can see that the throughput values for UPF have been modifed, reflecting the changes you made with the CLI.
Inside the package, you can see that the throughput values for UPF have been modified, reflecting the changes you made with the CLI.

You can also scale NFs vertically using the Nephio Web UI. For practice you can scale the UPF on the second edge cluster. Once again, navigate to the Web UI and choose the `edge02` repository in the Deployments section.

Expand All @@ -1067,4 +1067,4 @@ After saving the changes to the file, propose the draft package and approve it.

![New revision](UPF-Capacity-12.png)

After a few minutes, the revision for the UPF deployment will change, and the changes will be reflected in the `edge-02` cluster.
After a few minutes, the revision for the UPF deployment will change, and the changes will be reflected in the `edge-02` cluster.

0 comments on commit 1acfd3b

Please sign in to comment.