I was trying to use the netshoot image with Nginx server image on the same pod.
If I do not include sleep argument to netshoot container,
args:
- sleep
- '9999999999999999999'
the pod status always becomes CrashLoopBackOff. I did not figure out why I have to put sleep argument to sleep current thread in netshoot container. Do containers have to consist of application servers or running jars to retain running status? I think I missed the fundamental point about the running mechanism of containers. Thanks.
apiVersion: apps/v1
kind: Deployment
metadata:
# Define the Deployment Name
name: nginx-deployment
labels:
app: nginx
spec:
# Define the Number of Pods
replicas: 1
# Define the Selector
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers: # Container Details
- name: nginx
image: nginx:latest # Image
ports:
- containerPort: 80
- name: netshoot
image: nicolaka/netshoot:latest
args:
- sleep
- '9999999999999999999'