https://github.com/kvaps/linstor-scheduler-extender
LINSTOR scheduler extender plugin for Kubernetes
https://github.com/kvaps/linstor-scheduler-extender
Last synced: 9 months ago
JSON representation
LINSTOR scheduler extender plugin for Kubernetes
- Host: GitHub
- URL: https://github.com/kvaps/linstor-scheduler-extender
- Owner: kvaps
- License: apache-2.0
- Created: 2022-02-14T12:50:24.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-12T10:30:33.000Z (about 4 years ago)
- Last Synced: 2024-12-28T02:30:14.157Z (over 1 year ago)
- Language: Go
- Size: 104 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# linstor-scheduler-extender

LINSTOR scheduler extender plugin for Kubernetes which allows a storage driver to give the Kubernetes scheduler hints about where to place a new pod so that it is optimally located for storage performance.
## Get started
If you want to get started directly with an existing LINSTOR setup, check out the [single file deployment](./deploy/all.yaml)
The deployment will create:
* All needed RBAC resources
* A Deployment spawning 2 replicas of the Kube-scheduler with linstor-scheduler-existing, configured to connect to `http://piraeus-op-cs.default.svc`
Copy the file, make any desired changes (see the [options](#options) below) and apply:
```console
$ kubectl apply -f deploy/all.yaml
configmap/linstor-scheduler created
deployment.apps/linstor-scheduler created
serviceaccount/linstor-scheduler created
clusterrole.rbac.authorization.k8s.io/linstor-scheduler created
role.rbac.authorization.k8s.io/linstor-scheduler created
clusterrolebinding.rbac.authorization.k8s.io/linstor-scheduler created
rolebinding.rbac.authorization.k8s.io/linstor-scheduler created
$ kubectl -n kube-system get pods -l app.kubernetes.io/name=linstor-scheduler
NAME READY STATUS RESTARTS AGE
linstor-scheduler-6bb88fc66c-bq4fm 2/2 Running 0 52s
linstor-scheduler-6bb88fc66c-tllgm 2/2 Running 0 52s
```
## Usage
To make your applications using linstor-scheduler, use the `schedulerName: linstor` field.
For example, Pod Templates in a StatefulSet should look like:
```yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: my-stateful-app
spec:
serviceName: my-stateful-app
selector:
matchLabels:
app.kubernetes.io/name: my-stateful-app
template:
metadata:
labels:
app.kubernetes.io/name: my-stateful-app
spec:
schedulerName: linstor
...
```
## Configuration
`linstor-scheduler-extender` uses the environment variables specified in the [`golinstor` library](https://pkg.go.dev/github.com/LINBIT/golinstor/client#NewClient)
for configuration.
| Variable | Description |
|-----------------------|---------------------------------------------------------------------|
| `LS_CONTROLLERS` | A comma-separated list of LINSTOR controller URLs to connect to. |
| `LS_USERNAME` | Username to use for HTTP basic auth. |
| `LS_PASSWORD` | Password to use for HTTP basic auth. |
| `LS_ROOT_CA` | CA certificate to use for authenticating the server. |
| `LS_USER_KEY` | TLS key to use for authenticating the client to the server. |
| `LS_USER_CERTIFICATE` | TLS certificate to use for authenticating the client to the server. |
The linstor-scheduler-extender itself can be configured using the following flags:
```
--verbose Enable verbose logging
```