본문 바로가기

점진적과부하57

[k8s] Canary Deployment Pod를 배포(업데이트)하는 방법 Blue, Green update Canary update Rolling update Canary 배포란? 기존 버전을 유지한 채로 일부 버전만 신규 버전으로 올려서 신규 버전에 버그나 이상은 없는지 확인 definition apiVersion: apps/v1 kind: Deployment metadata: name: mainui-canary spec: replicas: 1 selector: matchLabels: app: mainui version: canary template: metadata: labels: app: mainui version: canary spec: containers: - name: mainui image: nginx:1.15 ports: - c.. 2023. 1. 9.
[K8s] Annotation Annotation이란? Label과 동일하게 key-value를 통해 리소스의 특성을 기록 kubectl describe command로 확인 가능 K8s에게 특정 정보를 전달할 용도로 사용 Deployment의 rolling update 정보 기록 annotations: kubernetes.io/change-cause: version 1.15 관리를 위해 필요한 정보를 기록할 용도로 사용 release, logging, monitoring에 필요한 정보들을 기록 annotations: builder: “intae Yoon (intae.yoon@gmail.com)"" buildDate: “20220609" imageRegistry: definition apiVersion: v1 kind: Pod met.. 2023. 1. 3.
[k8s] Label Label이란? Node를 포함하여 pod, deployment 등 모든 리소스에 할당 리소스의 특성을 분류하고, Selector를 이용해서 선택 Key-value 한 쌍으로 적용 worker node의 특성을 label로 설정하여 node를 선택해서 pod를 배치할 수 있음 Label definition metadata: labels: rel: stable name: mainui Selector definition selector: matchLabels: key: value matchExpressions: - {key: name, operator: In, values: [mainui]} - {key: rel, operator: NotIn, values: ["beta","canary"]} [ Hands .. 2022. 12. 29.
[K8s] Ingress 개념 및 Ingress Controller 설치, 활용 Ingress API란? HTTP나 HTTPS를 통해 클러스터 내부의 서비스를 외부로 노출 기능 Service에 외부 URL을 제공 트래픽을 로드밸런싱 SSL 인증서 처리 Virtural hosting을 지정 Ingress controller 동작 방식 Nginx Ingress controller 설치 Installation Guide - NGINX Ingress Controller 참고 kubectl apply -f 설치 확인 kubectl get pod --namespace ingress-nginx NAME READY STATUS RESTARTS AGE ingress-nginx-admission-create-qxcsn 0/1 Completed 0 99s ingress-nginx-admission-pa.. 2022. 12. 19.
[k8s] Kube-proxy Kube-proxy란? K8s service의 backend를 구현 Endpoint 연결을 위한 iptables 구성 worker node에서 확인 가능 iptables -t nat -S | grep 80 -A KUBE-MARK-DROP -j MARK --set-xmark 0x8000/0x8000 -A KUBE-SEP-HHZALBXPKUQGKXIS -p tcp -m comment --comment "default/clusterip-service" -m tcp -j DNAT --to-destination 192.168.11.73:80 -A KUBE-SEP-KTW4ECSLTAZBS6DP -p tcp -m comment --comment "default/clusterip-service" -m tcp -j DN.. 2022. 12. 12.
[K8s] Headless Service Headless Service란? ClusterIP가 없는 서비스로 단일 진입점이 필요 없을 때 사용 Service와 연결된 pod의 endpoint로 DNS 레코드가 생성됨 (DNS Resolving Service 지원) Pod의 DNS 주소 : pod-ip-addr.namespace.pod.cluster.local definition apiVersion: v1 kind: Service metadata: name: headless-service spec: type: ClusterIP clusterIP: None #clusterIP를 none으로 설정하면 Headless service selector: app: webui ports: - protocol: TCP port: 80 targetPort: 80.. 2022. 12. 6.
[k8s] ExternalName ExternalName이란? cluster 안에서 외부에 접속 시 사용할 도메인을 등록해서 사용 cluster 도메인이 실제 외부 도메인으로 치환되어 동작 definition apiVersion: v1 kind: Service metadata: name: externalname-svc spec: type: ExternalName externalName: google.com [ Hands - on] ExternalName yaml 파일 생성 및 실행 vi external-name.yaml apiVersion: v1 kind: Service metadata: name: externalname-svc spec: type: ExternalName externalName: google.com kubectl cre.. 2022. 11. 28.
[K8s] LoadBalancer (AKS에서 진행) LoadBalancer란? Public cloud (AWS,Azure, GCP 등)에서 운영 가능 LoadBalancer를 자동으로 구성 요청 NodePort를 예약 후 해당 nodeport로 외부 접근 허용 definition apiVersion: v1 kind: Service metadata: name: loadbalancer-service spec: type: LoadBalancer selector: app: webui ports: - protocol: TCP port: 80 targetPort: 80 [ Hands - on ] LoadBalancer yaml 파일 생성 및 실행 vi loadbalancer-nginx.yaml apiVersion: v1 kind: Service metadata: n.. 2022. 11. 21.