Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows host persistent volume problem #6

Open
agnoam opened this issue Apr 22, 2021 · 0 comments
Open

Windows host persistent volume problem #6

agnoam opened this issue Apr 22, 2021 · 0 comments

Comments

@agnoam
Copy link

agnoam commented Apr 22, 2021

Hey,
I'm trying to make a deployment with a local persistent volume attached to it. (for development)

I managed to do this on Linux like Kubernetes declarations below.
I tried the C:\ format in hostPath.path but, it seems Kubernetes not support this.

Does anyone know how to make this work on Windows ?

Kubernetes declarations

Volume declaration

apiVersion: v1
kind: PersistentVolume
metadata:
  name: test-volume
  labels:
    type: local
spec:
  storageClassName: hostpath
  capacity:
    storage: 2Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/home/k8s/myTestVolume"
    type: DirectoryOrCreate

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: test-volume-claim
spec:
  storageClassName: hostpath
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 2Gi

Deployment declaration

apiVersion: apps/v1
kind: Deployment

metadata:
  name: test-app
spec:
  selector:
    matchLabels:
      app: test-app
  template:
    metadata:
      labels:
        app: test-app
    spec:
      volumes:
        - name: test-storage
          persistentVolumeClaim:
            claimName: test-volume-claim
      securityContext: {}
      containers:
        - name: test-container
          image: busybox
          securityContext:
            privileged: true
          volumeMounts:
            - mountPath: /home/data
              name:  test-storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant