Flink-operator makes it very easy to manage Flink clusters and their jobs. We only need to customize the YAML file to do this. There is no official Flink operator solution, but the GoogleCloudPlatform provides a Flink operator solution based on KubeBuilder. Next, the installation method of flink-operator will be introduced.

For details about the flink-operator, see www.cnblogs.com/tencent-clo…

The code download

git clone https://github.com/GoogleCloudPlatform/flink-on-k8s-operator.git
Copy the code

Executing the update script

cd flink-on-k8s-operator

cd helm-chart/flink-operator

./update_template.sh
Copy the code

Modification of CRD in chart

Remove the CRD file from config/crdchart, because there is a bug, CRD cannot be installed automatically, it should be the version problem, the official document from Google is based on the version of K8S-1.17, if your K8S cluster is 1.18, it will report an error.

cd flink-on-k8s-operator

rm helm-chart/flink-operator/templates/flink-cluster-crd.yaml

cp config/crd/base/flinkoperator.k8s.io_flinkclusters.yaml helm-chart/flink-operator/templates
Copy the code

CRD still reported an error

make deploy failed: The CustomResourceDefinition "flinkclusters.flinkoperator.k8s.io" is invalid
Copy the code

Find the following solutions:Github.com/GoogleCloud…

Gcr. IO image cannot be downloaded. Three images are modified

Online to find the corresponding mirror, pull, push to the private mirror

Here are the three images I found that work:

docker pull mirrorgooglecontainers/flink-operator/deployer:webhook-cert

docker pull docker pull rancher/kube-rbac-proxy

docker pull metatronapp/flink-operator
Copy the code

Operatorimage-name in helm-chart/flink-operator/values adds the private image flink-operator tagged

Replace the private image kube-rbac-proxy in the deployment of helm-chart/flink-operator/templates/flink-operator.yaml

Helm – chart/flink – operator/templates/generate – cert. Yaml’s Job to replace private image deployer: webhook – cert

Try installing flink-operator-chart

We can follow the helm command as follows: helm install flink-operator . –set operatorImage.name=xxxxx:8000/spark-operator/flink-operator:latest,flinkOperatorNamespace.name=flink-operator-system,fli nkOperatorNamespace.create=false

Argo CD supports a variety of Kubernetes lists including Helm Charts, you can use ArgoCD directly for management installation.

At this point, the flink-operator is done. Stay tuned for an example of Flink cluster management.

This article refer to

www.cxybb.com/article/u01…