Local Persistence Volume Static Provisioner
This patchset provides the local volume provisioner manifests function for deploying it in a Target cluster, based on Helm charts. Closes: #27 Change-Id: I4d02727fb71c838c6791cc217d7a652a0011ff40
This commit is contained in:
parent
fdcb0ca27d
commit
84446371f7
82
manifests/function/local-storage/README.md
Normal file
82
manifests/function/local-storage/README.md
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
# Local-Storage function
|
||||||
|
|
||||||
|
This function implements the local-volume-static-provisioner which
|
||||||
|
manages the lifecycle of the persistent volumes for pre-allocated
|
||||||
|
disks by detecting and creating PVs for each local disk on the host,
|
||||||
|
and cleaning up the disks when released. It does not support dynamic
|
||||||
|
provisioning.
|
||||||
|
|
||||||
|
Manual creation of PV on a particular host:
|
||||||
|
|
||||||
|
```
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: example-local-pv
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 5Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Delete
|
||||||
|
storageClassName: local-storage
|
||||||
|
local:
|
||||||
|
path: /mnt/disks/ssd1
|
||||||
|
nodeAffinity:
|
||||||
|
required:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: kubernetes.io/hostname
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- my-node # node on which the local disk exists
|
||||||
|
```
|
||||||
|
|
||||||
|
Creating a simple PVC and attaching it to the pod in the Deployment:
|
||||||
|
|
||||||
|
```
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: example-local-claim
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 5Gi
|
||||||
|
storageClassName: local-storage
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: local-test-reader
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: local-test-reader
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: local-test-reader
|
||||||
|
spec:
|
||||||
|
terminationGracePeriodSeconds: 10
|
||||||
|
containers:
|
||||||
|
- name: reader
|
||||||
|
image: k8s.gcr.io/busybox
|
||||||
|
command:
|
||||||
|
- "/bin/sh"
|
||||||
|
args:
|
||||||
|
- "-c"
|
||||||
|
- "tail -f /usr/test-pod/test_file"
|
||||||
|
volumeMounts:
|
||||||
|
- name: local-vol
|
||||||
|
mountPath: /usr/test-pod
|
||||||
|
volumes:
|
||||||
|
- name: local-vol
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: "example-local-claim"
|
||||||
|
```
|
33
manifests/function/local-storage/helmrelease.yaml
Normal file
33
manifests/function/local-storage/helmrelease.yaml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: local-storage
|
||||||
|
---
|
||||||
|
apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: provisioner
|
||||||
|
namespace: local-storage
|
||||||
|
spec:
|
||||||
|
timeout: 10m
|
||||||
|
interval: 5m
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: provisioner
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: collator
|
||||||
|
namespace: helm-chart-collator
|
||||||
|
values:
|
||||||
|
classes:
|
||||||
|
- name: local-storage
|
||||||
|
hostDir: /local-storage
|
||||||
|
volumeMode: Filesystem
|
||||||
|
storageClass:
|
||||||
|
reclaimPolicy: Delete
|
||||||
|
isDefaultClass: false
|
||||||
|
fsType: ext4
|
||||||
|
daemonset:
|
||||||
|
image: k8s.gcr.io/sig-storage/local-volume-provisioner:v2.4.0
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: false
|
5
manifests/function/local-storage/kustomization.yaml
Normal file
5
manifests/function/local-storage/kustomization.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- helmrelease.yaml
|
@ -0,0 +1,2 @@
|
|||||||
|
resources:
|
||||||
|
- versions.yaml
|
39
manifests/function/local-storage/replacements/versions.yaml
Normal file
39
manifests/function/local-storage/replacements/versions.yaml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: ReplacementTransformer
|
||||||
|
metadata:
|
||||||
|
name: localvolume-provisioner-replacements
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/function: |-
|
||||||
|
container:
|
||||||
|
image: quay.io/airshipit/replacement-transformer:latest
|
||||||
|
replacements:
|
||||||
|
- source:
|
||||||
|
objref:
|
||||||
|
kind: VersionsCatalogue
|
||||||
|
name: versions-treasuremap
|
||||||
|
fieldref: "{.spec.images.localstorage.provisioner.provisioner.image}"
|
||||||
|
target:
|
||||||
|
objref:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: provisioner
|
||||||
|
fieldrefs: ["{.spec.values.daemonset.image}"]
|
||||||
|
- source:
|
||||||
|
objref:
|
||||||
|
kind: VersionsCatalogue
|
||||||
|
name: versions-treasuremap
|
||||||
|
fieldref: "{.spec.charts.provisioner.chart}"
|
||||||
|
target:
|
||||||
|
objref:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: provisioner
|
||||||
|
fieldrefs: ["{.spec.chart.spec.chart}"]
|
||||||
|
- source:
|
||||||
|
objref:
|
||||||
|
kind: VersionsCatalogue
|
||||||
|
name: versions-treasuremap
|
||||||
|
fieldref: "{.spec.charts.provisioner.version}"
|
||||||
|
target:
|
||||||
|
objref:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: provisioner
|
||||||
|
fieldrefs: ["{.spec.chart.spec.version}"]
|
@ -66,6 +66,9 @@ spec:
|
|||||||
dex-aio:
|
dex-aio:
|
||||||
chart: dex-aio
|
chart: dex-aio
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
|
provisioner:
|
||||||
|
chart: provisioner
|
||||||
|
version: ""
|
||||||
|
|
||||||
images:
|
images:
|
||||||
# images are organized by
|
# images are organized by
|
||||||
@ -150,6 +153,10 @@ spec:
|
|||||||
image: ceph/ceph:v15.2.11
|
image: ceph/ceph:v15.2.11
|
||||||
rook-ceph-tools:
|
rook-ceph-tools:
|
||||||
image: rook/ceph:v1.6.3
|
image: rook/ceph:v1.6.3
|
||||||
|
localstorage:
|
||||||
|
provisioner:
|
||||||
|
provisioner:
|
||||||
|
image: k8s.gcr.io/sig-storage/local-volume-provisioner:v2.4.0
|
||||||
|
|
||||||
image_components:
|
image_components:
|
||||||
# image_components are organized by
|
# image_components are organized by
|
||||||
|
@ -2,4 +2,5 @@ resources:
|
|||||||
- ../../../../composite/storage-cluster
|
- ../../../../composite/storage-cluster
|
||||||
- ../../../../function/ingress
|
- ../../../../function/ingress
|
||||||
- ../../../../function/helm-chart-repository
|
- ../../../../function/helm-chart-repository
|
||||||
|
- ../../../../function/local-storage
|
||||||
- dex-aio
|
- dex-aio
|
||||||
|
@ -3,3 +3,4 @@ resources:
|
|||||||
- ../../../../../function/ingress/replacements
|
- ../../../../../function/ingress/replacements
|
||||||
- ../../../../../function/dex-aio/replacements
|
- ../../../../../function/dex-aio/replacements
|
||||||
- ../../../../../function/helm-chart-repository/replacements
|
- ../../../../../function/helm-chart-repository/replacements
|
||||||
|
- ../../../../../function/local-storage/replacements
|
||||||
|
@ -5,3 +5,4 @@ resources:
|
|||||||
- ../../../../function/synclabeller
|
- ../../../../function/synclabeller
|
||||||
- ../../../../function/vino
|
- ../../../../function/vino
|
||||||
- ../../../../function/helm-chart-repository/
|
- ../../../../function/helm-chart-repository/
|
||||||
|
- ../../../../function/local-storage
|
||||||
|
@ -5,3 +5,4 @@ resources:
|
|||||||
- ../../../../../function/synclabeller/replacements
|
- ../../../../../function/synclabeller/replacements
|
||||||
- ../../../../../function/vino/replacements
|
- ../../../../../function/vino/replacements
|
||||||
- ../../../../../function/helm-chart-repository/replacements
|
- ../../../../../function/helm-chart-repository/replacements
|
||||||
|
- ../../../../../function/local-storage/replacements
|
||||||
|
Loading…
x
Reference in New Issue
Block a user