Junior — Middle
In which configuration setting is the number of replicas for the deployed service defined?
sobes.tech AI
Answer from AI
The number of replicas for the deployed service is usually specified in the configuration of the container orchestrator or deployment management system. For example, in Kubernetes, it is specified in the replicas field in a Deployment object:
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-deployment
spec:
replicas: 3 # The number of replicas is set here
selector:
matchLabels:
app: example
template:
metadata:
labels:
app: example
spec:
containers:
- name: example-container
image: example-image
In other systems, such as Docker Swarm, the number of replicas is specified in the service parameters during its creation or update.