...

/

A Quick Example

A Quick Example

Learn how we can use services in Kubernetes with a quick example.

We'll cover the following...

Before we start talking about how a service works and all the different types of services we can have, let’s see a simple service in action to understand what it is doing.

Press + to interact
apiVersion: v1
kind: Service
metadata:
name: hellok8s-svc
spec:
type: NodePort
selector:
app: hellok8s
ports:
- port: 4567
nodePort: 30001

By now, you should be getting used to the general manifest format. Most of this service definition is quite similar to the pods and deployment manifests we have seen.
We define a resource with the Service kind and give it the name hellok8s-svc. In the ...

Access this course and 1400+ top-rated courses and projects.