Skip to content

Commit

Permalink
Add cosi driver helm chart and update README (#71)
Browse files Browse the repository at this point in the history
Description: add helm chart for cosi-driver-nutanix and also updates the README where the steps to install COSI related CRDs and controllers are specified
Reviewers: @tuxtof @wolfganghuse
  • Loading branch information
Ab-hishek authored Jul 24, 2023
1 parent 2079d03 commit 26de957
Show file tree
Hide file tree
Showing 12 changed files with 910 additions and 584 deletions.
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,21 @@ Nutanix COSI Driver provides reference implementation for Container Object Stora
```sh
$ git clone github.com/kubernetes-sigs/container-object-storage-interface-api
$ cd container-object-storage-interface-api
$ git checkout 76de08ed3df15100c39e296dc9201563eb32e946
$ git checkout 2504944fc33162a34a8a95d6f935cf35c4d08762
$ kubectl create -k .
```
## Install COSI controller
```sh
$ git clone github.com/kubernetes-sigs/container-object-storage-interface-controller
$ cd container-object-storage-interface-controller
$ git checkout eafd6faf360a78f6723d6dd4ced9249499d6b947
$ git checkout 5240fb3aceded346058bdae116e39fabac8897aa
$ kubectl create -k .
```
## Install Node adapter
```sh
$ kubectl create -k github.com/kubernetes-sigs/container-object-storage-interface-csi-adapter
```

Following pods will execute in the default namespace :
```sh
NAME READY STATUS RESTARTS AGE
objectstorage-controller-6fc5f89444-4ws72 1/1 Running 0 2d6h
objectstorage-csi-adapter-wsl4l 3/3 Running 0 2d6h
```

## Building, Installing, Setting Up
Expand Down Expand Up @@ -73,15 +68,16 @@ $ kubectl get bucketaccess
NAME AGE
sample-bucketaccess 5s
```
A new Nutanix Object Store user (userName corresponding to BucketAccess) is created using PC credentials (`secret.yaml`) and the newly created bucket is shared with this new user
A new Nutanix Object Store user (userName of the format <account-name>_ba-<bucketaccess-UUID>) is created using PC credentials (`secret.yaml`) and the newly created bucket is shared with this new user

```sh
$ kubectl get bucketaccess
NAME AGE
39233394-4e37-4842-bbdd-c97edc7e9483 71s
```
## Consuming the bucket in an app
In the app, `bucketaccess` can be consumed as a volume mount. A secret is created with the name provided in the bucketaccess spec field `credentialsSecretName` which can be mounted onto to the pod:
```sh
$ kubectl get secret
NAME TYPE DATA AGE
bucketcreds Opaque 1 24h
```

```yaml
spec:
containers:
Expand Down Expand Up @@ -144,4 +140,4 @@ New pod comes up which will be having the updated config
$ kubectl -n ntnx-system get pods
NAME READY STATUS RESTARTS AGE
objectstorage-provisioner-5f3we89tt2-tfy357 2/2 Running 0 2s
```
```
23 changes: 23 additions & 0 deletions charts/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
15 changes: 15 additions & 0 deletions charts/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v2
name: cosi-driver-nutanix
description: A Helm chart to deploy Nutanix COSI driver
type: application
version: 0.1.0

appVersion: "v0.0.2"

icon: https://www.nutanix.com/content/dam/nutanix/global/icons/products/svg/Nutanix-Objects-40.svg
annotations:
artifacthub.io/license: Apache-2.0

maintainers:
- name: nutanix-cloud-native-bot
email: cloudnative@nutanix.com
88 changes: 88 additions & 0 deletions charts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Nutanix COSI driver for provisioning and consuming Nutanix object storage in Kubernetes
Nutanix cosi driver is Nutanix specific component that receives requests from the COSI sidecar and calls the appropriate APIs to create buckets, manage their lifecycle and manage access to them.

COSI driver supports these operations:
1. Creation/Deletion of buckets
2. Granting/Revoking bucket access to individual users

## Pre-requisites
1. [Install](https://helm.sh/docs/intro/install/) Helm v3.0.0.
2. [Install](https://kubernetes.io/docs/setup/) a Kubernetes cluster.

## Installation and Running on the cluster
Deploy the cosi-driver on the cluster:

Clone this repo, get into the charts directory and run the below command:
```sh
helm install cosi-driver -n cosi-driver-nutanix --create-namespace .
```

## Uninstalling the Chart
To uninstall/delete the cosi-driver-nutanix chart:
```console
helm uninstall cosi-driver -n cosi-driver-nutanix
```
**NOTE**: The CRDs installed via helm will not be deleted from the above command. Those have to manually deleted.

## Configuration

The following table lists the configurable parameters of the cosi-driver-nutanix chart and their default values.

| Parameter | Description | Default |
|----------------------------------------------------|--------------------------------------------------------------------|------------------------------------------------------------------------------|
| `nameOverride` | To override the name of the cosi-driver chart | `""` |
| `fullnameOverride` | To override the full name of the cosi-driver chart | `""` |
| `image.registry` | Image registry for cosi-driver-nutanix sidecar | `ghcr.io/` |
| `image.repository` | Image repository for cosi-driver-nutanix sidecar | `nutanix-cloud-native/cosi-driver-nutanix` |
| `image.tag` | Image tag for cosi-driver-nutanix sidecar | `""` |
| `image.pullPolicy` | Image registry for cosi-driver-nutanix sidecar | `IfNotPresent` |
| `secret.endpoint` | Nutanix Object Store instance endpoint | `""` |
| `secret.access_key` | Admin IAM Access key to be used for Nutanix Objects | `""` |
| `secret.secret_key` | Admin IAM Secret key to be used for Nutanix Objects | `""` |
| `secret.pc_secret` | PC Credentials in format <prism-ip>:<prism-port>:<user>:<password> | `""` |
| `secret.account_name` | Account Name is a displayName identifier Prefix for Nutanix | `"ntnx-cosi-iam-user"` |
| `cosiController.logLevel` | Verbosity of logs for COSI central controller deployment | `5` |
| `cosiController.image.registery` | Image registry for COSI central controller deployment | `gcr.io/` |
| `cosiController.image.repository` | Image repository for COSI central controller deployment | `k8s-staging-sig-storage/objectstorage-controller` |
| `cosiController.image.tag` | Image tag for COSI central controller deployment | `v20221027-v0.1.1-8-g300019f` |
| `cosiController.image.pullPolicy` | Image pull policy for COSI central controller deployment | `Always` |
| `objectstorageProvisionerSidecar.logLevel` | Verbosity of logs for COSI sidecar | `5` |
| `objectstorageProvisionerSidecar.image.registery` | Image registry for COSI sidecar | `gcr.io/` |
| `objectstorageProvisionerSidecar.image.repository` | Image repository for COSI sidecar | `k8s-staging-sig-storage/objectstorage-sidecar/objectstorage-sidecar@sha256` |
| `objectstorageProvisionerSidecar.image.tag` | Image tag for COSI sidecar | `589c0ad4ef5d0855fe487440e634d01315bc3d883f91c44cb72577ea6e12c890` |
| `objectstorageProvisionerSidecar.image.pullPolicy` | Image pull policy for COSI sidecar | `Always` |


### Configuration examples:

Install the driver in the `cosi-driver-nutanix` namespace (add the `--create-namespace` flag if the namespace does not exist):

```console
helm install cosi-driver -n cosi-driver-nutanix
```

Individual configurations can be set by using `--set key=value[,key=value]` like:
```console
helm install cosi-driver -n cosi-driver-nutanix . --set cosiController.logLevel=2
```
In the above command `cosiController.logLevel` refers to one of the variables defined in the values.yaml file.

All the options can also be specified in a value.yaml file:

```console
helm install cosi-driver -n cosi-driver-nutanix -f value.yaml .
```
---

## Support
### Community Plus

This code is developed in the open with input from the community through issues and PRs. A Nutanix engineering team serves as the maintainer. Documentation is available in the project repository.

Issues and enhancement requests can be submitted in the [Issues tab of this repository](https://github.com/nutanix-cloud-native/cosi-driver-nutanix/issues). Please search for and review the existing open issues before submitting a new issue.

## License

Copyright 2021-2022 Nutanix, Inc.

The project is released under version 2.0 of the [Apache license](http://www.apache.org/licenses/LICENSE-2.0).
Loading

0 comments on commit 26de957

Please sign in to comment.