[Kubernetes] 쿠버네티스 아키텍처 (API 호출)

zoey·2022년 12월 13일
0

Docker & Kubernetes

목록 보기
5/5
apiVersion: v1
kind: Pod
metadata:
	name: example
spec: 
	containers: 
    - name: busybox
      image: busybox:1.25

API Server가 이 명세를 보고 ectd정보를 저장하고 Controller들이 동작하게 됩니다.


ReplicaSet 생성

apiVersion: apps/v1
kind: ReplicaSet
metadata:
	name: frontend
spec: 
	replicas: 3
    selector:
    	matchLabels: 
        app: frontend
    template: 
    	metadata:
        	labels:
            	app: frontend
        spec:
			containers: 
    		- name: web
      		  image: image:v1

ArgoCD(Custom Resource)

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
	name: guestbook
    namespace: argocd
spec: 
	project: default
    source: 
    	repoURL:
        	https://github.com/arfoproj/argocd-example-apps.git
        targetRevision: HEAD
        path: guestbook
     destination: 
     	server: 
        	https://kubernetes.default.svc
        namespace: guestbook

Object Spec

  • apiVersion
    apps/v1, v1, batch/v1, networking.k8s.io/v1, ...
  • kind
    Pod, Deployment, Service, Ingress, ...
  • metadata
    name, label, namespace, ...
  • spec
    각종 설정
  • status(read-only)
    시스템에서 관리하는 최신 상태

API 호출하기

원하는 상태(desired state)를 다양한 오브젝트(object)로 정의(spec)하고 API 서버에 yaml 형식으로 전달


참고
https://www.youtube.com/watch?v=IOem05grFkU&list=PLIUCBpK1dpsNf1m-2kiosmfn2nXfljQgb&index=8

0개의 댓글