Skip to content
Merged
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
156 changes: 156 additions & 0 deletions install-guide/openstack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# OpenStack Multi-Cluster Deployment Management with Nephio


## Prerequisites

* Openstack Cluster Managment (master)
* 4 VCPU 4 NODES
* 8GB RAM
* Kubernetes version 1.24+
* Openstack Cluster Edge n
* 2 VCPU 1 NODE
* 4GB RAM
* Kubernetes version 1.24+
* KPT beta [realeses](https://github.com/kptdev/kpt/releases)

## Automatic Installation of the managment cluster
* Change ansible variables to reflect your cluster and run the installation script

1. Add the following to *test-infra\e2e\provision\playbooks\roles\bootstrap\tasks\prep-gitea.yml*
```- name: Create PersistentVolume
kubernetes.core.k8s:
context: "{{ k8s.context }}"
state: present
definition:
apiVersion: v1
kind: PersistentVolume
metadata:
name: data-gitea-postgresql-0
spec:
capacity:
storage: 10Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
storageClassName: standard
hostPath:
path: /tmp/
namespace: "{{ gitea.k8s.namespace }}"

- name: Create PersistentVolumeClaim
kubernetes.core.k8s:
context: "{{ k8s.context }}"
state: present
definition:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data-gitea-postgresql-0
spec:
storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
namespace: "{{ gitea.k8s.namespace }}"

- name: Create PersistentVolume
kubernetes.core.k8s:
context: "{{ k8s.context }}"
state: present
definition:
apiVersion: v1
kind: PersistentVolume
metadata:
name: data-gitea-0
spec:
capacity:
storage: 10Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
storageClassName: standard
hostPath:
path: /tmp/
namespace: "{{ gitea.k8s.namespace }}"

- name: Create PersistentVolumeClaim
kubernetes.core.k8s:
context: "{{ k8s.context }}"
state: present
definition:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data-gitea-0
spec:
storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
namespace: "{{ gitea.k8s.namespace }}"
```
Comment on lines +20 to +95
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe those resources can add to the gitea package to simplify the process

2. Change context value from all the *test-infra\e2e\provision\playbooks* yaml files into your kubernetes context: `kubectl config get-contexts`

context: kubernetes-admin@cluster.local
Comment on lines +96 to +98
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change needs to be done in the test-infra project, there are some places using k8s.context var like this one but there are others using hardcode like here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I manually changed all of them. I know this is not ideal, but I wanted to see if the ansible script would also work in a different environment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll submit the PR for that and expose the value in a variable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lapentad I have created a PR to simplify this process, once it's available you could override some default values with

ANSIBLE_CMD_EXTRA_VAR_LIST="k8s.context=kubernetes-admin@cluster.local,kind.enabled=false" ./install_sandbox.sh


3. Disable kind installation in
*test-infra\e2e\provision\playbooks\roles\bootstrap\defaults\main.yml*

kind:
enabled: false


4. Override the check specitifaction values and run the installation script in
*test-infra\e2e\provision\install_sandbox.sh* by
```
NEPHIO_HOST_MIN_VCPU=4 NEPHIO_HOST_MIN_CPU_RAM=8 ./install_sandbox.sh
```

## Manual Installation of the managment cluster using kpt
TDB (manual install of kpt, porch, configsync, nephio-webui, capi, metallb)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally the management cluster should be installed with the Install Ansible role


## Manual Installation of the Edge cluster using kpt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that edge clusters should be provisioned by Cluster API, which means that we need to create a new package on the existing catalog like this one or something new here

Copy link
Contributor Author

@lapentad lapentad Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Victor, I wanted to address the use case where the user doesn't have access to the provisioning process. For instance, I do not have access to the OpenStack cluster provisioning cli within my organization. I can, though, request a cluster using an internal process.

Copy link
Member

@electrocucaracha electrocucaracha Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, maybe we need to specify that as requirement on the prerequesites section or in this document.

/cc @johnbelamaric


```
kpt pkg get https://github.com/nephio-project/nephio-packages.git/nephio-configsync@v1.0.1
```

Change *nephio-configsync/rootsync.yaml* and point spec.git.repo to the edge git repository
```
spec:
sourceFormat: unstructured
git:
repo: <http url of your edge repo>
branch: main
auth: none
```
Deploy the modified configsync
```
kpt live init nephio-configsync
kpt live apply nephio-configsync --reconcile-timeout=5m
```

## Configure Managment Cluster to manage Edge Cluster
Get a [github token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#fine-grained-personal-access-tokens) if your repository is private, or allow Porch to make modifications.

Register the edge repository using kpt cli or nephio web-ui.
```
GITHUB_USERNAME=<Github Username>
GITHUB_TOKEN=<GitHub Token>

kpt alpha repo register \
--namespace default \
--repo-basic-username=${GITHUB_USERNAME} \
--repo-basic-password=${GITHUB_TOKEN} \
--create-branch=true \
--deployment=true \
<http url of your edge repo>
```

## Deploy packages to the edge clusters
Using the web-ui add a new deployment with destination the edge cluster.