March 2017
Beginner to intermediate
925 pages
18h 11m
English
Kubernetes has a scheduler to assign the container to the right node. In addition, you can easily scale out and scale down the number of containers. The Kubernetes scaling function will conduct the replication controller to adjust the number of containers.
Prepare the following YAML file, which is a simple replication controller to launch two nginx containers. Also, service will expose the TCP port 30080:
# cat nginx-rc-svc.yaml apiVersion: v1 kind: ReplicationController metadata: name: my-nginx spec: replicas: 2 selector: sel : my-selector template: metadata: labels: sel : my-selector spec: containers: - name: my-container image: nginx --- apiVersion: v1 kind: Service metadata: name: my-nginx
Read now
Unlock full access