Closed junha-ahn closed 1 year ago
codespace (postCreateCommand)를 제 개인 ubuntu machine으로 써서 테스트 해보겠습니다. codespace를 이용하면 무료 ubuntu machine이 빠르게 on/off가 가능하네요
완료
https://www.skyer9.pe.kr/wordpress/?p=6630
마스터와 워커 노드에 k8s를 각각 설치를 해야한다.
다만 해당 설치는 오래걸리니까, worker AMI 이미지를 만들어놓고 복제 떠서 EC2 worker를 생성한다.
위 설명된 불편함 관련
scale up 관련
plugin 관련
EKS의 단점 : 좀 비싸다
https://github.com/junha-ahn/kotlin-boot-deployment/tree/main/terraform
NO_PUBKEY (solved)
Connection Refused
Node NotReady
해결책
모든 이슈가 우분투 버전과 맞지 않은 설치 메뉴얼을 실행한 것
오랜만에 하니 설치방법을 정확하게 찾아야 한다는걸 ... 그냥 편한 한국어 글로 찾아버렸음
기존 설치방법에서 ubuntu 22.x 에 맞는 설치방법으로 변경
As we can see nodes status is ‘NotReady’, so to make it active. We must install CNI (Container Network Interface) or network add-on plugins like Calico, Flannel and Weave-net.
OS에 맞는 설치방법 적용 후 해결
curl <public-ip>:80
접속 가능화 (kube service 등)# service.yaml
apiVersion: v1
kind: Service
metadata:
name: kotlin-app-service
spec:
type: NodePort
ports:
- port: 80
targetPort: 8080
protocol: TCP
nodePort: 30001
selector:
app: kotlin-app
resource "aws_security_group_rule" "cicd_sg_ingress_nodeport" {
type = "ingress"
from_port = 30001
to_port = 30001
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.cicd_sg.id
}
외부PC $ curl <master-public-ip>:30001
Hello world~~
80 포트에 띄우진 않았으나, 성공으로 간주 (어차피 실제 환경에서는 LB 등을 사용할 예정)
Todo
학습 자료
EKS를 사용해서 어플리케이션 서비스 하기를 활용하여
$ kubectl port-forward simon-sample-5f8bf6796-qp8md 8080:8080
Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080
Handling connection for 8080
➜ /workspaces/kotlin-boot-deployment (main) $ curl 127.0.0.1:8080
Hello world!!~
ALB 를 붙어야 Public Endpoint로 접속 가능하나 미구현
eks-blueprints-example-argocd를 활용하여 구성
ArgoCD 화면
LB DNS name 을 통해 접속
LB 정보
지금 해야하는 것
=> 2번으로 접근하기.
https://developer.hashicorp.com/terraform/tutorials/kubernetes/helm-provider https://helm.sh/docs/chart_template_guide/ https://opensource.com/article/20/5/helm-charts
학습 레퍼런스 추천
참고로 제가 위에서 완성한건 terraform-eks-blueprint라고 하는 라이브러리(?)를 사용해서 완성
Description
배포를 위한 최소 환경 세팅 (학습)
To do
학습 시나리오 1
Test Checklist
curl x.x.x.x:port
(public IP) 를 통해 "Hello World"가 출력되어야 합니다.학습 시나리오2
Finally
Tech Stack