# my-service.yaml
apiVersion: v1
kind: Service
metadata:
name: hello-service
spec:
type: NodePort
ports:
- port: 3000
nodePort: 30390
protocol: TCP
targetPort: 3000
selector:
app: my-deployment
kubectl create -f my-service.yaml
kubectl get svc
kubectl run -i --tty alpine --image=alpine --restart=Never -- sh
apk add --no-cache curl
curl <ClusterIP>:<ClusterPort>
kubectl exec -it hello-deployment-6db6b6cbdf-6bfr8 sh
curl <ClusterIP>:<ClusterPort>