title: How to expose nginx on public Ip using NodePort service in Kubernetes?
body: <p>I'm executing <code>kubectl create -f nginx.yaml</code> which creates the pods successfully. But the PODS aren't exposed on Public IP of my instance. Following is the YAML used be me with service type as nodeport:</p>
  
  <pre><code> apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: nginx-deployment
    labels:
      app: nginx
  spec:
    replicas: 3
    selector:
      matchLabels:
        app: nginx
    template:
      metadata:
        labels:
          app: nginx
      spec:
        containers:
        - name: nginx
          image: nginx:1.7.9
          ports:
          - containerPort: 80
  
  ---
  apiVersion: v1
  kind: Service
  metadata:
    name: nginx
    labels:
      name: nginx
  spec:
    type: NodePort
    ports:
      - port: 80
        nodePort: 30080
        name: http
      - port: 443
        nodePort: 30443
        name: https
    selector:
      name: nginx
  </code></pre>
  
  <p>What could be in-correct in my approach or above YAML file to expose the pod on deployment to the public IP?</p>
  
  <p>PS: Firewall and ACLs are open to internet on all TCP</p>