kind: Service

From wikieduonline
Jump to navigation Jump to search

kind: Service to create a Kubernetes service


Oficial example

apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  selector:
    app: MyApp
  ports:
    - protocol: TCP
      port: 80
      targetPort: 9376

Examples

apiVersion: v1
kind: Service
metadata:
  annotations: {}
  name: your_app
  namespace: your_namespace
spec:
  ports:
    - name: http
      port: 8080
      protocol: TCP
      targetPort: 8080
  selector:
    app: watch
  sessionAffinity: None
  type: ClusterIP

Related

See also

Advertising: