apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: flinkapplications.flink.k8s.io
  annotations:
    "api-approved.kubernetes.io": "unapproved, experimental-only; please get an approval from Kubernetes API reviewers if you're trying to develop a CRD in the *.k8s.io or *.kubernetes.io groups"
spec:
  group: flink.k8s.io
  names:
    kind: FlinkApplication
    listKind: FlinkApplicationList
    plural: flinkapplications
    singular: flinkapplication
    shortNames:
      - flinkapp
  scope: Namespaced
  versions:
    - name: v1beta1
      served: true
      storage: true
      schema:
        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
                    sysctls:
                      type: array
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                          value:
                            type: string
                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]
                scaleMode:
                  type: string
                  enum: [NewCluster, InPlace]
                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
                  x-kubernetes-preserve-unknown-fields: true
                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
                    systemMemoryFraction:
                      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
                    affinity:
                      properties:
                        nodeAffinity:
                          properties:
                            preferredDuringSchedulingIgnoredDuringExecution:
                              items:
                                properties:
                                  preference:
                                    properties:
                                      matchExpressions:
                                        items:
                                          properties:
                                            key:
                                              type: string
                                            operator:
                                              type: string
                                            values:
                                              items:
                                                type: string
                                              type: array
                                          required:
                                            - key
                                            - operator
                                          type: object
                                        type: array
                                      matchFields:
                                        items:
                                          properties:
                                            key:
                                              type: string
                                            operator:
                                              type: string
                                            values:
                                              items:
                                                type: string
                                              type: array
                                          required:
                                            - key
                                            - operator
                                          type: object
                                        type: array
                                    type: object
                                  weight:
                                    format: int32
                                    type: integer
                                required:
                                  - preference
                                  - weight
                                type: object
                              type: array
                            requiredDuringSchedulingIgnoredDuringExecution:
                              properties:
                                nodeSelectorTerms:
                                  items:
                                    properties:
                                      matchExpressions:
                                        items:
                                          properties:
                                            key:
                                              type: string
                                            operator:
                                              type: string
                                            values:
                                              items:
                                                type: string
                                              type: array
                                          required:
                                            - key
                                            - operator
                                          type: object
                                        type: array
                                      matchFields:
                                        items:
                                          properties:
                                            key:
                                              type: string
                                            operator:
                                              type: string
                                            values:
                                              items:
                                                type: string
                                              type: array
                                          required:
                                            - key
                                            - operator
                                          type: object
                                        type: array
                                    type: object
                                  type: array
                              required:
                                - nodeSelectorTerms
                              type: object
                          type: object
                        podAffinity:
                          properties:
                            preferredDuringSchedulingIgnoredDuringExecution:
                              items:
                                properties:
                                  podAffinityTerm:
                                    properties:
                                      labelSelector:
                                        properties:
                                          matchExpressions:
                                            items:
                                              properties:
                                                key:
                                                  type: string
                                                  x-kubernetes-patch-strategy: merge
                                                  x-kubernetes-patch-merge-key: key
                                                operator:
                                                  type: string
                                                values:
                                                  items:
                                                    type: string
                                                  type: array
                                              required:
                                                - key
                                                - operator
                                              type: object
                                            type: array
                                          matchLabels:
                                            additionalProperties:
                                              type: string
                                            type: object
                                        type: object
                                      namespaces:
                                        items:
                                          type: string
                                        type: array
                                      topologyKey:
                                        type: string
                                    required:
                                      - topologyKey
                                    type: object
                                  weight:
                                    format: int32
                                    type: integer
                                required:
                                  - podAffinityTerm
                                  - weight
                                type: object
                              type: array
                            requiredDuringSchedulingIgnoredDuringExecution:
                              items:
                                properties:
                                  labelSelector:
                                    properties:
                                      matchExpressions:
                                        items:
                                          properties:
                                            key:
                                              type: string
                                              x-kubernetes-patch-strategy: merge
                                              x-kubernetes-patch-merge-key: key
                                            operator:
                                              type: string
                                            values:
                                              items:
                                                type: string
                                              type: array
                                          required:
                                            - key
                                            - operator
                                          type: object
                                        type: array
                                      matchLabels:
                                        additionalProperties:
                                          type: string
                                        type: object
                                    type: object
                                  namespaces:
                                    items:
                                      type: string
                                    type: array
                                  topologyKey:
                                    type: string
                                required:
                                  - topologyKey
                                type: object
                              type: array
                          type: object
                        podAntiAffinity:
                          properties:
                            preferredDuringSchedulingIgnoredDuringExecution:
                              items:
                                properties:
                                  podAffinityTerm:
                                    properties:
                                      labelSelector:
                                        properties:
                                          matchExpressions:
                                            items:
                                              properties:
                                                key:
                                                  type: string
                                                  x-kubernetes-patch-strategy: merge
                                                  x-kubernetes-patch-merge-key: key
                                                operator:
                                                  type: string
                                                values:
                                                  items:
                                                    type: string
                                                  type: array
                                              required:
                                                - key
                                                - operator
                                              type: object
                                            type: array
                                          matchLabels:
                                            additionalProperties:
                                              type: string
                                            type: object
                                        type: object
                                      namespaces:
                                        items:
                                          type: string
                                        type: array
                                      topologyKey:
                                        type: string
                                    required:
                                      - topologyKey
                                    type: object
                                  weight:
                                    format: int32
                                    type: integer
                                required:
                                  - podAffinityTerm
                                  - weight
                                type: object
                              type: array
                            requiredDuringSchedulingIgnoredDuringExecution:
                              items:
                                properties:
                                  labelSelector:
                                    properties:
                                      matchExpressions:
                                        items:
                                          properties:
                                            key:
                                              type: string
                                              x-kubernetes-patch-strategy: merge
                                              x-kubernetes-patch-merge-key: key
                                            operator:
                                              type: string
                                            values:
                                              items:
                                                type: string
                                              type: array
                                          required:
                                            - key
                                            - operator
                                          type: object
                                        type: array
                                      matchLabels:
                                        additionalProperties:
                                          type: string
                                        type: object
                                    type: object
                                  namespaces:
                                    items:
                                      type: string
                                    type: array
                                  topologyKey:
                                    type: string
                                required:
                                  - topologyKey
                                type: object
                              type: array
                          type: object
                      type: object
                    envConfig:
                      type: object
                      properties:
                        env:
                          items:
                            properties:
                              name:
                                type: string
                              value:
                                type: string
                              valueFrom:
                                properties:
                                  configMapKeyRef:
                                    properties:
                                      key:
                                        type: string
                                      name:
                                        type: string
                                      optional:
                                        type: boolean
                                    required:
                                      - key
                                    type: object
                                  fieldRef:
                                    properties:
                                      apiVersion:
                                        type: string
                                      fieldPath:
                                        type: string
                                    required:
                                      - fieldPath
                                    type: object
                                  resourceFieldRef:
                                    properties:
                                      containerName:
                                        type: string
                                      divisor:
                                        anyOf:
                                          - type: integer
                                          - type: string
                                        description: Specifies the output format of the exposed
                                          resources, defaults to "1"
                                        pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                                        x-kubernetes-int-or-string: true
                                      resource:
                                        type: string
                                    required:
                                      - resource
                                    type: object
                                  secretKeyRef:
                                    properties:
                                      key:
                                        type: string
                                      name:
                                        type: string
                                      optional:
                                        type: boolean
                                    required:
                                      - key
                                    type: object
                                type: object
                            required:
                              - name
                            type: object
                          type: array
                        envFrom:
                          items:
                            properties:
                              configMapRef:
                                properties:
                                  name:
                                    type: string
                                  optional:
                                    type: boolean
                                type: object
                              prefix:
                                type: string
                              secretRef:
                                properties:
                                  name:
                                    type: string
                                  optional:
                                    type: boolean
                                type: object
                            type: object
                          type: array
                    resources:
                      type: object
                      properties:
                        requests:
                          type: object
                          properties:
                            memory:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                            cpu:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                            storage:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                            ephemeral-storage:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                        limits:
                          type: object
                          properties:
                            memory:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                            cpu:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                            storage:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                            ephemeral-storage:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                taskManagerConfig:
                  type: object
                  properties:
                    taskSlots:
                      type: integer
                      minimum: 1
                    offHeapMemoryFraction:
                      type: number
                      minimum: 0
                      maximum: 1
                    systemMemoryFraction:
                      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
                    affinity:
                      properties:
                        nodeAffinity:
                          properties:
                            preferredDuringSchedulingIgnoredDuringExecution:
                              items:
                                properties:
                                  preference:
                                    properties:
                                      matchExpressions:
                                        items:
                                          properties:
                                            key:
                                              type: string
                                            operator:
                                              type: string
                                            values:
                                              items:
                                                type: string
                                              type: array
                                          required:
                                            - key
                                            - operator
                                          type: object
                                        type: array
                                      matchFields:
                                        items:
                                          properties:
                                            key:
                                              type: string
                                            operator:
                                              type: string
                                            values:
                                              items:
                                                type: string
                                              type: array
                                          required:
                                            - key
                                            - operator
                                          type: object
                                        type: array
                                    type: object
                                  weight:
                                    format: int32
                                    type: integer
                                required:
                                  - preference
                                  - weight
                                type: object
                              type: array
                            requiredDuringSchedulingIgnoredDuringExecution:
                              properties:
                                nodeSelectorTerms:
                                  items:
                                    properties:
                                      matchExpressions:
                                        items:
                                          properties:
                                            key:
                                              type: string
                                            operator:
                                              type: string
                                            values:
                                              items:
                                                type: string
                                              type: array
                                          required:
                                            - key
                                            - operator
                                          type: object
                                        type: array
                                      matchFields:
                                        items:
                                          properties:
                                            key:
                                              type: string
                                            operator:
                                              type: string
                                            values:
                                              items:
                                                type: string
                                              type: array
                                          required:
                                            - key
                                            - operator
                                          type: object
                                        type: array
                                    type: object
                                  type: array
                              required:
                                - nodeSelectorTerms
                              type: object
                          type: object
                        podAffinity:
                          properties:
                            preferredDuringSchedulingIgnoredDuringExecution:
                              items:
                                properties:
                                  podAffinityTerm:
                                    properties:
                                      labelSelector:
                                        properties:
                                          matchExpressions:
                                            items:
                                              properties:
                                                key:
                                                  type: string
                                                  x-kubernetes-patch-strategy: merge
                                                  x-kubernetes-patch-merge-key: key
                                                operator:
                                                  type: string
                                                values:
                                                  items:
                                                    type: string
                                                  type: array
                                              required:
                                                - key
                                                - operator
                                              type: object
                                            type: array
                                          matchLabels:
                                            additionalProperties:
                                              type: string
                                            type: object
                                        type: object
                                      namespaces:
                                        items:
                                          type: string
                                        type: array
                                      topologyKey:
                                        type: string
                                    required:
                                      - topologyKey
                                    type: object
                                  weight:
                                    format: int32
                                    type: integer
                                required:
                                  - podAffinityTerm
                                  - weight
                                type: object
                              type: array
                            requiredDuringSchedulingIgnoredDuringExecution:
                              items:
                                properties:
                                  labelSelector:
                                    properties:
                                      matchExpressions:
                                        items:
                                          properties:
                                            key:
                                              type: string
                                              x-kubernetes-patch-strategy: merge
                                              x-kubernetes-patch-merge-key: key
                                            operator:
                                              type: string
                                            values:
                                              items:
                                                type: string
                                              type: array
                                          required:
                                            - key
                                            - operator
                                          type: object
                                        type: array
                                      matchLabels:
                                        additionalProperties:
                                          type: string
                                        type: object
                                    type: object
                                  namespaces:
                                    items:
                                      type: string
                                    type: array
                                  topologyKey:
                                    type: string
                                required:
                                  - topologyKey
                                type: object
                              type: array
                          type: object
                        podAntiAffinity:
                          properties:
                            preferredDuringSchedulingIgnoredDuringExecution:
                              items:
                                properties:
                                  podAffinityTerm:
                                    properties:
                                      labelSelector:
                                        properties:
                                          matchExpressions:
                                            items:
                                              properties:
                                                key:
                                                  type: string
                                                  x-kubernetes-patch-strategy: merge
                                                  x-kubernetes-patch-merge-key: key
                                                operator:
                                                  type: string
                                                values:
                                                  items:
                                                    type: string
                                                  type: array
                                              required:
                                                - key
                                                - operator
                                              type: object
                                            type: array
                                          matchLabels:
                                            additionalProperties:
                                              type: string
                                            type: object
                                        type: object
                                      namespaces:
                                        items:
                                          type: string
                                        type: array
                                      topologyKey:
                                        type: string
                                    required:
                                      - topologyKey
                                    type: object
                                  weight:
                                    format: int32
                                    type: integer
                                required:
                                  - podAffinityTerm
                                  - weight
                                type: object
                              type: array
                            requiredDuringSchedulingIgnoredDuringExecution:
                              items:
                                properties:
                                  labelSelector:
                                    properties:
                                      matchExpressions:
                                        items:
                                          properties:
                                            key:
                                              type: string
                                              x-kubernetes-patch-strategy: merge
                                              x-kubernetes-patch-merge-key: key
                                            operator:
                                              type: string
                                            values:
                                              items:
                                                type: string
                                              type: array
                                          required:
                                            - key
                                            - operator
                                          type: object
                                        type: array
                                      matchLabels:
                                        additionalProperties:
                                          type: string
                                        type: object
                                    type: object
                                  namespaces:
                                    items:
                                      type: string
                                    type: array
                                  topologyKey:
                                    type: string
                                required:
                                  - topologyKey
                                type: object
                              type: array
                          type: object
                      type: object
                    envConfig:
                      type: object
                      properties:
                        env:
                          items:
                            properties:
                              name:
                                type: string
                              value:
                                type: string
                              valueFrom:
                                properties:
                                  configMapKeyRef:
                                    properties:
                                      key:
                                        type: string
                                      name:
                                        type: string
                                      optional:
                                        type: boolean
                                    required:
                                      - key
                                    type: object
                                  fieldRef:
                                    properties:
                                      apiVersion:
                                        type: string
                                      fieldPath:
                                        type: string
                                    required:
                                      - fieldPath
                                    type: object
                                  resourceFieldRef:
                                    properties:
                                      containerName:
                                        type: string
                                      divisor:
                                        anyOf:
                                          - type: integer
                                          - type: string
                                        description: Specifies the output format of the exposed
                                          resources, defaults to "1"
                                        pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                                        x-kubernetes-int-or-string: true
                                      resource:
                                        type: string
                                    required:
                                      - resource
                                    type: object
                                  secretKeyRef:
                                    properties:
                                      key:
                                        type: string
                                      name:
                                        type: string
                                      optional:
                                        type: boolean
                                    required:
                                      - key
                                    type: object
                                type: object
                            required:
                              - name
                            type: object
                          type: array
                        envFrom:
                          items:
                            properties:
                              configMapRef:
                                properties:
                                  name:
                                    type: string
                                  optional:
                                    type: boolean
                                type: object
                              prefix:
                                type: string
                              secretRef:
                                properties:
                                  name:
                                    type: string
                                  optional:
                                    type: boolean
                                type: object
                            type: object
                          type: array
                    resources:
                      type: object
                      properties:
                        requests:
                          type: object
                          properties:
                            memory:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                            cpu:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                            storage:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                            ephemeral-storage:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                        limits:
                          type: object
                          properties:
                            memory:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                            cpu:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                            storage:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                            ephemeral-storage:
                              type: string
                              pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
                volumes:
                  type: array
                  items:
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                    properties:
                      name:
                        type: string
                    required:
                      - name
                volumeMounts:
                  type: array
                  items:
                    type: object
                    properties:
                      mountPath:
                        type: string
                      mountPropagation:
                        type: string
                      name:
                        type: string
                      readOnly:
                        type: boolean
                      subPath:
                        type: string
                      subPathExpr:
                        type: string
                    required:
                      - name
                      - mountPath
              required:
                - image
                - jarName
                - parallelism
                - entryClass
      subresources:
        status: {}
      additionalPrinterColumns:
        - name: Phase
          type: string
          description: The current state machine phase for this FlinkApplication
          jsonPath: .status.phase
        - name: Cluster Health
          type: string
          description: The health of the Flink cluster
          jsonPath: .status.clusterStatus.health
        - name: Job Health
          type: string
          description: The health of the Flink job
          jsonPath: .status.jobStatus.health
        - name: Healthy TMs
          type: string
          jsonPath: ".status.clusterStatus.healthyTaskManagers"
          priority: 1
        - name: Total TMs
          type: string
          jsonPath: ".status.clusterStatus.numberOfTaskManagers"
          priority: 1
        - name: Job Restarts
          type: integer
          description: Number of times the job has restarted
          jsonPath: .status.jobStatus.jobRestartCount
        - name: Age
          type: date
          jsonPath: .metadata.creationTimestamp
