Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
kubernetes_tips [2015/10/17 21:28]
imcsk8
kubernetes_tips [2016/06/09 06:07] (current)
imcsk8
Line 71: Line 71:
 $ kubectl --server=http://​cloud.soho:​8081 delete pod nginx-test $ kubectl --server=http://​cloud.soho:​8081 delete pod nginx-test
 </​code>​ </​code>​
 +
 +=====  Replication Contoller =====
 +Replication controllers ensure that the correct number of pods are
 +running even if they crash, are stopped manually or something weird
 +happens. This are the recommended way to handle pods even if it's only 
 +one per node.
 +
 +<​code>​
 +apiVersion: v1
 +kind: ReplicationController
 +metadata:
 +  name: webserver
 +spec:
 +  replicas: 3
 +  selector:
 +    app: web
 +  template:
 +    metadata:
 +      name: nginx-replicator
 +      labels:
 +        app: web
 +    spec:
 +      containers:
 +      - name: web-servers
 +        image: imcsk8/​centos-nginx
 +        imagePullPolicy:​ IfNotPresent
 +        ports:
 +        - containerPort:​ 80
 +</​code>​
 +
 +
  
 ==== References ==== ==== References ====
Line 77: Line 108:
 [[https://​github.com/​kubernetes/​kubernetes/​blob/​master/​docs/​user-guide/​walkthrough/​README.md]]\\ [[https://​github.com/​kubernetes/​kubernetes/​blob/​master/​docs/​user-guide/​walkthrough/​README.md]]\\
 [[http://​www.dasblinkenlichten.com/​kubernetes-101-the-constructs/​]] [[http://​www.dasblinkenlichten.com/​kubernetes-101-the-constructs/​]]
 +[[http://​kubernetes.io/​docs/​user-guide/​replication-controller/​]]