Zero to Hero
k8s commands 04
Programming 2021. 10. 31. 12:00

kubectl get pods --selector env=dev kubectl get pods --selector bu=finance kubectl get all kubectl get all --selector env=prod kubectl get pods --selector env=prod,bu=finance,tier=frontend kubectl taint nodes NODE_NAME key=value:TAINT_EFFECT kubectl taint nodes node1 app=blue:NoSchedule kubectl describe node kubemaster | grep Taint kubectl get nodes kubectl describe node node01 | grep Taints kub..

k8s commands 03
Programming 2021. 10. 26. 23:20

kubectl run nginx-pod --image=nginx:alpine kubectl run redis --image=redis:alpine --dry-run=client -o=yaml > redis-pod.yaml kubectl expose pod redis --port=6379 --name redis-service kubectl create deployment webapp --image=nginx --replicas=3 kubectl run custom-nginx --image=nginx --port=8080 kubectl create deployment redis-deploy --image redis --namespace dev-ns --replicas=2 kubectl run httpd --..

k8s commands 02
Programming 2021. 10. 25. 14:00

kubectl get namespaces kubectl get pods --namespace=NAMESPACE_NAME kubectl run POD_NAME --image=IMAGE_NAME --namespace=NAMESPACE_NAME kubectl delete pod POD_NAME --namespace=NAMESPACE_NAME kubectl get pods --all-namespaces kubectl -n dev get svc db-service.dev.svc.cluster.local kubectl expose deployment nginx --port 80 Imperative kubectl edit deployment nginx kubectl replace -f nginx.yaml (apply..

k8s commands 01
Programming 2021. 10. 23. 18:35

kubectl get pods kubectl run POD_NAME --image=IMAGE_NAME kubectl get pods -o wide kubectl describe pod POD_NAME | grep image kubectl delete pod POD_NAME kubectl run POD_NAME --image=IMAGE_NAME --dry-run=client -o yaml > pod-definition.yaml kubectl apply -f application.yaml kubectl edit pod POD_NAME kubectl get replicaset kubectl get rs kubectl create -f replicaset-definition-1.yaml kubectl delet..

article thumbnail
Spring Batch Test 클래스 설정 방법
Programming 2021. 10. 7. 22:39

서론 Spring Batch를 사용해본 경험이 없었다. 최근에 간단한 배치 잡(Batch Job)을 개발하게 되었다. 간단한 배치 잡 코드를 작성 후 테스트 코드를 통해 검증을 하려고 해 보았는데, 설정해주는 과정에서 배우고 삽질한 내용을 공유한다. spring-batch-test 의존성은 최신 버전으로 진행했다. 의존성 추가 https://mvnrepository.com/artifact/org.springframework.batch/spring-batch-test Spring Boot로 시작했다면 starter-test 의존성은 있을 거고, spring-batch-test 의존성을 따로 추가해준다. 이 의존성 추가로 @SpringBatchTest 어노테이션 및 배치 잡 테스트에 사용되는 Util 클래스..

article thumbnail
PageableExecutionUtils.getPage()
Programming 2021. 8. 28. 19:14

PageableExecutionUtils (Spring Data Core 2.5.4 API) docs.spring.io PageableExecutionUtils는 Spring Data 모듈에 있는 추상 클래스다. 이 클래스에는 getPage()라는 메서드만이 있고, 웹 서비스에서 빈번히 제공해야 하는 Paging 기능을 제공한다. public static Page getPage(List content, Pageable pageable, LongSupplier totalSupplier) 메서드를 보면 3개의 인자를 받는다. content는 실제 page에 담길 데이터를 뜻한다. pageable은 paging 관련된 정보를 닮고 있는 Pageable 객체를 의미한다. totalSupplier는 내가 호출하는..