• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    미해결

2024-01-17 pod1 curl 안됨

24.01.17 00:08 작성 조회수 272

1

root@pod-1:/# curl localhost:8000

bash: curl: command not found

root@pod-1:/# apt update && apt install curl

Ign:1 http://deb.debian.org/debian bookworm InRelease

Ign:2 http://deb.debian.org/debian bookworm-updates InRelease

Ign:3 http://deb.debian.org/debian-security bookworm-security InRelease

Ign:1 http://deb.debian.org/debian bookworm InRelease

Ign:2 http://deb.debian.org/debian bookworm-updates InRelease

Ign:3 http://deb.debian.org/debian-security bookworm-security InRelease

Ign:1 http://deb.debian.org/debian bookworm InRelease

Ign:2 http://deb.debian.org/debian bookworm-updates InRelease

Ign:3 http://deb.debian.org/debian-security bookworm-security InRelease

Err:1 http://deb.debian.org/debian bookworm InRelease

Could not connect to deb.debian.org:80 (218.38.137.27), connection timed out

Err:2 http://deb.debian.org/debian bookworm-updates InRelease

Unable to connect to deb.debian.org:80:

Err:3 http://deb.debian.org/debian-security bookworm-security InRelease

Unable to connect to deb.debian.org:80:

Reading package lists... Done

Building dependency tree... Done

Reading state information... Done

All packages are up to date.

W: Failed to fetch http://deb.debian.org/debian/dists/bookworm/InRelease Could not connect to deb.debian.org:80 (218.38.137.27), connection timed out

W: Failed to fetch http://deb.debian.org/debian/dists/bookworm-updates/InRelease Unable to connect to deb.debian.org:80:

W: Failed to fetch http://deb.debian.org/debian-security/dists/bookworm-security/InRelease Unable to connect to deb.debian.org:80:

W: Some index files failed to download. They have been ignored, or old ones used instead.

Reading package lists... Done

Building dependency tree... Done

Reading state information... Done

E: Unable to locate package curl
현재 자료실에 있는 yaml 파일은 curl 이 작동하지 않고 apt install 로 해도 에러가 뜨네요 image 를 init 으로 하면 파드가 안올라가고 해결방법을 잘 모르겠습니다.

답변 2

·

답변을 작성해보세요.

0

안녕하세요.

저도 지금 해봤는데 잘 동작합니다.

image

image

에러 내용을 보니 deb.debian.org에 연결이 안된다고 나오는데, DNS 연결 문제로 보입니다.

현재 실습 환경이 개인 노트북에 공유기를 통해서 외부 인터넷이 잘 되는 상태가 아닐까요?

외부 방화벽 문제가 있을 수 있고요.

Could not connect to deb.debian.org:80 (218.38.137.27), connection timed out

 

강의 실습 내용상 curl을 init 이미지에서 하시면 되는데

init 이미지의 경우 kubetm/init 입니다. 혹시 이미지 이름이 다른지 확인 부탁 드리고요.

안되시는 부분을 작성하신 yaml 파일 내용이랑 에러 상태를 캡쳐로도 올려주시면 좀 더 확인해 보겠습니다.

 

0

인프런 AI 인턴님의 프로필

인프런 AI 인턴

2024.01.17

안녕하세요, 인프런 AI 인턴입니다.

이지수님의 질문에 해당하는 문제와 유사한 상황을 겪은 다른 수강생들의 질문과 이에 대한 답변을 찾았습니다. curl 명령어가 없을 때 이를 설치하기 위해 apt updateapt install curl을 시도했으나 연결에 실패하는 문제점이 보고되었습니다.

유사한 문제를 겪었던 수강생에 대한 답변으로, 이미지명이 kubetm/init인 팟에서 curl 명령을 사용하도록 조언된 바 있습니다. 컨테이너 내 curl 명령어 안됨. (자료실 이미지 이름 다름) 게시물에서 해당 문제에 대한 답변을 참조하실 수 있습니다. 이 답변에 따르면 kubetm/init 이미지에는 curl이 포함되어 있으며 이를 사용할 것을 권장합니다.

또 다른 수강생은 [root@pod-1:/# apt update] 과정에서 404 에러가 발생하는 문제를 경험했는데, 이 과정에서 네트워크 이슈를 의심할 수 있으며, 해당 수강생은 강의에 제시된 구성과 다르게 설정된 것으로 인한 문제였음을 확인하고 수정 예정임을 밝혔습니다. 관련된 답변은 service에서 curl 사용시 Failed to connect 게시물에서 확인할 수 있습니다.

저는 질문자님의 이해를 돕고자 지식공유자님의 기존 답변을 참고하여 유사한 답변 링크를 추천해드리고 있습니다.
현재 베타 기능으로 답변이 만족스럽지 않을 수 있는 점 양해 부탁드립니다. 🙏
추가적으로 궁금한 점이 있으시면, 이어서 질문해 주세요. 곧 지식공유자께서 답변해 주실 것입니다.