Below is a sample nodeport service yaml file
# cat NodePort.yaml
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
Run following command to create NodePort service in your Kubernetes cluster
# kubectl apply -f NodePort.yaml
No comments:
Post a Comment