The provided YAML file defines two Kubernetes resources:
Deployment: condor-backend
Service: condor-backend-service
Deployment Configuration
The condor-backend deployment is configured as follows:
Metadata
name: condor-backend
namespace: default
labels: app: condor-backend
Spec
replicas: 1 (this is the number of replicas that should be running at any given time)
selector: matches the label app: condor-backend
template:
metadata: labels the pod with app: condor-backend
spec:
containers:
condor-backend-server:
image: not specified (must be set before deployment)
ports: exposes port 8080
resources:
requests: requests 1 CPU and 512Mi of memory
limits: sets the maximum memory to 512Mi and CPU to 1
startupProbe: probes the pod after 300 seconds, with a period of 300 seconds, and a failure threshold of 3 attempts
Service Configuration
The condor-backend-service service is configured as follows:
Metadata
name: condor-backend-service
Spec
selector: selects pods with the label app: condor-backend
type: ClusterIP
ports:
protocol: TCP
port: 8080
targetPort: 8080
Deployment Issue
When you try to deploy this configuration, you may see 7 pods being created because of the replicas setting in the condor-backend deployment is set to 1, and then a new pod is created every time there is a change in the deployment configuration.
However, another reason for this issue is that the configuration does not specify the image for the condor-backend-server container. By default, this will cause the deployment to fail, and then Kubernetes will try to create a new pod to replace the failed one. This process can be repeated multiple times, resulting in multiple pods being created.
To resolve this issue, you should set the image field in the condor-backend-server container to the desired image.