일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- livenessPorbe
- Kubernetes
- Prometheus install
- 쿠버네티스 컴포넌트
- 그라파나 대시보드
- 로드밸런서 컨트롤러
- github action 사용법
- Solution Architecture
- 깃허브 액션
- 딥레이서
- grafana on kubernetes
- SAA 합격 후기
- Firelens
- 그라파나 시각화
- kubernetes 동작 원리
- 쿠버네티스
- EKS 클러스터
- Aurora cluster
- jenkins
- blue-green
- 딥레이서 보상함수
- Kubernets on Jenkins
- terraform
- helm
- 메탈LB
- LoadBalancer Controller
- EFS CSI Driver
- headless service
- AWS 딥레이서
- 솔데스크
Archives
mingming
kubernetes static Pod 본문
Static Pod
일반적으로 kubectl 명령을 API로 전달해 스케쥴러에 의해 특정 노드의 kubelet 에 의해서 Pod가 생성되지만
Static Pod 는 API 에 요청을 보내지 않습니다. 각 노드의 kubelet이 관리하는 static Pod 디렉터리에 매니페스트 파일을 저장하면 Pod가 생성됩니다.
일반적으로 /etc/kubernetes/manifests/ 디렉터리를 사용합니다. 해당 내용은 /var/lib/kubelet/config.yaml 파일에서 확인할 수 있습니다 .
sudo vim /etc/lib/kubelet/config.yaml
apiVersion: kubelet.config.k8s.io/v1beta1
authentication:
anonymous:
enabled: false
webhook:
cacheTTL: 0s
enabled: true
x509:
clientCAFile: /etc/kubernetes/pki/ca.crt
authorization:
mode: Webhook
webhook:
cacheAuthorizedTTL: 0s
cacheUnauthorizedTTL: 0s
cgroupDriver: systemd
clusterDNS:
- 10.96.0.10
clusterDomain: cluster.local
containerRuntimeEndpoint: ""
cpuManagerReconcilePeriod: 0s
evictionPressureTransitionPeriod: 0s
fileCheckFrequency: 0s
healthzBindAddress: 127.0.0.1
healthzPort: 10248
httpCheckFrequency: 0s
imageMinimumGCAge: 0s
kind: KubeletConfiguration
logging:
flushFrequency: 0
options:
json:
infoBufferSize: "0"
verbosity: 0
memorySwap: {}
nodeStatusReportFrequency: 0s
nodeStatusUpdateFrequency: 0s
resolvConf: /run/systemd/resolve/resolv.conf
rotateCertificates: true
runtimeRequestTimeout: 0s
shutdownGracePeriod: 0s
shutdownGracePeriodCriticalPods: 0s
staticPodPath: /etc/kubernetes/manifests
streamingConnectionIdleTimeout: 0s
syncFrequency: 0s
volumeStatsAggPeriod: 0s
staticPodPath로 이동해줍니다.
cd /etc/kubernetes/manifest
nginx pod 를 생성하는 manifest 파일을 하나 생성해줍니다.
nginx.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
app: env
name: nginx
spec:
containers:
- image: nginx
name: nginx
ports:
- containerPort: 80
nginx pod가 worker1 node에서 동작중인 것을 확인할 수 있습니다 .
해당 manifest file을 삭제하면 생성된 pod가 삭제됩니다.
/var/lib/kubelet/config.yaml 파일의 staticPodPath를 임의의 디렉터리를 지정할 수 있습니다 . 해당 환경변수 파일을 수정한
다면 반드시 kubelet daemon을 재시작해야 합니다.
master 에도 staticPod가 존재합니다 .
etcd, api-server, kube-controller-manager, kube-scheduler 가 staticPod로서 마스터에서 실행중인 것을 볼 수 있습니다.
'kubernetes' 카테고리의 다른 글
Kubernetes Pod Resoure 할당하기 (0) | 2023.08.31 |
---|---|
EKS Prometheus & Grafana (0) | 2023.08.31 |
kubernets Metal LB 설치하기 (0) | 2023.08.30 |
kubernetes init container (0) | 2023.08.29 |
kubernetes livenessProve (1) | 2023.08.27 |