ReplicaSet Exercise-01

apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: frontend
labels:
app: guestbook
tier: frontend
spec:
# modify replicas according to your case
replicas: 3
selector:
matchLabels:
tier: frontend
template:
metadata:
labels:
tier: frontend
spec:
containers:
- name: php-redis
image: gcr.io/google_samples/gb-frontend:v3
$ kubectl apply -f <FILENAME.YAML> or 
$ kubectl create -f <FILENAME.YAML>
$ kubectl get rs
$ kubectl get rs <RS-NAME>
$ kubectl get rs -o wide
$ kubectl get rs <RS-NAME> -n default
$ kubectl get rs <POD-NAME> -o yaml  
$ kubectl get rs <POD-NAME> -o json
$ kubectl get rs --show-labels
$ kubectl get rs -l app=guestbook
$ kubectl describe rs <RS-NAME>
$ kubectl scale rs <RS-NAME> --replicas=[COUNT]
$ kubectl edit rs <RS-NAME>
$ kubectl get rs frontend -o wide 
$ kubectl get –f [FILE-NAME.yaml]
$ kubectl describe –f [FILE-NAME.yaml]
$ kubectl edit –f [FILE-NAME.yaml]
$ kubectl delete –f [FILE-NAME.yaml]
$ kubectl apply –f [FILE-NAME.yaml]
$ kubectl describe –f [FILE-NAME.yaml]
$ kubectl edit –f [FILE-NAME.yaml]
$ kubectl delete  -f replicaset.yaml
$ kubectl apply -f replicaset.yaml
$ kubectl delete rs <RS-NAME>

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store