mirror of
https://github.com/acedemand/kubernetes-essentials.git
synced 2021-08-24 18:29:57 +03:00
replication controller
This commit is contained in:
19
02-deployments/01.1-replication-controller.yaml
Normal file
19
02-deployments/01.1-replication-controller.yaml
Normal 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user