profile
viewpoint

Ask questionsDynamic volume provisioning support

Dynamic volume provisioning support would be handy to have to test apps which need persistence.

kubernetes-sigs/kind

Answer questions Xtigyro

If there is a PV matched the selector, Kubernetes should already handle it before it reaches the provisioner. Btw, I haven't seen a provisioner support the field yet.

And if you're looking for a way to specify a PV for PVC, you can use pvc.spec.volumeName instead.

@yasker Are we talking about dynamic provisioning? Because that's why I need it - so that the PVC can match the dynamically provisioned PV.

An example:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: puppet-hiera-claim
  labels:
    {{- include "puppetserver.hiera.labels" . | nindent 4 }}
{{- if .Values.storage.annotations }}
  annotations:
{{ toYaml .Values.storage.annotations | nindent 4 }}
{{- end }}
spec:
  {{- if .Values.storage.selector }}
  selector:
    matchLabels:
      {{- include "puppetserver.hiera.matchLabels" . | nindent 6 }}
  {{- end }}
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: {{ .Values.storage.size | quote }}
{{- if .Values.storage.storageClass }}
{{- if (eq "-" .Values.storage.storageClass) }}
  storageClassName: ""
{{- else }}
  storageClassName: "{{ .Values.storage.storageClass }}"
{{- end }}
{{- end }}

The standard K8s hostPath provisioner supports it though you're right - the one from AWS (AWS EBS), for example, does not support it, too. I haven't tried the others from GCP/Azure/etc.

useful!

Related questions

Cluster not starting with DIND setup hot 1
Appears when using ceph of roook: map failed: (30) Read-only file system hot 1
Errors compile: version "go1.12.1" does not match go tool version "go1.10.2" hot 1
Installing Istio fails when trying to match resources hot 1
Helm: rabbitmq-ha deployment fails to discover k8s nodes hot 1
`kind` should be able to start the control plane when `/dev/kmsg` is not available hot 1
WSLv1: No DNS between pods or to the internet hot 1
Github User Rank List