Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
build: add CSI configuration to Nutanix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoshkin committed Apr 5, 2024
1 parent c4bed7a commit b9c569c
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 0 deletions.
22 changes: 22 additions & 0 deletions examples/capi-quick-start/nutanix-cluster-calico-crs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
apiVersion: v1
kind: Secret
metadata:
labels:
cluster.x-k8s.io/provider: nutanix
name: ${CLUSTER_NAME}-pe-creds-for-csi
stringData:
key: ${NUTANIX_PRISM_ELEMENT_ENDPOINT}:${NUTANIX_PORT}:${NUTANIX_USER}:${NUTANIX_PASSWORD}
---
apiVersion: v1
data:
nutanix-ccm.yaml: |
---
Expand Down Expand Up @@ -317,6 +326,19 @@ spec:
cni:
provider: Calico
strategy: ClusterResourceSet
csi:
defaultStorage:
providerName: nutanix
storageClassConfigName: nutanix-volume
providers:
- credentials:
name: ${CLUSTER_NAME}-pe-creds-for-csi
name: nutanix
storageClassConfig:
- name: nutanix-volume
parameters:
storageContainer: ${NUTANIX_STORAGE_CONTAINER_NAME}
strategy: HelmAddon
nfd:
strategy: ClusterResourceSet
controlPlane:
Expand Down
22 changes: 22 additions & 0 deletions examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
apiVersion: v1
kind: Secret
metadata:
labels:
cluster.x-k8s.io/provider: nutanix
name: ${CLUSTER_NAME}-pe-creds-for-csi
stringData:
key: ${NUTANIX_PRISM_ELEMENT_ENDPOINT}:${NUTANIX_PORT}:${NUTANIX_USER}:${NUTANIX_PASSWORD}
---
apiVersion: v1
data:
nutanix-ccm.yaml: |
---
Expand Down Expand Up @@ -317,6 +326,19 @@ spec:
cni:
provider: Calico
strategy: HelmAddon
csi:
defaultStorage:
providerName: nutanix
storageClassConfigName: nutanix-volume
providers:
- credentials:
name: ${CLUSTER_NAME}-pe-creds-for-csi
name: nutanix
storageClassConfig:
- name: nutanix-volume
parameters:
storageContainer: ${NUTANIX_STORAGE_CONTAINER_NAME}
strategy: HelmAddon
nfd:
strategy: HelmAddon
controlPlane:
Expand Down
22 changes: 22 additions & 0 deletions examples/capi-quick-start/nutanix-cluster-cilium-crs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
apiVersion: v1
kind: Secret
metadata:
labels:
cluster.x-k8s.io/provider: nutanix
name: ${CLUSTER_NAME}-pe-creds-for-csi
stringData:
key: ${NUTANIX_PRISM_ELEMENT_ENDPOINT}:${NUTANIX_PORT}:${NUTANIX_USER}:${NUTANIX_PASSWORD}
---
apiVersion: v1
data:
nutanix-ccm.yaml: |
---
Expand Down Expand Up @@ -317,6 +326,19 @@ spec:
cni:
provider: Cilium
strategy: ClusterResourceSet
csi:
defaultStorage:
providerName: nutanix
storageClassConfigName: nutanix-volume
providers:
- credentials:
name: ${CLUSTER_NAME}-pe-creds-for-csi
name: nutanix
storageClassConfig:
- name: nutanix-volume
parameters:
storageContainer: ${NUTANIX_STORAGE_CONTAINER_NAME}
strategy: HelmAddon
nfd:
strategy: ClusterResourceSet
controlPlane:
Expand Down
22 changes: 22 additions & 0 deletions examples/capi-quick-start/nutanix-cluster-cilium-helm-addon.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
apiVersion: v1
kind: Secret
metadata:
labels:
cluster.x-k8s.io/provider: nutanix
name: ${CLUSTER_NAME}-pe-creds-for-csi
stringData:
key: ${NUTANIX_PRISM_ELEMENT_ENDPOINT}:${NUTANIX_PORT}:${NUTANIX_USER}:${NUTANIX_PASSWORD}
---
apiVersion: v1
data:
nutanix-ccm.yaml: |
---
Expand Down Expand Up @@ -317,6 +326,19 @@ spec:
cni:
provider: Cilium
strategy: HelmAddon
csi:
defaultStorage:
providerName: nutanix
storageClassConfigName: nutanix-volume
providers:
- credentials:
name: ${CLUSTER_NAME}-pe-creds-for-csi
name: nutanix
storageClassConfig:
- name: nutanix-volume
parameters:
storageContainer: ${NUTANIX_STORAGE_CONTAINER_NAME}
strategy: HelmAddon
nfd:
strategy: HelmAddon
controlPlane:
Expand Down
10 changes: 10 additions & 0 deletions hack/examples/additional-resources/nutanix/csi-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2023 D2iQ, Inc. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

---
apiVersion: v1
kind: Secret
metadata:
name: ${CLUSTER_NAME}-pe-creds-for-csi
stringData:
key: "${NUTANIX_PRISM_ELEMENT_ENDPOINT}:${NUTANIX_PORT}:${NUTANIX_USER}:${NUTANIX_PASSWORD}"
4 changes: 4 additions & 0 deletions hack/examples/bases/nutanix/cluster/kustomization.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../../additional-resources/nutanix/csi-secret.yaml
- https://raw.githubusercontent.com/nutanix-cloud-native/cluster-api-provider-nutanix/1a7cd69ba35de01e56dcf2dda7f31973111d2317/templates/cluster-template-topology.yaml

sortOptions:
Expand All @@ -25,6 +26,9 @@ patches:
- target:
kind: Cluster
path: ../../../patches/cluster-autoscaler.yaml
- target:
kind: Cluster
path: ../../../patches/nutanix/csi.yaml
- target:
kind: Cluster
path: ../../../patches/nutanix/initialize-variables.yaml
Expand Down
18 changes: 18 additions & 0 deletions hack/examples/patches/nutanix/csi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2024 D2iQ, Inc. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

- op: "add"
path: "/spec/topology/variables/0/value/addons/csi"
value:
defaultStorage:
providerName: nutanix
storageClassConfigName: nutanix-volume
providers:
- name: nutanix
storageClassConfig:
- name: nutanix-volume
parameters:
storageContainer: ${NUTANIX_STORAGE_CONTAINER_NAME}
strategy: HelmAddon
credentials:
name: ${CLUSTER_NAME}-pe-creds-for-csi

0 comments on commit b9c569c

Please sign in to comment.