How to have more than one instance of the kubernetes service object itself?

3/30/2019

Is it possible to have more than one instance of the actual Service object created in deployments that actually manages the access to pods (containers) and what happens if the actual service object itself is somehow deleted or destroyed?

This is the service object specified in a deployment YAML file:

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

1 Answer

3/30/2019

The Service object only exists as an abstraction within the Kubernetes API. The actual implementation is distributed across your entire cluster, generally in the form of iptables rules created by kube-proxy on every node.

-- coderanger
Source: StackOverflow