Skip to content

Instantly share code, notes, and snippets.

@mauilion
Last active Jul 30, 2019
Embed
What would you like to do?
testing multinode with pv
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
nodes:
- role: control-plane
- role: worker
- role: worker
15:22 $ kubectl describe pod task-pv-pod
Name: task-pv-pod
Namespace: default
Priority: 0
Node: kind-worker/172.17.0.5
Start Time: Tue, 30 Jul 2019 15:21:02 -0700
Labels: <none>
Annotations: <none>
Status: Running
IP: 10.244.2.2
Containers:
task-pv-container:
Container ID: containerd://6dc298d9919965fab84995b162115fdba53609b02fe289ff96f8ce04ec5d798c
Image: nginx
Image ID: docker.io/library/nginx@sha256:eb3320e2f9ca409b7c0aa71aea3cf7ce7d018f03a372564dbdb023646958770b
Port: 80/TCP
Host Port: 0/TCP
State: Running
Started: Tue, 30 Jul 2019 15:21:12 -0700
Ready: True
Restart Count: 0
Environment: <none>
Mounts:
/usr/share/nginx/html from task-pv-storage (rw)
/var/run/secrets/kubernetes.io/serviceaccount from default-token-x6fk9 (ro)
Conditions:
Type Status
Initialized True
Ready True
ContainersReady True
PodScheduled True
Volumes:
task-pv-storage:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: myclaim
ReadOnly: false
default-token-x6fk9:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-x6fk9
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 90s default-scheduler Successfully assigned default/task-pv-pod to kind-worker
Normal Pulling 89s kubelet, kind-worker pulling image "nginx"
Normal Pulled 80s kubelet, kind-worker Successfully pulled image "nginx"
Normal Created 80s kubelet, kind-worker Created container
Normal Started 80s kubelet, kind-worker Started container
kind: Pod
apiVersion: v1
metadata:
name: task-pv-pod
spec:
volumes:
- name: task-pv-storage
persistentVolumeClaim:
claimName: myclaim
containers:
- name: task-pv-container
image: nginx
ports:
- containerPort: 80
name: "http-server"
volumeMounts:
- mountPath: "/usr/share/nginx/html"
name: task-pv-storage
15:23 $ kubectl describe pvc myclaim
Name: myclaim
Namespace: default
StorageClass: standard
Status: Bound
Volume: pvc-f3509910-b317-11e9-929b-0242ac110002
Labels: <none>
Annotations: pv.kubernetes.io/bind-completed: yes
pv.kubernetes.io/bound-by-controller: yes
volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/host-path
Finalizers: [kubernetes.io/pvc-protection]
Capacity: 1Gi
Access Modes: RWO
VolumeMode: Filesystem
Mounted By: task-pv-pod
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ProvisioningSucceeded 6m3s persistentvolume-controller Successfully provisioned volume pvc-f3509910-b317-11e9-929b-0242ac110002 using kubernetes.io/host-path
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: myclaim
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 1Gi
storageClassName: standard
kind-0.3.0 create cluster --config kind-config.yaml --image=kindest/node:v1.13.6@sha256:9e07014fb48c746deb98ec8aafd58c3918622eca6063e643c6e6d86c86e170b4
15:25 $ docker exec -ti kind-worker find /tmp/hostpath_pv
/tmp/hostpath_pv
/tmp/hostpath_pv/f71873c0-b317-11e9-bbca-0242ac110002
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment