Move file path and Add flink sql gateway document
This commit is contained in:
@@ -0,0 +1,204 @@
|
||||
# Flink Kubernetes Operator 배포
|
||||
|
||||
## 1. 배포 방법
|
||||
- 명령어
|
||||
``` sh
|
||||
$ helm upgrade flink-kubernetes-operator ../flink-kubernetes-operator --install \
|
||||
--namespace flink-operator-system \
|
||||
--create-namespace \
|
||||
-f ./custom-values.yaml
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 2. custom-values.yaml 설명
|
||||
|
||||
- custom-values.yaml에 정의된 값에 대한 설명이다.
|
||||
|
||||
### 1) 이미지 설정
|
||||
- private 환경 배포시 사용한다.
|
||||
|
||||
| Name | 설명 | 기본값 |
|
||||
| ---------------------- | ------------------------------------------------------------ | ------ |
|
||||
| `image.repository` | 오프라인 설치 시에 설정 변경 필요. <br />paasup 설치시에는 "paasup.io/apache/flink-kubernetes-operator"로 설정 | `"ghcr.io/apache/flink-kubernetes-operator"` |
|
||||
| `image.tag` | 이미지의 태그 설정 | `"b40c553"` |
|
||||
| `image.pullPolicy` | 이미지 pull 정책 설정 | `"IfNotPresent"` |
|
||||
| `imagePullSecrets` | private registry 사용시 pull secret 설정 | `[]` |
|
||||
|
||||
|
||||
|
||||
### 2) Operator Pod 설정
|
||||
- operator pod의 수, tolerations, nodeSelector, 리소스 등을 설정한다.
|
||||
|
||||
| Name | 설명 | 기본값 |
|
||||
| ------------------------ | ---------------------------------- | --------- |
|
||||
| `replicas` | operator pod의 replicas 설정. (leader election 미설정시 1개만 가능) | `1` |
|
||||
| `strategy.type` | deployment strategy 설정. (leader election 미설정시 Recreate만 가능) | `"Recreate"` |
|
||||
| `operatorPod.nodeSelector` | operator pod의 nodeSelector 설정. | `{}` |
|
||||
| `operatorPod.affinity` | operator pod의 affinity 설정. | `{}` |
|
||||
| `operatorPod.tolerations` | operator pod의 toleration 설정. | `[]` |
|
||||
| `operatorPod.resources.requests.cpu` | operator pod의 cpu request 설정. | `"100m"` |
|
||||
| `operatorPod.resources.requests.memory` | operator pod의 memory request 설정. | `"256Mi"` |
|
||||
| `operatorPod.resources.limits.cpu` | operator pod의 cpu limits 설정. | `"200m"` |
|
||||
| `operatorPod.resources.limits.memory` | operator pod의 memory limits 설정. | `"512Mi"` |
|
||||
| `operatorPod.webhook.resources.requests.cpu` | webhook container의 cpu request 설정. | `"50m"` |
|
||||
| `operatorPod.webhook.resources.requests.memory` | webhook container의 memory request 설정. | `"128Mi"` |
|
||||
| `operatorPod.webhook.resources.limits.cpu` | webhook container의 cpu limits 설정. | `"100m"` |
|
||||
| `operatorPod.webhook.resources.limits.memory` | webhook container의 memory limits 설정. | `"256Mi"` |
|
||||
|
||||
|
||||
|
||||
### 3) 네임스페이스 감시 설정
|
||||
|
||||
- Flink Kubernetes Operator가 감시할 네임스페이스를 설정한다.
|
||||
|
||||
| Name | 설명 | 기본값 |
|
||||
| --------------------------- | ------------------------------------------------------------ | ----------------------- |
|
||||
| `watchNamespaces` | FlinkDeployment 변경사항을 감시할 네임스페이스 목록. 빈 배열이면 모든 네임스페이스 감시 | `[]` |
|
||||
|
||||
|
||||
|
||||
### 4) Flink 설정
|
||||
|
||||
- Flink Operator에 적용되는 configuration을 작성한다.
|
||||
|
||||
| Name | 설명 | 기본값 |
|
||||
| --------------------------- | ------------------------------------------------------------ | ----------------------- |
|
||||
| `defaultConfiguration.create` | ConfigMap/VolumeMount 생성 여부 | `true` |
|
||||
| `defaultConfiguration.append` | 기본 설정에 추가 설정을 덧붙일지 여부 | `true` |
|
||||
| `defaultConfiguration.flink-conf.yaml` | Flink 설정 오버라이드 | `custom-values.yaml 참조` |
|
||||
| `defaultConfiguration.log4j-operator.properties` | Operator 로깅 설정 | `custom-values.yaml 참조` |
|
||||
| `defaultConfiguration.log4j-console.properties` | Flink 애플리케이션 로깅 설정 | `custom-values.yaml 참조` |
|
||||
|
||||
|
||||
|
||||
### 5) JVM 설정
|
||||
|
||||
- Operator와 Webhook의 JVM 옵션을 설정한다.
|
||||
|
||||
| Name | 설명 | 기본값 |
|
||||
| --------------------------- | ------------------------------------------------------------ | ----------------------- |
|
||||
| `jvmArgs.operator` | Operator JVM 시작 옵션 | `""` |
|
||||
| `jvmArgs.webhook` | Webhook JVM 시작 옵션 | `""` |
|
||||
| `jvmArgs.logConfig` | 로그 설정 JVM 옵션 | `"-Dlog4j.configurationFile=/opt/flink/conf/log4j-operator.properties"` |
|
||||
|
||||
|
||||
|
||||
### 6) TLS 설정
|
||||
|
||||
- Webhook TLS 인증서 설정
|
||||
|
||||
| Name | 설명 | 기본값 |
|
||||
| --------------------------- | ------------------------------------------------------------ | ----------------------- |
|
||||
| `tls.create` | TLS 인증서 자동 생성 여부 | `false` |
|
||||
| `tls.secretName` | TLS 인증서 시크릿 이름 | `"flink-operator-cert"` |
|
||||
| `tls.secretKeyRef.name` | 인증서 패스워드 시크릿 이름 | `"operator-certificate-password"` |
|
||||
| `tls.secretKeyRef.key` | 인증서 패스워드 시크릿 키 | `"password"` |
|
||||
|
||||
|
||||
|
||||
## 3. FlinkDeployment 예제
|
||||
|
||||
### 3.1) 기본 Flink 애플리케이션 배포
|
||||
|
||||
- Flink Kubernetes Operator 설치 후 FlinkDeployment를 통해 Flink 애플리케이션을 배포할 수 있다.
|
||||
|
||||
``` yaml
|
||||
apiVersion: flink.apache.org/v1beta1
|
||||
kind: FlinkDeployment
|
||||
metadata:
|
||||
name: basic-example
|
||||
namespace: flink
|
||||
spec:
|
||||
image: flink:1.17
|
||||
flinkVersion: v1_17
|
||||
flinkConfiguration:
|
||||
taskmanager.numberOfTaskSlots: "2"
|
||||
serviceAccount: flink
|
||||
jobManager:
|
||||
resource:
|
||||
memory: "2048m"
|
||||
cpu: 1
|
||||
taskManager:
|
||||
resource:
|
||||
memory: "2048m"
|
||||
cpu: 1
|
||||
job:
|
||||
jarURI: local:///opt/flink/examples/streaming/StateMachineExample.jar
|
||||
parallelism: 2
|
||||
```
|
||||
|
||||
### 3.2) Session 모드 배포
|
||||
|
||||
- Session 클러스터를 먼저 배포하고 여러 작업을 제출할 수 있다.
|
||||
|
||||
``` yaml
|
||||
apiVersion: flink.apache.org/v1beta1
|
||||
kind: FlinkDeployment
|
||||
metadata:
|
||||
name: session-cluster
|
||||
namespace: flink
|
||||
spec:
|
||||
image: flink:1.17
|
||||
flinkVersion: v1_17
|
||||
flinkConfiguration:
|
||||
taskmanager.numberOfTaskSlots: "2"
|
||||
serviceAccount: flink
|
||||
jobManager:
|
||||
resource:
|
||||
memory: "2048m"
|
||||
cpu: 1
|
||||
taskManager:
|
||||
resource:
|
||||
memory: "2048m"
|
||||
cpu: 1
|
||||
---
|
||||
apiVersion: flink.apache.org/v1beta1
|
||||
kind: FlinkSessionJob
|
||||
metadata:
|
||||
name: session-job-example
|
||||
namespace: flink
|
||||
spec:
|
||||
deploymentName: session-cluster
|
||||
job:
|
||||
jarURI: local:///opt/flink/examples/streaming/StateMachineExample.jar
|
||||
parallelism: 2
|
||||
```
|
||||
|
||||
### 3.3) 리소스 제한 및 노드 선택
|
||||
|
||||
- 특정 노드에 배포하고 리소스를 제한하는 예제
|
||||
|
||||
``` yaml
|
||||
apiVersion: flink.apache.org/v1beta1
|
||||
kind: FlinkDeployment
|
||||
metadata:
|
||||
name: resource-limited-example
|
||||
namespace: flink
|
||||
spec:
|
||||
image: flink:1.17
|
||||
flinkVersion: v1_17
|
||||
flinkConfiguration:
|
||||
taskmanager.numberOfTaskSlots: "2"
|
||||
serviceAccount: flink
|
||||
podTemplate:
|
||||
spec:
|
||||
nodeSelector:
|
||||
node-type: flink-worker
|
||||
tolerations:
|
||||
- key: "flink-dedicated"
|
||||
operator: "Equal"
|
||||
value: "true"
|
||||
effect: "NoSchedule"
|
||||
jobManager:
|
||||
resource:
|
||||
memory: "2048m"
|
||||
cpu: 1
|
||||
taskManager:
|
||||
resource:
|
||||
memory: "2048m"
|
||||
cpu: 1
|
||||
replicas: 2
|
||||
job:
|
||||
jarURI: local:///opt/flink/examples/streaming/StateMachineExample.jar
|
||||
parallelism: 4
|
||||
Reference in New Issue
Block a user