sansae@sansaeAir15m2 k8s-lab-workspace % k apply -f statefulset.yaml
service/nginx-stps created
statefulset.apps/web created
sansae@sansaeAir15m2 k8s-lab-workspace % k get all
NAME READY STATUS RESTARTS AGE
pod/web-0 0/1 Pending 0 3s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 29s
service/nginx-stps ClusterIP None <none> 80/TCP 3s
NAME READY AGE
statefulset.apps/web 0/3 3s
sansae@sansaeAir15m2 k8s-lab-workspace % k get all
NAME READY STATUS RESTARTS AGE
pod/web-0 1/1 Running 0 2m47s
pod/web-1 1/1 Running 0 117s
pod/web-2 1/1 Running 0 97s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 3m13s
service/nginx-stps ClusterIP None <none> 80/TCP 2m47s
NAME READY AGE
statefulset.apps/web 3/3 2m47s
sansae@sansaeAir15m2 k8s-lab-workspace % k get statefulset
NAME READY AGE
web 3/3 48m
sansae@sansaeAir15m2 k8s-lab-workspace % k describe statefulset web
Name: web
Namespace: default
CreationTimestamp: Sat, 09 Mar 2024 21:52:14 +0900
Selector: app=nginx
Labels: <none>
Annotations: <none>
Replicas: 3 desired | 3 total
Update Strategy: RollingUpdate
Partition: 0
Pods Status: 3 Running / 0 Waiting / 0 Succeeded / 0 Failed
Pod Template:
Labels: app=nginx
Containers:
nginx:
Image: registry.k8s.io/nginx-slim:0.8
Port: 80/TCP
Host Port: 0/TCP
Environment: <none>
Mounts:
/usr/share/nginx/html from www (rw)
Volumes: <none>
Volume Claims:
Name: www
StorageClass: azurefile
Labels: <none>
Annotations: <none>
Capacity: 1Gi
Access Modes: [ReadWriteOnce]
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal SuccessfulCreate 48m statefulset-controller create Claim www-web-0 Pod web-0 in StatefulSet web success
Normal SuccessfulCreate 48m statefulset-controller create Pod web-0 in StatefulSet web successful
Normal SuccessfulCreate 47m statefulset-controller create Claim www-web-1 Pod web-1 in StatefulSet web success
Normal SuccessfulCreate 47m statefulset-controller create Pod web-1 in StatefulSet web successful
Normal SuccessfulCreate 47m statefulset-controller create Claim www-web-2 Pod web-2 in StatefulSet web success
Normal SuccessfulCreate 47m statefulset-controller create Pod web-2 in StatefulSet web successful
# Headless |