본문 바로가기

kubernetes31

istio traffic management istio traffic management # 이미 구성된 환경 gke 클러스터 asm(istio 도 무관) bookinfo 샘플 앱(gateway, virtualservice 포함) # destination rule 생성 -> 룰은 목적지에 대한 라우팅 룰일뿐 실제 라우팅을 정의하는 것을 virtualservice 리소스 kubectl apply -f https://raw.githubusercontent.com/istio/istio/master/samples/bookinfo/networking/destination-rule-all.yaml kubectl get destinationrules kubectl get destinationrules -o yaml apiVersion: networking.is.. 2023. 3. 10.
k8s network policy network policy k8s network policy 가이드 https://kubernetes.io/ko/docs/concepts/services-networking/network-policies/ gke network plicy 가이드 https://cloud.google.com/kubernetes-engine/docs/tutorials/network-policy?hl=ko # 정책 예제 "kubernetes.io/metadata.name: privacy" 레이블을 가진 네임스페이스의 "app: privacy" 레이블을 가진 파드 -> my-flask-app 네임스페이스의 "app: my-flask-app" 레이블을 가진 파드로 액세스 가능하도록 설정 -> 해당 파드에 적용되면서 policyTy.. 2023. 3. 10.
ingress-nginx ingress-nginx https://kubernetes.github.io/ingress-nginx/ # ingress 외부에서 내부로 들어오는 트래픽을 처리하는 클러스터의 진입점으로 ingress 를 통해 외부에서 들어온 트래픽은 해당 서비스의 cluster ip 를 통해 로드밸런싱됨 ingress-nginx 는 여러 네임스페이스에 걸친 서비스를 등록 가능 (alb 하나로 하나의 네임스페이스에 있는 서비스만 등록 가능한 alb ingress controller 와 다른 부분) ingress 오브젝트 서비스 설정 yaml 파일의 예시 cat bootcamp-ingress.yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingres.. 2023. 3. 10.
argo-workflow argo-workflow argo 프로젝트의 workflow 관리 도구 https://argoproj.github.io/argo-workflows/ # argo workflow 배포 퀵스타트 https://argoproj.github.io/argo-workflows/quick-start/ 최신 릴리즈 및 배포 커맨드 https://github.com/argoproj/argo-workflows/releases/latest -> 릴리즈마다 매니페스트 경로가 다르니 릴리즈 페이지에서 배포 커맨드 확인 kubectl create namespace argo kubectl apply -n argo -f https://github.com/argoproj/argo-workflows/releases/download/v3.. 2023. 3. 10.
secret 으로 값 전달 secret 으로 값 전달 https://kubernetes.io/ko/docs/concepts/configuration/secret/ # secret 을 파드에 파일로 사용 apiVersion: v1 kind: Secret metadata: name: mysecret type: Opaque data: username: YWRtaW4= password: MWYyZDFlMmU2N2Rm --- apiVersion: v1 kind: Pod metadata: name: secret-volume-pod spec: containers: - name: mycontainer image: redis volumeMounts: - name: foo mountPath: "/etc/foo" readOnly: true volum.. 2023. 3. 9.
configmap 으로 값 전달 configmap 으로 값 전달 https://kubernetes.io/ko/docs/concepts/configuration/configmap/ # configmap 생성하여 파드의 특정 경로에 마운트 apiVersion: v1 kind: ConfigMap metadata: name: cm-nginx data: default.conf: |+ server { listen 80; listen [::]:80; server_name localhost; #access_log /var/log/nginx/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } #error_page 404 /404.html;.. 2023. 3. 9.
argocd 배포 환경 구성 argocd 배포 환경 구성 argocd 는 Kubernetes 용 선언적 GitOps 지속적 배포 도구 -> git 등의 레포를 자동/수동으로 sync 하여 kubernetes 리소스 배포 공식 사이트 https://argo-cd.readthedocs.io/en/stable/ 공식 가이드 https://github.com/argoproj/argo-cd/blob/master/docs/getting_started.md helm chart github https://github.com/argoproj/argo-helm # 배포 kubectl create namespace argocd kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/.. 2023. 3. 9.
istio envoy access log istio envoy access log # istio 를 설치한 경우 -> istio-system 네임스페이스에 Telemetry 를 생성하는 경우 전역적으로 envoy 액세스 로그가 활성화됨 -> 개별 네임스페이스에 생성하면 해당 네임스페이스만 envoy 액세스 로그가 활성화됨 https://istio.io/latest/docs/tasks/observability/logs/access-log/ vim istio-access-log.yaml apiVersion: telemetry.istio.io/v1alpha1 kind: Telemetry metadata: name: mesh-default namespace: istio-system spec: accessLogging: - providers: - nam.. 2023. 3. 8.
istio 배포 istio 배포 공식 가이드 https://istio.io/latest/docs/setup/getting-started/ # 설치 ## istioctl 로 설치 https://istio.io/latest/docs/setup/install/istioctl/ curl -L https://istio.io/downloadIstio | sh - cd istio-* export PATH=$PWD/bin:$PATH istioctl install --set profile=demo -y 배포된 istio 관련 리소스 확인 kubectl get all -n istio-system 설치된 istio profile 확인 https://istio.io/latest/docs/setup/additional-setup/config-.. 2023. 3. 8.