쿠버네티스 오퍼레이터란?

2022. 11. 17. 17:07Dev

728x90

What is an Operator?

Operator는 2016년 CoreOS 블로그 게시물에 공개된 디자인 패턴입니다.

목표는 운영 지식을 소프트웨어에 적용하는 것입니다.

이전에는 Ansible이나 쉘 스크립트, 운영자 개인의 능력으로 관리했습니다.

이는 Kubernetes 클러스터 밖에 있고 통합하기 어려웠습니다.

CoreOS에서는 Operator로 이 문제를 해결했습니다.

 

Operator는 Kubernetes 클러스터 내 소프트웨어에서 실행하는 공통되고 반복되는 Day-1, Day-2 같은 활동을 Kubernetes의 컨셉과 API를 사용해서 구현하고 자동화합니다.

이를 Kuberentes Native Application이라고 합니다.

Operator를 사용하면 Pods, Deployments, Services, ConfigMap 같은 primitives 타입을 쓰지 않고, 필요한 옵션만 지정하는 단일 객체로 애플리케이션을 쓸 수 있습니다.

 

All Operators use the controller pattern, but not all controllers are Operators.
It's only an Operator if it's got: controller pattern + API extension + single-app focus.

 

Operator pattern

Operators are software extensions to Kubernetes that make use of custom resources to manage applications and their components. Operators follow Kubernetes principles, notably the control loop.

Operator는 Custom Resources를 사용하여 애플리케이션과 컴포넌트를 관리하는 Kubernetes의 소프트웨어 익스텐션입니다. Kubernetes가 제공하는 리소스 이외에 사용자가 새롭게 정의한 리소스를 관리해주는 패턴

https://lcom.static.linuxfound.org/sites/lcom/files/kenzan-k8s-1.png
https://lcom.static.linuxfound.org/sites/lcom/files/kenzan-k8s-2.png

 

 

Motivation

The operator pattern aims to capture the key aim of a human operator who is managing a service or set of services. Human operators who look after specific applications and services have deep knowledge of how the system ought to behave, how to deploy it, and how to react if there are problems.

People who run workloads on Kubernetes often like to use automation to take care of repeatable tasks. The operator pattern captures how you can write code to automate a task beyond what Kubernetes itself provides.

→ Kubernetes 자체가 제공하는 것 이상으로 작업을 자동화하는 코드를 작성하는 방법을 가진다.

 

Operators in Kubernetes

Kubernetes is designed for automation. Out of the box, you get lots of built-in automation from the core of Kubernetes. You can use Kubernetes to automate deploying and running workloads, and you can automate how Kubernetes does that.

Kubernetes' operator pattern concept lets you extend the cluster's behaviour without modifying the code of Kubernetes itself by linking controllers to one or more custom resources. Operators are clients of the Kubernetes API that act as controllers for a Custom Resource.

→ Kubernetes 자체 코드를 수정하지 않고도 클러스터의 동작을 확장할 수 있습니다.

Operator는 Custom Resource의 컨트롤러 역할을 하는 Kuberntets API의 클라이언트입니다.

 

An example operator

Some of the things that you can use an operator to automate include:

  • 애플리케이션을 온디맨드로 배포
  • 애플리케이션 상태 백업 수행 및 복원
  • 디비 스키마 또는 추가 구성 설정과 같은 변경 사항과 함께 애플리케이션 코드의 업그레이드 처리
  • Kubernetes API를 지원하지 않는 애플리케이션에 서비스를 게시하여 검색
  • 클러스터 전체 또는 일부 장애를 시뮬레이션하여 복원력 테스트
  • 내부 멤버 선출 프로세스 없이 분산 애플리케이션의 리더 선택
  • https://operatorhub.io/operator/etcd
 

OperatorHub.io | The registry for Kubernetes Operators

 

operatorhub.io

 

OPERATOR CAPABILITY LEVELS

https://operatorframework.io/operator-capabilities/

 

728x90

'Dev' 카테고리의 다른 글

쿠버네티스 스토리지 볼륨 정적 프로비저닝 vs 동적 프로비저닝  (1) 2023.01.11
2022 회고와 2023 목표  (0) 2022.12.29
istio 에러  (0) 2022.06.28
Metaverse 메타버스에 대한 인사이트  (0) 2021.11.04
Helm too slow  (0) 2021.11.01