AGE pod/lamp-lamp-747cb6479-mp9vb 0/2 Pending 0 2m14s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/lamp-lamp LoadBalancer 10.107.17.117 <pending> 80:31877/TCP 2m14s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/lamp-lamp 0/1 1 0 2m14s NAME DESIRED CURRENT READY AGE replicaset.apps/lamp-lamp-747cb6479 1 1 0 2m14s => pod/lamp-lamp-747cb6479-mp9vbがPendingなので何が問題なのか確認 $ kubectl -n lamp describe pod/lamp-lamp-747cb6479-mp9vb|less -i : Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning FailedScheduling 10s (x4 over 2m59s) default-scheduler error while running "VolumeBinding" filter plugin for pod "lamp-lamp-747cb6479-mp9vb": pod has unbound immediate PersistentVolumeClaims
AGE pod/lamp-lamp-8548db8f79-lvpsw 2/2 Running 0 24s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/lamp-lamp LoadBalancer 10.100.248.255 <pending> 80:31105/TCP 24s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/lamp-lamp 1/1 1 1 24s NAME DESIRED CURRENT READY AGE replicaset.apps/lamp-lamp-8548db8f79 1 1 1 24s $ kubectl -n lamp get pod -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES lamp-lamp-8548db8f79-lvpsw 2/2 Running 0 50s 10.0.80.5 n01.k8s01 <none> <none> $ curl 10.0.80.5 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>403 Forbidden</title> => アクセスできない
name to httpd. Use 'kubectl describe pod/lamp-lamp-8548db8f79-cms57 -n lamp' to see all of the containers in this pod. bash-5.0# bash-5.0# date > index.html bash-5.0# ls -lah total 4K drwxrwxrwx 2 root root 24 Jan 17 23:43 . drwxr-xr-x 3 root root 18 Jan 17 23:36 .. -rw-r--r-- 1 root root 29 Jan 17 23:43 index.html bash-5.0# chown -R 33:33 /var/www/html $ kubectl -n lamp get pod -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES lamp-lamp-8548db8f79-cms57 2/2 Running 0 8m24s 10.0.80.8 n01.k8s01 <none> <none> $ curl 10.0.80.8 Fri Jan 17 23:43:57 UTC 2020 => アクセスできた