Computer Science
-
Spin Lock vs Mutex vs SemaphoreComputer Science 2023. 9. 18. 16:11
1. 스핀락 2. 뮤텍스 3. 세마포어 4. 스핀락 vs 뮤텍스 5. 이진 세마포어 vs 뮤텍스 스핀락 ( Spin Lock ), 뮤텍스 ( Mutex ), 세마포어 ( Semaphor ) 이 셋의 공통점은 동시성 프로그래밍에서 사용되는 동기화 기술이라는 것이다. 동시성 프로그래밍 ( Concurrency Programming ) 여러 스레드 혹은 프로세스로 작업을 처리하는 것으로 쉽게 말해 동시에 여러 작업을 처리하는 것이다. 동기화 ( Synchronization ) 여러 스레드 또는 프로세스 간의 작업 순서를 조절하고, 공유 자원에 대한 안전한 접근을 보장한다. 임계 영역 ( Critical Section ) 동시성 프로그래밍에서 상호 배제를 적용하는 영역이다. 이 영역은 한 번에 하나의 스레드 또..
-
TSC vs BabelComputer Science/TypeScript 2023. 9. 15. 16:18
1. TypeScript 란 2. tsc 란 3. Babel 이란 4. tsc vs babel 5. tsc 사용법 6. babel 사용법 TypeScript란 TypeScript는 JavaScript의 Superset으로 기존 JavaScript문법에서 정적 타입 시스템을 추가한 것으로 코드의 안정성과 가독성을 향상시킨다. 다면 결과적으로 실행되는 코드는 JavaScript이기에 TypeScript 문법에서 JavaScript문법으로 변환되는 과정이 필요하다. 이 과정에서 크게 2가지가 사용 되는데 tsc와 @babel/preset-typescript 이다. TSC 란 tsc는 TypeScript를 JavaScript로 변환시키는 명령어로 TypeScript Compiler 라고 할 수 있다. 현재 ts..
-
[k8s] TailScale subnet router 적용하기Computer Science/k8s 2023. 8. 24. 21:25
1. TailScale Auth key 생성 2. k8s Secret 생성 3. k8s Role 생성 4. k8s Deployment ( subnet router ) 생성 5. TailScale 연동 및 설정 1. TailScale Auth key 생성 Auth key를 생성해준다. 2. k8s Secret 생성 #tailscale-secret.yaml apiVersion: v1 kind: Secret metadata: name: tailscale-secret stringData: TS_AUTH_KEY: tskey-auth-###### 3. k8s Role 생성 # Copyright (c) 2022 Tailscale Inc & AUTHORS All rights reserved. # Use of this ..
-
Iptables을 이용한 다른 IP로 포트포워딩Computer Science 2023. 8. 24. 20:26
해당 인스턴스에서 a port로 들어오는 트래픽을 b ip 의 c port로 포트포워딩하려고 합니다. 1. 인스턴스에서 네트워크 포트포워딩을 활성화 합니다. sudo sysctl -w net.ipv4.ip_forward=1 2. iptables 규칙 설정 sudo iptables -t nat -A PREROUTING -p tcp --dport [a port] -j DNAT --to-destination [b IP]:[c port] sudo iptables -t nat -A POSTROUTING -j MASQUERADE 아래의 명령어로 잘 적용되었나 확인할 수 있습니다. sudo iptables -t nat -L --line-numbers
-
Prometheus + Grafana 로 k8s 모니터링 하기Computer Science/Monitoring 2023. 8. 15. 05:02
1. Prometheus 설치 2. Grafana 설치 3. Grafana와 Prometheus 연동하기 1. Prometheus 설치 https://github.com/prometheus-community/helm-charts GitHub - prometheus-community/helm-charts: Prometheus community Helm charts Prometheus community Helm charts. Contribute to prometheus-community/helm-charts development by creating an account on GitHub. github.com 우선 monitoring namespace에서 진행하려고 하기에 namespace를 생성해준다. ku..
-
EFS를 pv, pvc로 k8s 환경에서 사용하기 ( NFS )Computer Science/k8s 2023. 8. 15. 02:12
1. EFS 생성 및 구성 1.1 DNS 호스트 이름 활성화 1.2 NFS 사용가능 여부 확인 1.3 EFS 생성 2. k8s 환경에 pv, pvc 구성 1. EFS 생성 및 구성 1.1 DNS 호스트 이름 활성화 우선 EFS 를 생성하기 전에 내가 사용할 vpc에서 DNS 호스트 이름이 활성화 되었는지 확인한다. 만약 활성화되어 있지 않다면 해당 "VPC 설정 편집" 을 통해서 활성화 해준다. 1.2 NFS 사용가능 여부 확인 https://docs.aws.amazon.com/ko_kr/efs/latest/ug/mounting-fs-old.html EFS 마운트 도우미 없이 파일 시스템 마운트하기 - Amazon Elastic File System Amazon EC2 인스턴스를 시작할 때 Amazon ..
-
GitHub Action, ECR 과 ArgoCD를 이용하여 CI/CD 구축하기 ( k8s )Computer Science/k8s 2023. 8. 15. 01:15
1. GitHub Action을 이용하여 이미지를 빌드하고 ECR에 배포하기 1.1 Public ECR Repository 1.2 Private ECR Repository 2. ArgoCD 설치 및 배포 3. helm 파일 제작 및 GitHub Action으로 변경하기 전체 ci/cd 구조 1. GitHub Action을 이용하여 이미지를 빌드하고 ECR에 배포하기. 1.1 Public Repository Public Repository를 이용한다면 빌드하고 ECR에 배포할 때만 AWS 권한이 필요하다. AmazonElasticContainerRegistryPublicFullAccess 권한이 있는 IAM을 생성하여 GitHub Action에 Secret으로 등록해주자. GitHub Action yaml..
-
ArgoCD 설치 및 설정Computer Science/Argo 2023. 8. 15. 00:38
1. ArgoCD 설치 2. ArgoCD 설정 1. ArgoCD 설치하기 https://argo-cd.readthedocs.io/en/stable/getting_started/ Getting Started - Argo CD - Declarative GitOps CD for Kubernetes Getting Started Tip This guide assumes you have a grounding in the tools that Argo CD is based on. Please read understanding the basics to learn about these tools. Requirements Installed kubectl command-line tool. Have a kubeconfig fi..