replication controller

This commit is contained in:
Pamir Erdem
2018-09-11 00:52:50 +03:00
parent d8bc5a0a67
commit 355a53d51b
2 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
apiVersion: v1
kind: ReplicationController
metadata:
name: nginx
spec:
replicas: 3
selector:
app: nginx
template:
metadata:
name: nginx
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80

View File

@@ -1,3 +1,29 @@
kubectl create -f 01-replication-controller.yaml
kubectl get rc
kubectl describe rc nginx
kubectl delete rc nginx --cascade=false
kubectl get pods
kubectl delete pod nginx-xxxx
kubectl get pods
kubectl create -f 01-replication-controller.yaml
# Deprecated
kubectl rolling-update nginx nginx-v2 --image=nginx:1.8.1
kubectl get pods
kubectl get rc -w
kubectl rolling-update nginx --image=nginx:xyz
kubectl get pods
kubectl rolling-update nginx --rollback
## End Deprecated
kubectl apply -f 02-replicationset.yaml
kubectl get events -w
kubectl get rs -w