Kubernetes pod deployment
Now, in the following example, we will be deploying two NGINX replication pods (rc-pod) and exposing them via a service. To understand Kubernetes networking, please refer to the following diagram for more details. Here, an application can be exposed via a virtual IP address, and the request to be proxied, to which replica of pod (load balancer), is taken care of by the service:
Kubernetes networking with OVS bridge
In the Kubernetes master, create a new folder:
$ mkdir nginx_kube_example $ cd nginx_kube_example
Create the YAML file in the editor of your choice, which will be used to deploy the NGINX pod:
$ vi nginx_pod.yaml apiVersion: v1 kind: ReplicationController metadata: name: nginx spec: replicas: 2 selector: app: nginx template: metadata: name: nginx labels: app: nginx spec: containers: - name: nginx image: nginx ports: - containerPort: 80
Create the NGINX pod using
kubectl:
$ kubectl...