Operations 4 min read

Automating Flink Task Deployment with Tekton, GitLab, and Serverless K8s

This guide details how to automate the full lifecycle of Flink tasks—including environment setup, integration, building, deployment, and task control—using GitLab, Tekton CI/CD, serverless containers on Alibaba Cloud, and Kubernetes, all orchestrated via Feishu cards.

Efficient Ops
Efficient Ops
Efficient Ops
Automating Flink Task Deployment with Tekton, GitLab, and Serverless K8s

Environment

Code hosting: GitLab

CI: Tekton

CD: Tekton

Pipeline/Task: Alibaba Cloud serverless containers (spot instances billed per second)

Application platform: Kubernetes

Flink applications need flexible addition of tasks (usually as Maven modules in the same

git

repository) and cannot rely on manual registration or automatic registration via

.polaris-ci.yml

.

My approach is to specify a template as a deployment scenario and bind it to the repository, enabling automatic detection and registration of applications; the whole process is completed through Feishu card interactions.

Workflow

Integration Process

When an application is integrated for the first time, the build prompts an interactive cluster binding; automatic registration of each department's Flink repository and other build parameters are predefined as scenarios, so adding a new Flink task only requires confirming which K8S cluster to deploy to.

Build Process

Image delivery: select a branch, perform Java compilation, and build the container image.

Deployment Process

During deployment, the system checks whether a version is already running; if it is, it first obtains a checkpoint and stops the task (optimizing or forcing). The checkpoint address is automatically filled into a Feishu card, allowing the responsible person to decide whether to use that version.

After a successful deployment, the access address is printed on the card for easy access.

Stop Task

Start Task

This operation first selects the target version, then performs stop, checkpoint confirmation, and start. If the goal is only to restart the task, the operation behaves like a build: it stops (and obtains a

checkpoint

) before prompting deployment, without requiring a separate stop step.

serverlessFlinkCI/CDAutomationKubernetesTekton
Efficient Ops
Written by

Efficient Ops

This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.