본문 바로가기

kubernetes31

ksniff 로 kubernetes 컨테이너 패킷 캡쳐 일반적으로 파드 내부의 컨테이너로 들어오고 나가는 네트워크 패킷은 확인할 일은 많지 않지만, 간혹 트러블 슈팅 목적으로 HTTP 헤더 등 패킷 상의 Raw 데이터를 직접 확인하고자 하는 경우 컨테이너 안에서 패킷 캡쳐를 하고 싶을 때가 있습니다. ksniff 는 kubectl CLI의 플러그인 중 하나로, 파드 내부에 tcpdump 를 실행하여 로컬 랩탑의 wireshark 로 패킷 덤프를 전달해줍니다. root 로 실행되는 컨테이너는 바로 파드 내부에서 tcpdump 를 실행하며, 일반 사용자로 실행되는 컨테이너는 -p 옵션을 부여하여 별도의 파드가 실행되어 대상 컨테이너의 패킷을 전달해줍니다. (아래 커맨드는 Mac OS를 기준으로 작성되었습니다.) # ksniff 설치 kubectl krew ins.. 2024. 4. 6.
how to install knative and create service knative official docs https://knative.dev/docs/ Migrating a Cloud Run for Anthos service to Knative https://cloud.google.com/anthos/run/docs/migrate/knative # install knative cli https://knative.dev/docs/client/install-kn/#install-the-knative-cli brew install knative/client/kn kn version # install knative operator check latest release https://github.com/knative/operator/releases kubectl apply -f.. 2023. 10. 30.
kube API server and kubernetes python client Although I briefly covered this in the previous post, I would like to think again about how to access the kube API server and Kubernetes, and briefly record how to interact with the Kubernetes cluster using python. 1. kube API server As described in the k8s official documentation, the core of the various components of the control plane that makes up Kubernetes is the kube API server. It is a com.. 2023. 8. 13.
workload identity federation with k8s cluster This post covers how to use Kubernetes as an OIDC provider role to use GCP's workload identity federation service by delegating an IAM role without a json key for your GCP service account. It can be used when an application running on a Kubernetes cluster in a non-GCP environment wants to access GCP's services, or when an application running on a server in a non-GCP environment wants to access G.. 2023. 7. 2.
GKE workload identity # Grant gcp permissions to pods using workload identity -> Rather than granting a gcp service account to individual nodes or the entire cluster, a k8s service account is created, and the k8s service account is set to assume the gcp service account role, thereby granting gcp specific service permissions only to the pod. https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity?hl=k.. 2023. 7. 1.
kops k8s 클러스터 관리도구 Kops로 k8s 설치하기 https://kubernetes.io/ko/docs/setup/production-environment/tools/kops/ Kops를 사용하여 AWS에서 Kubernetes 클러스터 관리 https://aws.amazon.com/blogs/compute/kubernetes-clusters-aws-kops/ GitHub kubernetes/kops https://github.com/kubernetes/kops 공식 가이드 https://kops.sigs.k8s.io/getting_started/install/kops 설치 curl -Lo kops https://github.com/kubernetes/kops/releases/download/$(curl -s https://ap.. 2023. 4. 10.
k3s 공식 사이트 https://docs.k3s.io/ k3s 는 rancher 에서 만든 경량화된 kubernetes # 마스터 노드 설치 curl -sfL https://get.k3s.io | sh - systemctl status k3s kubectl get node kubectl get all --all-namespaces # 워커 노드 조인 마스터 노드에서 토큰 확인 cat /var/lib/rancher/k3s/server/node-token curl -sfL https://get.k3s.io | K3S_URL=https://myserver:6443 K3S_TOKEN=mynodetoken sh - 워커 노드에 고유한 호스트네임이 없는 경우 K3S_NODE_NAME 변수 추가 전달 # 배포 및 서비스 .. 2023. 4. 10.
kubernetes 에서 argocd 자동 배포 환경 구성 쿠버네티스 관련 학습을 하다 유용한 CD(지속적인 배포)도구를 알게 되어 공유하고자합니다. 1. argocd 란 argocd 는 쿠버네티스용 CD 도구로 GitOps 방법론의 특성을 가지고 있습니다. GitOps 란 배포와 관련된 모든 구성 요소를 Git을 통해 코드로 관리한다는 의미를 가지고 있습니다. 이러한 GitOps 는 크게 1) 선언형 모델과 2) SSOT(single source of truth, 단일 진실 공급원)의 특징을 가집니다. 1) 선언형 모델 모든 구성 요소가 명령형 모델이 아닌 선언형 모델을 따릅니다. 여기서 명령형 모델이란 어떤 행위를 정의하는 것이라면, 선언형 모델은 어떤 상태를 정의하는 것입니다. 예를 들어 명령형 모델이 "웹 서버 컨테이너 2개를 생성해라"라면, 선언형 모델.. 2023. 3. 13.
k8s HA 구성과 kubespray를 통한 클러스터 배포 지난 학습 자료를 통해 도커와 쿠버네티스, 그리고 관리형 쿠버네티스 서비스인 AWS EKS 등에 대해 알아보았습니다. 또 업로드해드린 자료를 통해 직접 쿠버네티스 클러스터를 구성해보신 분들도 계셨는데요. 지난 자료에 업로드해드린 쿠버네티스 클러스터는 모두 클러스터를 생성하는 가장 기본적인 방법인 kubeadm을 통한 방법이었습니다. 아래는 쿠버네티스의 컴포넌트 구성도인데요. 기억이 나실지 모르겠습니다. 이 구성도에서는 하나의 마스터노드와 3개의 워커노드로 구성된 클러스터의 모습 보여주고 있는데요. (현재는 마스터노드/워커노드라는 용어보다 컨트롤플레인/데이터플레인이라는 용어를 사용하는데, 마스터노드/워커노드라는 용어가 더 직관적이라고 생각해서 용어는 그대로 통일해서 마스터노드/워커노드로 표현하겠습니다) 하.. 2023. 3. 12.
반응형