Update replicaset.md

pull/45385/head
Charles Uneze 2024-02-28 23:45:22 +01:00 committed by GitHub
parent 0ce9c35100
commit 5f48ae0618
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 15 deletions

View File

@ -90,17 +90,16 @@ And you will see output similar to:
Name: frontend Name: frontend
Namespace: default Namespace: default
Selector: tier=frontend Selector: tier=frontend
Labels: app=guestbook Labels: app=nginx
tier=frontend tier=frontend
Annotations: kubectl.kubernetes.io/last-applied-configuration: Annotations: <none>
{"apiVersion":"apps/v1","kind":"ReplicaSet","metadata":{"annotations":{},"labels":{"app":"guestbook","tier":"frontend"},"name":"frontend",...
Replicas: 3 current / 3 desired Replicas: 3 current / 3 desired
Pods Status: 3 Running / 0 Waiting / 0 Succeeded / 0 Failed Pods Status: 3 Running / 0 Waiting / 0 Succeeded / 0 Failed
Pod Template: Pod Template:
Labels: tier=frontend Labels: tier=frontend
Containers: Containers:
php-redis: nginx:
Image: gcr.io/google_samples/gb-frontend:v3 Image: nginx
Port: <none> Port: <none>
Host Port: <none> Host Port: <none>
Environment: <none> Environment: <none>
@ -109,9 +108,9 @@ Pod Template:
Events: Events:
Type Reason Age From Message Type Reason Age From Message
---- ------ ---- ---- ------- ---- ------ ---- ---- -------
Normal SuccessfulCreate 117s replicaset-controller Created pod: frontend-wtsmm Normal SuccessfulCreate 13s replicaset-controller Created pod: frontend-gbgfx
Normal SuccessfulCreate 116s replicaset-controller Created pod: frontend-b2zdv Normal SuccessfulCreate 13s replicaset-controller Created pod: frontend-rwz57
Normal SuccessfulCreate 116s replicaset-controller Created pod: frontend-vcmts Normal SuccessfulCreate 13s replicaset-controller Created pod: frontend-wkl7w
``` ```
And lastly you can check for the Pods brought up: And lastly you can check for the Pods brought up:
@ -124,16 +123,16 @@ You should see Pod information similar to:
``` ```
NAME READY STATUS RESTARTS AGE NAME READY STATUS RESTARTS AGE
frontend-b2zdv 1/1 Running 0 6m36s frontend-gbgfx 1/1 Running 0 10m
frontend-vcmts 1/1 Running 0 6m36s frontend-rwz57 1/1 Running 0 10m
frontend-wtsmm 1/1 Running 0 6m36s frontend-wkl7w 1/1 Running 0 10m
``` ```
You can also verify that the owner reference of these pods is set to the frontend ReplicaSet. You can also verify that the owner reference of these pods is set to the frontend ReplicaSet.
To do this, get the yaml of one of the Pods running: To do this, get the yaml of one of the Pods running:
```shell ```shell
kubectl get pods frontend-b2zdv -o yaml kubectl get pods frontend-gbgfx -o yaml
``` ```
The output will look similar to this, with the frontend ReplicaSet's info set in the metadata's ownerReferences field: The output will look similar to this, with the frontend ReplicaSet's info set in the metadata's ownerReferences field:
@ -142,11 +141,11 @@ The output will look similar to this, with the frontend ReplicaSet's info set in
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
creationTimestamp: "2020-02-12T07:06:16Z" creationTimestamp: "2024-02-28T22:30:44Z"
generateName: frontend- generateName: frontend-
labels: labels:
tier: frontend tier: frontend
name: frontend-b2zdv name: frontend-gbgfx
namespace: default namespace: default
ownerReferences: ownerReferences:
- apiVersion: apps/v1 - apiVersion: apps/v1
@ -154,7 +153,7 @@ metadata:
controller: true controller: true
kind: ReplicaSet kind: ReplicaSet
name: frontend name: frontend
uid: f391f6db-bb9b-4c09-ae74-6a1f77f3d5cf uid: e129deca-f864-481b-bb16-b27abfd92292
... ...
``` ```