kubernetes - kubectl pods are running but persistent volumes seems to be unclaimed? -


kubectl pods:

name                         ready     status    restarts   age wordpress-2942163230-47xzl   3/3       running   0          20m 

kubectl pv:

name      capacity   accessmodes   reclaimpolicy   status      claim     storageclass   reason    age pv0001    30gi       rwx           retain          available                                      30m 

kubectl pvc:

name            status    volume    capacity   accessmodes   storageclass   age task-pv-claim   pending                                      manual         26m 

why task-pv-claim not claimed? here deployment config:

apiversion: extensions/v1beta1 kind: deployment metadata:   name: wordpress   labels:     app: wordpress spec:   replicas: 2   selector:     matchlabels:       app: wordpress   template:     metadata:       labels:         app: wordpress     spec:       terminationgraceperiodseconds: 30       containers:         - image: eu.gcr.io/abcxyz/wordpress:deploy-1502795865           name: wordpress           imagepullpolicy: "always"           env:             - name: wordpress_host               value: localhost             - name: wordpress_db_username               valuefrom:                 secretkeyref:                   name: cloudsql-db-credentials                   key: username           volumemounts:             - name: wordpress-persistent-storage               mountpath: /var/www/html         - image: eu.gcr.io/abcxyz/nginx:deploy-1502795865           name: nginx           imagepullpolicy: "always"           ports:             - containerport: 80               name: nginx           volumemounts:             - name: wordpress-persistent-storage               mountpath: /var/www/html               readonly: true         - image: gcr.io/cloudsql-docker/gce-proxy:1.09           name: cloudsql-proxy           command: ["/cloud_sql_proxy", "--dir=/cloudsql",                     "-instances=abcxyz:europe-west1:wordpressdb2=tcp:3306",                     "-credential_file=/secrets/cloudsql/credentials.json"]           volumemounts:             - name: cloudsql-instance-credentials               mountpath: /secrets/cloudsql               readonly: true             - name: ssl-certs               mountpath: /etc/ssl/certs             - name: cloudsql               mountpath: /cloudsql       volumes:         - name: wordpress-persistent-storage           persistentvolumeclaim:             claimname: "task-pv-claim"         - name: cloudsql-instance-credentials           secret:             secretname: cloudsql-instance-credentials         - name: ssl-certs           hostpath:             path: /etc/ssl/certs         - name: cloudsql           emptydir: 

if kubectl describei following output:

volumes:   wordpress-persistent-storage:     type:   gcepersistentdisk (a persistent disk resource in google compute engine)     pdname: wordpress-disk     fstype: ext4     partition:  0     readonly:   false 

which previous config... strange did kubectl apply config, deleting pod (so restart new config).

it seems had delete deployment kubectl delete deployment wordpress , not pod.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -