Create service.yaml

This commit is contained in:
Rajesh1b 2024-09-26 15:45:50 +05:30 committed by GitHub
parent 58d6105e77
commit b7b5ca185b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

17
k8s/service.yaml Normal file
View file

@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: petclinic-service
spec:
type: NodePort
selector:
app: petclinic
ports:
- port: 80
# By default and for convenience, the `targetPort` is set to
# the same value as the `port` field.
targetPort: 8080
# Optional field
# By default and for convenience, the Kubernetes control plane
# will allocate a port from a range (default: 30000-32767)
nodePort: 30007