- Take me to Video Tutorial
In this section we will take a look at services
in kuberentes
-
Kubernetes Services enables communication between various components within an outside of the application.
-
How do we as an
external user
access theweb page
?
-
NodePort
- Where the services makes an internal POD accessable on a POD on the NODE.
apiVersion: v1 kind: Service metadata: name: myapp-service spec: types: NodePort ports: - targetPort: 80 port: 80 nodePort: 30008
apiVersion: v1 kind: Service metadata: name: myapp-service spec: types: NodePort ports: - targetPort: 80 port: 80 nodePort: 30008 selector: app: myapp type: front-end
$ kubectl create -f service-defination.yaml
$ kubectl get services
$ curl http://192.168.1.2:30008
- Where the services makes an internal POD accessable on a POD on the NODE.
-
ClusterIP
- In this case the service creates a
Virtual IP
inside the cluster to enable communication between different services such as a set of frontend servers to a set of backend servers.
- In this case the service creates a
-
LoadBalancer
- Where provisions a
loadbalancer
for our application in supported cloud providers.
- Where provisions a
K8s Reference Docs: