# service-definition.yml
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: NodePort
ports:
- targetPort: 80
port: 80
nodePort: 30009
.........
# create command
> kubectl create -f service-definition.yml
# Get
> kubectl get services
0 people found this article useful
0 people found this article useful