-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**What problem does this PR solve?**: This PR adds the COSI controller Addon, without any providers. The chart comes from https://github.com/mesosphere/charts/tree/master/stable/cosi The addon does not take in any configuration so the API to enable it is just: ```yaml apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: <NAME> spec: topology: variables: - name: clusterConfig value: addons: cosi: {} ``` Once we add providers, the API can be similar to what it is with CSI with a `providers:` field. **Which issue(s) this PR fixes**: Fixes # **How Has This Been Tested?**: <!-- Please describe the tests that you ran to verify your changes. Provide output from the tests and any manual steps needed to replicate the tests. --> New unit tests. Also deployed it on a Nutanix Cluster and the Nutanix COSI driver from nutanix-cloud-native/cosi-driver-nutanix#375 Create the credentials Secret ``` apiVersion: v1 kind: Secret metadata: annotations: labels: name: objectstorage-provisioner namespace: cosi-driver-nutanix stringData: ACCESS_KEY: "<>" ACCOUNT_NAME: "<>" ENDPOINT: "http://10.1.1.1:80" PC_SECRET: "<>:9440:<>:<>" SECRET_KEY: "<>" type: Opaque ``` ``` NUTANIX_COSI_DIR=<> helm install cosi-driver -n cosi-driver-nutanix --create-namespace --set=secret.enabled=false --set=cosiController.enabled=false --skip-crds$NUTANIX_COSI_DIR/charts/ kubectl apply -f $NUTANIX_COSI_DIR/project/examples/bucketclass.yaml kubectl apply -f $NUTANIX_COSI_DIR/project/examples/bucketclaim.yaml kubectl apply -f $NUTANIX_COSI_DIR/project/examples/bucketaccessclass.yaml kubectl apply -f $NUTANIX_COSI_DIR/project/examples/bucketaccess.yaml # From nutanix-cloud-native/cosi-driver-nutanix#374 kubectl apply -f https://raw.githubusercontent.com/nutanix-cloud-native/cosi-driver-nutanix/944ce9ba66bc34e59bd94519a88da8bf9fae3d0c/project/examples/awscliapppod.yaml ``` The Secret was correctly generated and the test Pod wrote and read to a new bucket. ``` $ kubectl logs awscli Defaulted container "awscli" out of: awscli, write-aws-credentials (init), write-test-file (init) + aws s3 ls 2025-01-07 20:43:31 sample-bucketclass8ce19295-f704-45bb-a533-15591c55a747 ++ cat /tmp/test-directory/file.txt + readonly BUCKET_NAME=sample-bucketclass8ce19295-f704-45bb-a533-15591c55a747 + BUCKET_NAME=sample-bucketclass8ce19295-f704-45bb-a533-15591c55a747 ++ date +%Y%m%d_%H%M%S + readonly FILE_NAME=20250107_205233.txt + FILE_NAME=20250107_205233.txt + aws s3 cp /tmp/test-directory/file.txt s3://sample-bucketclass8ce19295-f704-45bb-a533-15591c55a747/20250107_205233.txt upload: ../tmp/test-directory/file.txt to s3://sample-bucketclass8ce19295-f704-45bb-a533-15591c55a747/20250107_205233.txt + aws s3 cp s3://sample-bucketclass8ce19295-f704-45bb-a533-15591c55a747/20250107_205233.txt - sample-bucketclass8ce19295-f704-45bb-a533-15591c55a747 ``` **Special notes for your reviewer**: <!-- Use this to provide any additional information to the reviewers. This may include: - Best way to review the PR. - Where the author wants the most review attention on. - etc. -->
- Loading branch information
Showing
35 changed files
with
531 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
12 changes: 12 additions & 0 deletions
12
...ntime-extensions-nutanix/templates/cosi/controller/manifests/helm-addon-installation.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright 2025 Nutanix. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
{{- if (index .Values.hooks.cosi "controller").helmAddonStrategy.defaultValueTemplateConfigMap.create }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: '{{ (index .Values.hooks.cosi "controller").helmAddonStrategy.defaultValueTemplateConfigMap.name }}' | ||
data: | ||
values.yaml: |- | ||
{{- .Files.Get "addons/cosi/controller/values-template.yaml" | nindent 4 }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
+++ | ||
title = " Container Object Storage Interface (COSI)" | ||
icon = "fa-solid fa-eye" | ||
+++ | ||
|
||
By leveraging CAPI cluster lifecycle hooks, this handler deploys [Container Object Storage Interface] (COSI) | ||
on the new cluster at the `AfterControlPlaneInitialized` phase. | ||
|
||
Deployment of COSI is opt-in via the [provider-specific cluster configuration]({{< ref ".." >}}). | ||
|
||
The hook uses the [Cluster API Add-on Provider for Helm] to deploy the COSI resources. | ||
|
||
## Example | ||
|
||
To enable deployment of COSI on a cluster, specify the following values: | ||
|
||
```yaml | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
metadata: | ||
name: <NAME> | ||
spec: | ||
topology: | ||
variables: | ||
- name: clusterConfig | ||
value: | ||
addons: | ||
cosi: {} | ||
``` | ||
[Container Object Storage Interface]: https://kubernetes.io/blog/2022/09/02/cosi-kubernetes-object-storage-management/ | ||
[Cluster API Add-on Provider for Helm]: https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.