묻고 답해요
156만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결대세는 쿠버네티스 (Helm편)
K8s 에서 Service, Pod, Container 의 Port 매핑 질문
안녕하세요 강사님. Helm 강의이긴 하지만 K8s 도 전문적으로 가르치시는 걸로 알고 있어서, K8s 질문을 조금 하게 되었습니다 (정말 주변에 물어볼 사람이 없어서..). Helm 질문이 아니라서 답변해주시기 어려우시다면 이해하겠습니다 ㅠ 기본기적인 질문인데, Service 가 Pod 내 Container 에게 어떻게 통신을 하는지 갑자기 이해가 조금 안됩니다. 다음과 같은 시나리오 두가지가 있다고 해보겠습니다. 1. Pod 내 단일 컨테이너,Service -> spec.ports.targetPort 에 1000 포트로 통신을 전달하도록 설정되어 있음"Service 는 selector 로 어떤 Pod 에게 보내야할지는 이미 알고 있고, Pod 내 targetPort 로 요청을 전달한다" 라고 이해하고 있습니다. Pod -> spec.containers.ports.containerPort 에 2000번 포트를 점유하도록 설정되어 있음>> 이런 시나리오인 경우에도, K8s 는 통신을 정상적으로 앱에 전달하는 것으로 이해하고 있습니다. containerPort 는 사실 큰 역할을 하지 않고, 실제 container 내부 Application 이 1000 포트에 런닝 중이면 된다고 생각했습니다. ( Spring 경우 application.properties 내의 server.port=1000)>> 결론부터 말씀드리면 이게 "왜 가능한지?" 가 궁금합니다. 2. Pod 내 멀티 컨테이너, Service -> 위와 동일Pod -> spec.containers 내부에 1000번 포트, 2000번 포트에 점유하는 두개의 컨테이너를 정의함 (각각 다른 앱)(물론 권장하는 상황은 아님)>> 이런 시나리오인 경우, 해당 Service 에 요청하면 containerPort:2000 인 컨테이너에게 요청을 전달하고, 해당 컨테이너에 점유중인 앱이 통신을 수신하는 것으로 이해했습니다. >> 그럼 지금 1번 시나리오랑 다른 점인데, 멀티 컨테이너와 단일 컨테이너를 사용하는 Pod 간에는 어떤 차이가 존재하는건지 알 수 있을까요?>> 그리고 이런 경우에는 1번 시나리오에서 제가 이해한 컨테이너 내부 App Port 는 어떻게 아는지? 가 궁금합니다 만약 service 내부 containerPort 가 Pod 내 컨테이너가 점유중인 port 가 아닌, container 내부의 App Port 라면, Service 는 "Selector 를 통해 어떤 Pod 로 보내야 하는지 알 뿐 아니라 어떤 Container 로 보내야 하는지도 알고있다" 가 되는데, 이건 아닌 것 같았습니다. 혹시 어렵지 않으시다면, 제가 기본기가 좀 모자라서, 도움 한번만 주시면 정말 감사할 것 같습니다.
-
해결됨Flutter 응용 - 공공 API를 활용한 앱 만들기 (MVVM 패턴)
기존 코드 mvvm으로 역할 분리하는 기준이 궁금합니다
강의를 통해 학습에 정말 많은 도움을 받고 있습니다. 감사합니다. 처음부터 구조를 잘 잡아서 설계하면 좋겠지만, 역할이 제대로 명시되지 않은 함수들을 각각 repository, service, viewmodel로 역할을 명시해주는 것도 난이도가 있으면서 함수들의 역할을 더 명확히 파악하는 데 도움이 될 것 같아서 파일 하나에 함수를 몰아 놓고 분리해보고 있습니다.혹시 repository, service, viewmodel로 함수를 분리해서 작성할 때, 명확한 기준이 존재할까요??제가 학습한 바로는 repository는 데이터베이스/서버 통신 또는 데이터 불러오기 관련, service는 repository를 활용한 비즈니스 로직, Viewmodel은 service를 활용한 View와의 상호작용이라고 알고 있습니다.제가 아직 비즈니스 로직을 명확하게 구분하기기 어렵습니다..에를 들면 파일 탐색기 실행 > 파일 경로 받기 > 파일 디코딩 > JSON(map)형식 변환 > 데이터 필터링 의 과정이 있다고 가정하면, 여기서 어디까지의 함수를 어디로 분리할 지 감이 오지 않습니다.명확하게 구분할 수 있는 기준이나 팁이 존재한다면 알고 싶습니다!
-
미해결
Expert Assignment Writing Service for Academic Success
In the fast-paced world of academia, students often find themselves juggling multiple assignments, coursework, and exams. This academic pressure can be overwhelming, leaving little time for students to focus on their personal lives or extracurricular activities. Fortunately, expert assignment writing service have emerged to provide much-needed assistance to students seeking to achieve academic success without compromising their well-being. In this article, we will explore the world of expert assignment writing service, shedding light on how they work, their benefits, and the factors to consider when choosing one.Understanding the Need for Expert Assignment Writing ServiceThe Academic Struggles of StudentsMany students struggle with the demands of their academic workload. From essays and research papers to complex projects and dissertations, the pressure to excel in every subject can take a toll on their mental and physical health.Time ConstraintsModern students often have to balance their studies with part-time jobs, internships, and other responsibilities. This leaves them with limited time to dedicate to each assignment, compromising the quality of their work.Language BarriersFor international students, language barriers can be a significant obstacle. Writing assignments in a language that is not their first can lead to misunderstandings and lower grades.How Expert Assignment Writing Service WorkChoosing the Right ServiceWhen seeking help from an expert assignment writing service, it's essential to select a reputable and trustworthy provider. Research and read reviews to ensure they have a track record of delivering high-quality work.Placing an OrderOnce you've chosen a service, you'll need to provide details about your assignment, including the topic, deadline, and specific requirements. The more information you provide, the better the final result will be.Assignment CompletionAfter placing your order, a qualified writer with expertise in your subject will be assigned to your task. They will work diligently to create a well-researched and original assignment that meets your criteria.Benefits of Expert Assignment Writing ServiceHigh-Quality WorkExpert assignment writers are well-versed in their respective fields, ensuring that the work they produce is of top-notch quality. This can lead to improved grades and a better understanding of the subject matter.Time SavingsBy delegating assignments to professionals, students can free up their time to focus on other academic tasks or personal activities. This balance can lead to reduced stress and increased overall well-being.Plagiarism-Free ContentReputable assignment writing service guarantee plagiarism-free content. This ensures that the work is original and will not result in any academic misconduct issues.Factors to Consider When Choosing an Assignment Writing ServiceReputation and ReviewsResearch the reputation of the assignment writing service by reading reviews from past clients. Look for positive feedback and a history of delivering assignments on time.Pricing and AffordabilityConsider your budget when choosing a service. While it's essential to find an affordable option, be wary of services that offer unrealistically low prices, as they may compromise on quality.Customer SupportPrompt and effective customer support is crucial. Choose a service that offers 24/7 support to address any concerns or revisions you may need.ConclusionExpert assignment writing service plays a vital role in supporting students on their academic journey. They offer a lifeline for those facing overwhelming workloads, time constraints, or language barriers. By choosing a reputable service, students can access high-quality, plagiarism-free work that can significantly impact their academic success.
-
미해결장고 설계철학으로 시작하는 파이썬 장고 입문
장고에서의 비즈니스로직 관리에 대하여 (서비스)
안녕하세요 강사님. 스프링과 장고의 샘플코드 비교해주신 부분에서 질문이 있어서 남겨봅니다. 샘플코드를 보았을 때, 장고 코드에서는 뷰에서만 서비스의 일부 기능을 담당한다고 되어있는데요. 만약 비즈니스 로직이 커질 경우, 서비스와 컨트롤러가 나뉘어져있는 스프링쪽이 좀더 관리가 용이할 수 있을거 같다는 생각이 들었습니다. 비즈니스 로직이 비대해졌을 때 장고에서는 일반적으로 이 코드를 어디서 관리하는지 질문 드리고 싶습니다. 기존의 컨트롤러와 엔티티로서의 기능을 담당하고 있는 View와 Model로 분산해서 로직을 작성하게 될까요?? 아니면 별도로 service.py같은 파일을 생성해서 관리를 하는게 좋을까요? 강사님 의견이 궁금합니다.
-
미해결대세는 쿠버네티스 (초급~중급편)
service에서 curl 사용시 Failed to connect
안녕하세요 service의 실습강의를 수강중에 curl 오류가 생겨서 글을 남깁니다. 실습자료에 있는 pod와 service를 작성 후 kubectl create로 pod와 service를 생성했습니다.그 후 kubectl get all 명령어로 클러스터IP를 알아냈습니다. curl 10.233.21.38:9000/hostname 을 입력했습니다. 그런데 curl: (7) Failed to connect to 10.233.21.38 port 9000: Connection refused 라는 오류메세지가 발생하는데 혹시 해결방법에 대해 알 수 있을까요?
-
해결됨실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
service와 controller의 역할에 대한 질문이 있습니다.
=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예)[질문 내용]service와 controller의 역할에 대한 질문이 있습니다. 강의를 듣고 활용해던 도중 의문점이 생겼습니다. 한참 찾아봤는데 아직도 모르겠어서 질문드립니다. 저의 기존 코드에서는 어떤 컨트롤러의 post 요청에서 A,B,C 엔티티가 반드시 순서대로 생성된후 저장되어야 합니다. (참조관계 떄문에 그렇습니다) 기존에 저는 컨트롤러에서 A 엔티티 생성 -> AService.createA() 한 후 B, C도 동일한 과정을 거칩니다. 이러니까 컨트롤러가 서비스의 역할을 해버린다고 생각했습니다. 그래서 컨트롤러는 그냥 dto를 넘겨주고 서비스에서 위의 작업을 하려했습니다. 그랬더니 몇가지 문제가 생겼습니다. 1. service에서 repository만을 사용하면 코드 중복이 심함(create 할때 복잡한 중복검증 로직이 있는대, 그것까지 전부 다시 해야함) 2. service에서 service를 주입받아서 하자니 순환참조, 나말고 코드 이해도 낮은 다른사람이 손대면 실수할 가능성 높음 등등의 문제가 생김 그래서 그냥 원래대로 냅두려니 controller가 너무 크고 service가 하는게 그냥 repository로 요청 보내기인 경우가 대부분임 그래서 질문은 1. 적절한 방법이 뭘까요? 2. 복잡하고 큰 규모의 서버 코드를 보고싶은데 좋은 예시를 어디서 찾을수 있을까요? 3. 제가 해결방법으로 여러 service를 주입받아서 사용만하는 service를 만들어서 컨트롤러에 있던 코드를 거기로 옮겨서 컨트롤러에 비즈니스 로직이 생기는걸 없에고 순환참조, 코드 중복 등을 제거 해봤는데 이게 맞는건가요? 4. MSA와 상관있는 문제일까요?
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
MemberServiceTest에서 findOne에 대한 질문
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? 예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예3. 질문 잘하기 메뉴얼을 읽어보셨나요? 어디있나요?[질문 내용]MemberServiceTest의 회원가입()에서findOne을 할 때 Service의 findOne이 아닌 Repository의 findOne을 사용하는 이유가 궁금합니다.
-
미해결모든 개발자를 위한 HTTP 웹 기본 지식
안녕하세요 이 코드는 잘못된건가요?
RestController 가 있습니다 @PostMapping("/request") public ResponseEntity<> save(someDto dto) throws UnsupportedEncodingException, Exception { if(isAdmin()){ return new ResponseEntity<>( 어드민이 아닙니다,HttpStatus.BAD_REQUEST); } try { AService.save(dto.toEntity()); // 주문 생성 BService.createEstimate(dto.toEntity()); // 견적 생성 } catch (Exception e) { return new ResponseEntity<>(저장이 안되었다는 메세지,HttpStatus.BAD_REQUEST); } return new ResponseEntity<>(저장이 되었다는 메세지,HttpStatus.OK); } AService입니다 @Transactional(rollbackFor = {Exception.class}) public void save(Entity entity) throws Exception{ entityRepo.save(entity); } BService입니다 @Transactional(rollbackFor = {Exception.class}) public void createEstimate(Entity entity) throws Exception { entityRepo.save(entity); } 위와 같이 rest controller에도 throw exception과 동시에 저장,견적 을 생성하는 서비스를 각각 호출합니다.(서로 다른 클래스) 그런데 그 서비스에도 다 throw exception을 하고 있습니다. 어노테이션으로 Transactional(rollbackFor exception)을 하고 있고요. 위와 같이 코드를 작성하는 방법은 틀린것인가요?
-
미해결데브옵스(DevOps)를 위한 쿠버네티스 마스터
안녕하세요! service 실습진행중 Endpoint 관련 질문사항
service 실습과정중 위 강습은 GCP에서 진행하였지만, AWS cloud 9 을 이용하여 EKS를 이용하여 실습을 진행하였습니다. 아래 yaml파일 작성을 동일하게하여 배포를하였는데 EndPoint가 None으로 나오게 됩니다. 혹시 따로 설정을 해줘야하거나, 설정을 하려면 어떻게 해야할까요? 감사합니다.