1.准备各个配置文件
crd.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: flinkapplications.flink.k8s.io
spec:
group: flink.k8s.io
names:
kind: FlinkApplication
listKind: FlinkApplicationList
plural: flinkapplications
singular: flinkapplication
shortNames:
- flinkapp
scope: Namespaced
version: v1beta1
versions:
- name: v1beta1
served: true
storage: true
- name: v1alpha1
served: true
storage: false
validation:
# openAPIV3Schema is the schema for validating custom objects.
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
image:
type: string
imagePullPolicy:
type: string
enum: [Always, Never, IfNotPresent]
imagePullSecrets:
type: array
items:
type: object
properties:
name:
type: string
serviceAccountName:
type: string
securityContext:
type: object
properties:
fsGroup:
type: integer
minimum: 1
maximum: 65535
runAsGroup:
type: integer
minimum: 1
maximum: 65535
runAsNonRoot:
type: boolean
runAsUser:
type: integer
minimum: 1
maximum: 65535
supplementalGroups:
type: array
items:
type: integer
minimum: 1
maximum: 65535
jarName:
type: string
programArgs:
type: string
entryClass:
type: string
flinkVersion:
type: string
restartNonce:
type: string
parallelism:
type: integer
minimum: 1
deleteMode:
type: string
enum: [Savepoint, None, ForceCancel]
allowNonRestoredState:
type: boolean
deploymentMode:
type: string
enum: [Dual, BlueGreen]
rpcPort:
type: integer
minimum: 1
maximum: 65535
blobPort:
type: integer
minimum: 1
maximum: 65535
queryPort:
type: integer
minimum: 1
maximum: 65535
metricsQueryPort:
type: integer
minimum: 1
maximum: 65535
flinkConfig:
type: object
properties:
additionalProperties:
type: string
savepointInfo:
type: object
properties:
savepointLocation:
type: string
savepointPath:
type: string
savepointDisabled:
type: boolean
maxCheckpointRestoreAgeSeconds:
type: integer
minimum: 1
jobManagerConfig:
type: object
properties:
replicas:
type: integer
minimum: 1
offHeapMemoryFraction:
type: number
minimum: 0
maximum: 1
nodeSelector:
type: object
properties:
additionalProperties:
type: string
tolerations:
type: array
items:
type: object
properties:
effect:
type: string
key:
type: string
operator:
type: string
tolerationSeconds:
type: integer
format: int64
value:
type: string
envConfig:
type: object
properties: