Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OpenStack Provider Docs #58

Merged
merged 1 commit into from
Sep 5, 2024
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
14 changes: 11 additions & 3 deletions pkg/providers/openstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ Provides a driver for OpenStack based regions.
## Initial Setup

It is envisaged that an OpenStack cluster may be used for things other than the exclusive use of Unikorn, and as such it tries to respect this as much as possible.
We also operate under the principle of least privilege, so don't want to have a full admin credential alyng around.

In particular we want to allow different instances of Unikorn to cohabit to support, for example, staging environments.

You will need to install the [domain manager](https://docs.scs.community/standards/scs-0302-v1-domain-manager-role/) policy defined by SCS.
You will also need to edit this to allow the `_member_` role to be granted.
We need a number of policies installing to function correctly.
Follow the instructions in the [Unikorn OpenStack Policy repository](https://github.com/unikorn-cloud/python-unikorn-openstack-policy) to install them.

### OpenStack Platform Configuration

Expand All @@ -22,6 +24,7 @@ export PASSWORD=$(apg -n 1 -m 24)
```

#### Create the domain.

The use of project domains for projects deployed to provision Kubernetes cluster achieves a few aims.
First namespace isolation.
Second is a security consideration.
Expand All @@ -34,6 +37,7 @@ DOMAIN_ID=$(openstack domain create ${DOMAIN} -f json | jq -r .id)
```

#### Create the project.

As the OpenStack provider for the region controller also functions as a client in order to retrieve information such as available images, flavors, and so on it also needs to be associated with a project so that the default policy for various API requests is correctly satisfied:

```bash
Expand All @@ -47,15 +51,19 @@ USER_ID=$(openstack user create --domain ${DOMAIN_ID} --password ${PASSWORD} ${U
```

### Grant any roles to the user.

When a Kubernetes cluster is provisioned, it will be done using application credentials, so ensure any required application credentials as configured for the region are explicitly associated with the user here.

> [!NOTE]
> It may be necessary to add the `_member_` role on older OpenStack deployments where Neutron requires it to function.

```bash
for role in member load-balancer_member manager; do
openstack role add --user ${USER_ID} --domain ${DOMAIN_ID} ${role}
done
```

And also grant the `member` role on the project we created in a previous step:
Grant the `member` role on the project we created in a previous step:

```bash
openstack role add --user ${USER_ID} --project ${PROJECT_ID} member
Expand Down
Loading