The Monster Market in shallows-o8sj39 was deployed in a hurry. Four things are wrong. Fix them in any order.
Triage before you change anything:
kubectl get pods,rs -n shallows-o8sj39
kubectl get pods -n shallows-o8sj39 --show-labelsThe Pods
market-web cannot pull its image. describe shows the tag it tried. It should run nginx:1.27. Swap the image in place, or delete and recreate the Pod. A Pod made by kubectl run has one container with the same name as the Pod.
kubectl describe pod market-web -n shallows-o8sj39
kubectl set image pod/market-web market-web=nginx:1.27 -n shallows-o8sj39market-api is in a crash loop. Its logs name what is missing. The real image, stackmonsters/monster-market-api, does not have that problem.
market-db is Running, but the front end finds its database by the label app=market-db, and nobody set it.
The ReplicaSet
market-web-rs wants three web Pods and creates every one of them with a broken image. Fix its template:
kubectl set image rs/market-web-rs web=nginx:1.27 -n shallows-o8sj39A ReplicaSet uses its template only for new Pods. The three broken Pods stay until something removes them. Delete them and the ReplicaSet creates replacements from the fixed template.
If you prefer a manifest, this is the corrected one:
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: market-web-rs
spec:
replicas: 3
selector:
matchLabels:
app: market-web-rs
template:
metadata:
labels:
app: market-web-rs
spec:
containers:
- name: web
image: nginx:1.27The last objective is a question: which kind of controller created the Pods with random suffixes?