You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
apiVersion: apps/v1kind: ReplicaSetmetadata:
name: myapp2-rsspec:
replicas: 3# 3 Pods should exist at all times.selector: # Pods label should be defined in ReplicaSet label selectormatchLabels:
app: myapp2template:
metadata:
name: myapp2-podlabels:
app: myapp2 # Atleast 1 Pod label should match with ReplicaSet Label Selectorspec:
containers:
- name: myapp2image: stacksimplify/kubenginx:2.0.0ports:
- containerPort: 80
Step-02: Create ReplicaSet
Create ReplicaSet with 3 Replicas
# Create ReplicaSet
kubectl apply -f 02-replicaset-definition.yml
# List Replicasets
kubectl get rs
Delete a pod
ReplicaSet immediately creates the pod.
# List Pods
kubectl get pods
# Delete Pod
kubectl delete pod <Pod-Name>
# Create NodePort Service
kubectl apply -f 03-replicaset-nodeport-servie.yml
# List NodePort Service
kubectl get svc
# Get Public IP
kubectl get nodes -o wide
# Access Application
http://<Worker-Node-Public-IP>:<NodePort>
http://<Worker-Node-Public-IP>:31232