Kubernetes NodePort vs LoadBalancer vs Ingress?

 ClusterIP

apiVersion: v1
kind: Service
metadata:  
  name: my-internal-service
spec:
  selector:    
    app: my-app
  type: ClusterIP
  ports:  
  - name: http
    port: 80
    targetPort: 80
    protocol: TCP
Start the Kubernetes Proxy:
$ kubectl proxy --port=8080

The YAML for a NodePort service looks like this:
apiVersion: v1
kind: Service
metadata:  
  name: my-nodeport-service
spec:
  selector:    
    app: my-app
  type: NodePort
  ports:  
  - name: http
    port: 80
    targetPort: 80
    nodePort: 30036
    protocol: TCP
Basically, a NodePort service has two differences from a normal “ClusterIP” service. First, the type is “NodePort.” There is also an additional port called the nodePort that specifies which port to open on the nodes. If you don’t specify this port, it will pick a random port. 
** LoadBalancer **

*** Ingress ***

Comments

Popular posts from this blog

[Kubernetes] Node Overcommitted

[AWS] What is the Cloud Formation?

How to Install jenkins using Helm chart on instance