Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create container in the pod #4

Open
chautuankien opened this issue Jul 6, 2024 · 1 comment
Open

Cannot create container in the pod #4

chautuankien opened this issue Jul 6, 2024 · 1 comment

Comments

@chautuankien
Copy link

I followed your step, but when i did step 4, it got below error when creating pod

Normal Created 9m17s (x4 over 9m57s) kubelet Created container my-flask-container
Normal Started 9m17s (x4 over 9m57s) kubelet Started container my-flask-container
Normal Pulled 9m17s kubelet Successfully pulled image "590183998641.dkr.ecr.ap-southeast-2.amazonaws.com/my-cloud-native-repo:latest" in 110ms (110ms including waiting). Image size: 167537107 bytes.
Normal Pulling 8m28s (x5 over 9m58s) kubelet Pulling image "590183998641.dkr.ecr.ap-southeast-2.amazonaws.com/my-cloud-native-repo:latest"
Normal Pulled 8m28s kubelet Successfully pulled image "590183998641.dkr.ecr.ap-southeast-2.amazonaws.com/my-cloud-native-repo:latest" in 93ms (93ms including waiting). Image size: 167537107 bytes.
Warning BackOff 4m53s (x25 over 9m56s) kubelet Back-off restarting failed container my-flask-container in pod my-flask-app-8585dd966-tl9ms_default(4f963612-15f5-4167-a1df-c0034479f771)

I ran docker container (step 3) at local, and it executes without issue. Do you have any idea how to fix this error?

@kratagyanamdev
Copy link

use this docker file
FROM python:3.9-slim-buster

WORKDIR /app

COPY requirements.txt .

Increase timeout settings

ENV PIP_DEFAULT_TIMEOUT=100

Use a retry mechanism

RUN pip3 install --no-cache-dir -r requirements.txt ||
pip3 install --no-cache-dir -r requirements.txt ||
pip3 install --no-cache-dir -r requirements.txt

COPY . .

ENV FLASK_RUN_HOST=0.0.0.0

EXPOSE 5000

CMD ["flask", "run"]FROM python:3.9-slim-buster

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants