Skip to content

Instantly share code, notes, and snippets.

@neoaggelos
Created August 28, 2023 14:28
Show Gist options
  • Save neoaggelos/623f757fef8381d88ae149010484cc6d to your computer and use it in GitHub Desktop.
Save neoaggelos/623f757fef8381d88ae149010484cc6d to your computer and use it in GitHub Desktop.
MicroK8s Cinder CSI
  1. Create secret.yaml with openstack credentials, use template from this gist. Required actions:
    • Uncomment items needed if cloud uses a self-signed CA. Add CA in the ca.crt key.
    • If Cinder does not use the same AZs as Nova, uncomment the ignore-volume-az line.
  2. Create values.yaml using the template from this gist.
    • Uncomment items needed if cloud uses a self-signed CA.
    • If Cinder does not use the same AZs as Nova, uncomment the custom storage classes options and the availability to the name of the cinder AZ.
  3. Install Cinder CSI helm chart with:
microk8s helm repo add openstack https://kubernetes.github.io/cloud-provider-openstack
microk8s helm repo update
microk8s helm install --namespace kube-system cinder-csi openstack/openstack-cinder-csi -f values.yaml
apiVersion: v1
kind: Secret
metadata:
name: cinder-csi-cloud-config
namespace: kube-system
stringData:
cloud.conf: |
[Global]
auth-url = https://api.open-cloud.xyz:5000/v3
region = $region
username = $username
password = $password
tenant-name = $project
domain-name = $domain
tenant-domain-name = $domain
# # if cloud uses self-signed CA
# ca-file = /etc/cacert/ca.crt
[BlockStorage]
bs-version = v3
# # if cinder has different AZs from nova
# ignore-volume-az = true
# # if cloud uses self-signed CA
# ca.crt: |
# -----BEGIN CERTIFICATE-----
# ...
# -----END CERTIFICATE-----
secret:
enabled: true
name: cinder-csi-cloud-config
csi:
plugin:
nodePlugin:
kubeletDir: /var/snap/microk8s/common/var/lib/kubelet
# # if cloud uses a self-signed CA (configured in the secret.yaml)
# volumes:
# - name: cacert
# secret:
# secretName: cinder-csi-cloud-config
# volumeMounts:
# - name: cacert
# mountPath: /etc/cacert
# readOnly: true
# - name: cloud-config
# mountPath: /etc/kubernetes
# readOnly: true
# uncomment to configure custom storage classes (e.g. to set "availability" to handle the availability zone to create cinder volumes in)
# storageClass:
# enabled: false
# custom: |-
# ---
# apiVersion: storage.k8s.io/v1
# kind: StorageClass
# metadata:
# name: csi-cinder-sc-delete
# provisioner: cinder.csi.openstack.org
# volumeBindingMode: WaitForFirstConsumer
# allowVolumeExpansion: true
# reclaimPolicy: Delete
# parameters:
# availability: nova
# ---
# apiVersion: storage.k8s.io/v1
# kind: StorageClass
# metadata:
# name: csi-cinder-sc-retain
# provisioner: cinder.csi.openstack.org
# volumeBindingMode: WaitForFirstConsumer
# allowVolumeExpansion: true
# reclaimPolicy: Retain
# parameters:
# availability: nova
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment