Add a custom Args type that accepts both a key-value map and a flat
CLI-style list, normalizing internally to []string so downstream code
requires no changes.
- Args: new []string alias with UnmarshalJSON (map + list) and
MarshalJSON (map) — keys are sorted for deterministic ordering
- CRD schema: switch args from typed array to
x-kubernetes-preserve-unknown-fields to accept either shape
- Bump go-flink-client to v0.2.2 (fix: programArgsList → programArg
query parameter name for Flink REST API)
Args can now be written as:
args:
kafka-host: broker:9092
kafka-group-id: my-group
Or the existing list format:
args:
- "--kafka-host"
- broker:9092
126 lines
3.8 KiB
YAML
126 lines
3.8 KiB
YAML
# flink-crd.yaml
|
|
apiVersion: apiextensions.k8s.io/v1
|
|
kind: CustomResourceDefinition
|
|
metadata:
|
|
name: flink-jobs.flink.logicamp.dev
|
|
spec:
|
|
group: flink.logicamp.dev
|
|
names:
|
|
kind: FlinkJob
|
|
plural: flink-jobs
|
|
singular: flink-job
|
|
shortNames:
|
|
- lfj
|
|
scope: Namespaced
|
|
versions:
|
|
- name: v1alpha1
|
|
served: true
|
|
storage: true
|
|
schema:
|
|
openAPIV3Schema:
|
|
type: object
|
|
properties:
|
|
spec:
|
|
type: object
|
|
required:
|
|
- key
|
|
- jarUri
|
|
properties:
|
|
key:
|
|
type: string
|
|
name:
|
|
type: string
|
|
flinkCluster:
|
|
type: string
|
|
description: "Identifier of the Flink cluster that manages this job. Defaults to the OPERATOR_ID (usually the Helm release name) if not set."
|
|
entryClass:
|
|
type: string
|
|
parallelism:
|
|
type: integer
|
|
jarUri:
|
|
type: string
|
|
jarURIBasicAuthUsername:
|
|
type: string
|
|
jarURIBasicAuthPassword:
|
|
type: string
|
|
args:
|
|
description: "Program arguments. Accepts a list of strings (--key, value, ...) or a map of key-value pairs."
|
|
x-kubernetes-preserve-unknown-fields: true
|
|
savepointInterval:
|
|
type: string
|
|
format: duration
|
|
flinkConfiguration:
|
|
type: object
|
|
additionalProperties:
|
|
type: string
|
|
resources:
|
|
type: object
|
|
properties:
|
|
requests:
|
|
type: object
|
|
properties:
|
|
memory:
|
|
type: string
|
|
cpu:
|
|
type: string
|
|
limits:
|
|
type: object
|
|
properties:
|
|
memory:
|
|
type: string
|
|
cpu:
|
|
type: string
|
|
status:
|
|
type: object
|
|
properties:
|
|
jobStatus:
|
|
type: string
|
|
startTime:
|
|
type: string
|
|
jobId:
|
|
type: string
|
|
jarId:
|
|
type: string
|
|
error:
|
|
type: string
|
|
lastSavepointPath:
|
|
type: string
|
|
lifeCycleStatus:
|
|
type: string
|
|
savepointTriggerId:
|
|
type: string
|
|
lastSavepointDate:
|
|
type: string
|
|
format: time
|
|
lastRestoredSavepointDate:
|
|
type: string
|
|
format: time
|
|
lastRestoredSavepointRestoredDate:
|
|
type: string
|
|
format: time
|
|
runningJarURI:
|
|
type: string
|
|
pauseSavepointTriggerId:
|
|
type: string
|
|
restoredCount:
|
|
type: number
|
|
additionalPrinterColumns:
|
|
- name: Status
|
|
type: string
|
|
jsonPath: .status.jobStatus
|
|
- name: Age
|
|
type: date
|
|
jsonPath: .metadata.creationTimestamp
|
|
- name: Life Cycle Status
|
|
type: string
|
|
jsonPath: .status.lifeCycleStatus
|
|
- name: Last Savepoint
|
|
type: date
|
|
jsonPath: .status.lastSavepointDate
|
|
- name: Last Restored Savepoint
|
|
type: date
|
|
jsonPath: .status.lastRestoredSavepointDate
|
|
- name: Restored Count
|
|
type: number
|
|
jsonPath: .status.restoredCount
|