简体   繁体   中英

Persistent Volume Mount Causes App install to hang

I have am using the follwoing volume claim:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: persistent-storage-claim
  labels:
    app: {{ include "api-chart.name" . }}
    chart: {{ include "api-chart.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
  storageClassName: managed-premium
  volumeName: personal

in the following deployment:

...
...
 spec:
      imagePullSecrets:
        - name: registrySecret
      volumes:
        - name: personal-volume
          persistentVolumeClaim:
            claimName: persistent-storage-claim
      containers:
        - name: container1
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          ports:
            - name: http
              containerPort: {{ .Values.service.targetPort }}
              protocol: TCP
          volumeMounts:
            - name: personal-volume
              mountPath: "/workspace"
...

Mounting this volume seems to cause the deployment to hang (it does not deploy, but there are no error messages that I can see anywhere). If the volumenMounts part is removed, the deployment succeeds. I am using helm install to deploy the app. Any ideas as to what might be causing the problem? Or at least how to debug this?

Update: kubectl get events returns the following:

LAST SEEN   TYPE      REASON              OBJECT                                                                             MESSAGE
46s         Warning   FailedScheduling    pod/storage-test-labd62r2                pod has unbound immediate PersistentVolumeClaims (repeated 3 times)
24m         Normal    SuccessfulCreate    replicaset/test-storage-b65db5698   Created pod: storage-test-labd62r2
24m         Normal    ScalingReplicaSet   deployment/test-storage            Scaled up replica set test-storage-b65db5698 to 1
24m         Normal    CREATE              ingress/test-storage               Ingress default/test-storage
24m         Normal    CREATE              ingress/test-storage               Ingress default/test-storage
24m         Normal    UPDATE              ingress/test-storage               Ingress default/test-storage
24m         Normal    UPDATE              ingress/test-storage               Ingress default/test-storage

and kubectl get pvc gives:

NAME                       STATUS    VOLUME                    CAPACITY   ACCESS MODES   STORAGECLASS      AGE
persistent-storage-claim   Pending   personal                  0                         managed-premium   33m

kubectl get pv displays nothing

kubectl svc :

NAME                                                          TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)           AGE
test-storage   ClusterIP   10.0.244.147   <none>        80/TCP,8080/TCP   35m
kubernetes                                                    ClusterIP   10.0.0.1       <none>        443/TCP           16d

This generally happens because there is no manually provisioned PersistentVolume to satisfy the PersistentVolumeClaim or the StorageClass mentioned in the claim does not exist or could not dynamically provision a PersistentVolume to satisfy the PersistentVolumeClaim

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM