Flink Operator create Session Job unsuccessfully

2022-11-30 Thread Mark Lee
Hi, 

   I'm creating a session job using FlinkOperator. The CRD as follows:

 




#  Licensed to the Apache Software Foundation (ASF) under one

#  or more contributor license agreements.  See the NOTICE file

#  distributed with this work for additional information

#  regarding copyright ownership.  The ASF licenses this file

#  to you under the Apache License, Version 2.0 (the

#  "License"); you may not use this file except in compliance

#  with the License.  You may obtain a copy of the License at

#

#  http://www.apache.org/licenses/LICENSE-2.0

#

#  Unless required by applicable law or agreed to in writing, software

#  distributed under the License is distributed on an "AS IS" BASIS,

#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

#  See the License for the specific language governing permissions and

# limitations under the License.




 

apiVersion: flink.apache.org/v1beta1

kind: FlinkDeployment

metadata:

  namespace: default

  name: flink-example-statemachine

spec:

  image: flink:1.15.2

  flinkVersion: v1_15

  ingress:

template: "/{{namespace}}/{{name}}(/|$)(.*)"

className: "nginx"

annotations:

  nginx.ingress.kubernetes.io/rewrite-target: "/$2"

  flinkConfiguration:

taskmanager.numberOfTaskSlots: "2"

high-availability:
org.apache.flink.kubernetes.highavailability.KubernetesHaServicesFactory

high-availability.storageDir: file:///opt/flink/volume/flink-ha

state.checkpoints.dir: file:///opt/flink/volume/flink-cp

state.savepoints.dir: file:///opt/flink/volume/flink-sp

  serviceAccount: flink

  podTemplate:

apiVersion: v1

kind: Pod

metadata:

  name: pod-template

spec:

  initContainers:

- name: artifacts-fetcher

  image: flinktest:1.0

  imagePullPolicy: Always

  command: [ 'cp','/flink-artifact/myjob.jar', '/tmp/myjob.jar' ]

  # Use wget or other tools to get user jars from remote storage

  volumeMounts:

- mountPath: /tmp

  name: flink-artifact

  containers:

# Do not change the main container name

- name: flink-main-container

  resources:

requests:

  ephemeral-storage: 2048Mi

limits:

  ephemeral-storage: 2048Mi

  volumeMounts:

- mountPath: /opt/flink/usrlib

  name: flink-artifact

- mountPath: /opt/flink/volume

  name: flink-volume

  volumes:

- name: flink-artifact

  emptyDir: { }

- name: flink-volume

  persistentVolumeClaim:

claimName: flink-example-statemachine

  jobManager:

resource:

  memory: "1024m"

  cpu: 0.5

  taskManager:

resource:

  memory: "1024m"

  cpu: 0.5

  mode: native

 

---

apiVersion: flink.apache.org/v1beta1

kind: FlinkSessionJob

metadata:

  namespace: default

  name: newjob

spec:

  deploymentName: flink-example-statemachine

  job:

jarURI: local:///opt/flink/usrlib/myjob.jar

parallelism: 2

upgradeMode: last-state

entryClass:
org.apache.flink.streaming.examples.statemachine.StateMachineExample

 

---

apiVersion: v1

kind: PersistentVolumeClaim

metadata:

  name: flink-example-statemachine

spec:

  storageClassName: ccos-hostpath-data-meta

  accessModes:

- ReadWriteOnce

  volumeMode: Filesystem

  resources:

requests:

  storage: 1Gi

 

---

apiVersion: networking.k8s.io/v1

kind: IngressClass

metadata:

  annotations:

ingressclass.kubernetes.io/is-default-class: "true"

  labels:

app.kubernetes.io/component: controller

  name: nginx

spec:

  controller: k8s.io/ingress-nginx



 

and the job manager is created successfully but the task manager pod is not
created, there's no error log in flink operator and job manager.

Follow picture is pods list in my k8s environment.



 

And the same config using application mode, the job can create successfully.

 

It troubles me serveral days. Can someone help me ? Thank you.

 



How to make flink operator as a cluster operator?

2022-11-28 Thread Mark Lee
Hi all,  

   How to make flink operator as a cluster operator? And How to register it
to CVO(Cluster Version Operator)?

   

   I didn't find any code or configure file in flink-operator's code.

   

   Thank you.

 

Mark



How can I deploy a flink cluster with 4 TaskManagers?

2022-11-25 Thread Mark Lee
Hi all,

How can I deploy a flink cluster with 1 Job Manager and 4 Task Managers
using FlinkDeployment CR?

 

Such sample in Flink Operator can only create 1 Task Manager.

apiVersion: flink.apache.org/v1beta1
kind: FlinkDeployment
metadata:
  name: basic-session-deployment-only-example
spec:
  image: flink:1.15
  flinkVersion: v1_15
  flinkConfiguration:
taskmanager.numberOfTaskSlots: "2"
  serviceAccount: flink
  jobManager:
resource:
  memory: "2048m"
  cpu: 1
  taskManager:
resource:
  memory: "2048m"
  cpu: 1

 

Thank you.



Flink Operator in an off-line k8s enviroment

2022-11-22 Thread Mark Lee
Hi all,

I installed flink operator following
https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-main/docs/
try-flink-kubernetes-operator/quick-start/.

helm repo add flink-operator-repo
https://downloads.apache.org/flink/flink-kubernetes-operator-1.2.0/

helm install flink-kubernetes-operator
flink-operator-repo/flink-kubernetes-operator

 

I execute above commands in a helm client(can touch internet) collect a k8s
environment which cann't connect internet.

 

  The flink operator is installed correctly but I got such errors for my k8s
cluster can't connect internet.

What steps can I do to run flink operator correctly in my off-line k8s
cluster?

Should I run a local helm repo to replace the image
"ghcr.io/apache/flink-kubernetes-operator:95128bf" to a local image?

  

   Thank you.

 

[root@localhost ~]# kubectl  get pods

NAMEREADY   STATUS
RESTARTS   AGE

flink-kubernetes-operator-7797c7bd7-tpbqf   0/1 ImagePullBackOff   0
124m

 

[root@localhost ~]# kubectl  describe pod
flink-kubernetes-operator-7797c7bd7-tpbqf | grep Image -C 5

Normal   AddedInterface  124mmultus Add eth0
[10.128.6.212/14] from kube-ovn

  Warning  Failed  119m (x4 over 123m) kubeletError:
ErrImagePull

  Warning  Failed  118m (x7 over 123m) kubeletError:
ImagePullBackOff

  Normal   Pulling 34m (x19 over 124m) kubelet
Pulling image "ghcr.io/apache/flink-kubernetes-operator:95128bf"

  Warning  Failed  8m53s (x23 over 123m)   kubeletFailed
to pull image "ghcr.io/apache/flink-kubernetes-operator:95128bf": rpc error:
code = Unknown desc = pinging container registry ghcr.io: Get
"https://ghcr.io/v2/": dial tcp 20.205.243.164:443: i/o timeout

  Normal   BackOff 4m20s (x424 over 123m)  kubelet
Back-off pulling image "ghcr.io/apache/flink-kubernetes-operator:95128bf"

 



答复: Deploy Flink Operator in an k8s enviroment without helm?

2022-11-17 Thread Mark Lee
Thanks Gyula,

 My basic OS does not have a helm client and don’t allow install it. Could 
I deploy flink operator in such situation?

 

发件人: user-return-51648-lifuqiong00=126@flink.apache.org 
 代表 Gyula Fóra
发送时间: 2022年11月18日 13:26
收件人: Biao Geng 
抄送: Mark Lee ; user@flink.apache.org
主题: Re: Deploy Flink Operator in an k8s enviroment without helm?

 

Adding to what Biao Geng said, yes it is completely possible and other 
installation methods are used by many users already.

You can check the Helm templates in the repo to get an idea what resources you 
need to create.
Actually if you run `helm template flink-kubernetes-operator 
helm/flink-kubernetes-operator` from the git repo your local helm client will 
render the templates and print the resources that it would generate.
That is a great way to get started with manual installation.

There are also OLM bundles available for the current operator releases, these 
are not yet officially supported by the Flink community but we are working 
towards that: https://operatorhub.io/operator/flink-kubernetes-operator
maybe this is more relevant in your environment.

To summarize, there are many ways to install the operator, Helm is just one of 
the more convenient ones, that's why we use it as the example in the repo.
Production setups usually need to customize at least parts of the deployment 
logic in any case.

Gyula

 

 

On Fri, Nov 18, 2022 at 6:12 AM Biao Geng mailto:biaoge...@gmail.com> > wrote:

Hi Mark,

I believe you can do that without helm. Just like that you can install some 
software in CentOS without yum. 

But you may have to handle some basic setup by yourself. For the operator, you 
at least have to prepare RBAC creation, serviceAccount creation, Deployment 
creation or Webhook creation which if you want to use. Also, if you want to 
uninstall the operator, you should clear those resources by hand. It is not 
very hard but does require some hand work. 

 

Best,

Biao Geng

 

获取 Outlook for iOS <https://aka.ms/o0ukef> 


  _____  


发件人: Mark Lee mailto:lifuqion...@126.com> >
发送时间: Friday, November 18, 2022 12:57:26 PM
收件人: user@flink.apache.org <mailto:user@flink.apache.org>  
mailto:user@flink.apache.org> >
主题: Deploy Flink Operator in an k8s enviroment without helm? 

 

Hi all,

   I am trying to deploy flink operator followed Quick Start 
<https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-main/docs/try-flink-kubernetes-operator/quick-start/>
 . But it seems need helm client installed in Kubernetes environment. Could we 
deploy flink operator without helm client installed?

Now you can deploy the selected stable Flink Kubernetes Operator version using 
the included Helm chart:

helm repo add flink-operator-repo 
https://downloads.apache.org/flink/flink-kubernetes-operator-/

helm install flink-kubernetes-operator 
flink-operator-repo/flink-kubernetes-operator

 

Thank you.



答复: Deploy Flink Operator in an k8s enviroment without helm?

2022-11-17 Thread Mark Lee
Thanks Biao,

Sorry I’m a rookie in helm or operator. I know that I can prepare RBAC,
ServiceAccount or Deployment creation by CRs or yaml files. 

But the basic OS(Kubernetes) environment I can’t install any other software
the basic like helm 

But I can’t install any software(like helm) the basic OS does not supply in
my scenario.

 

发件人: Biao Geng  
发送时间: 2022年11月18日 13:12
收件人: Mark Lee ; user@flink.apache.org
主题: Re: Deploy Flink Operator in an k8s enviroment without helm?

 

Hi Mark,

I believe you can do that without helm. Just like that you can install some
software in CentOS without yum. 

But you may have to handle some basic setup by yourself. For the operator,
you at least have to prepare RBAC creation, serviceAccount creation,
Deployment creation or Webhook creation which if you want to use. Also, if
you want to uninstall the operator, you should clear those resources by
hand. It is not very hard but does require some hand work. 

 

Best,

Biao Geng

 

获取 Outlook for iOS <https://aka.ms/o0ukef> 

  _  

发件人: Mark Lee mailto:lifuqion...@126.com> >
发送时间: Friday, November 18, 2022 12:57:26 PM
收件人: user@flink.apache.org <mailto:user@flink.apache.org>
mailto:user@flink.apache.org> >
主题: Deploy Flink Operator in an k8s enviroment without helm? 

 

Hi all,

   I am trying to deploy flink operator followed Quick Start
<https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-main/docs
/try-flink-kubernetes-operator/quick-start/> . But it seems need helm client
installed in Kubernetes environment. Could we deploy flink operator without
helm client installed?

Now you can deploy the selected stable Flink Kubernetes Operator version
using the included Helm chart:

helm repo add flink-operator-repo
https://downloads.apache.org/flink/flink-kubernetes-operator-
<https://downloads.apache.org/flink/flink-kubernetes-operator-%3cOPERATOR-VE
RSION%3e/> /

helm install flink-kubernetes-operator
flink-operator-repo/flink-kubernetes-operator

 

Thank you.



Deploy Flink Operator in an k8s enviroment without helm?

2022-11-17 Thread Mark Lee
Hi all,

   I am trying to deploy flink operator followed Quick Start
 . But it seems need helm client
installed in Kubernetes environment. Could we deploy flink operator without
helm client installed?

Now you can deploy the selected stable Flink Kubernetes Operator version
using the included Helm chart:

helm repo add flink-operator-repo
https://downloads.apache.org/flink/flink-kubernetes-operator-/

helm install flink-kubernetes-operator
flink-operator-repo/flink-kubernetes-operator

 

Thank you.



答复: Flink Operator in Golang?

2022-11-17 Thread Mark Lee
I got it, Thanks Zhanghao!

 

发件人: user-return-51640-lifuqiong00=126@flink.apache.org
 代表
zhanghao.c...@outlook.com
发送时间: 2022年11月17日 23:36
收件人: Mark Lee ; user@flink.apache.org
主题: Re: Flink Operator in Golang?

 

Hi Mark,

 

1.  Directly quoting from
https://cwiki.apache.org/confluence/display/FLINK/FLIP-212%3A+Introduce+Flin
k+Kubernetes+Operator:

Main reasons for choosing Java over Go

・   Direct access to Flink Client libraries for submitting, managing
jobs and handling errors

・   Most Flink developers have strong Java experience while there are
only few Go experts

・   Easier to integrate with existing build system and tooling

・   Required k8s clients and tools for building an operator are also
available in Java

2.  unfortunately, Golang API is not supported yet

 

 

Best,

Zhanghao Chen

  _  

From: Mark Lee mailto:lifuqion...@126.com> >
Sent: Thursday, November 17, 2022 16:16
To: user@flink.apache.org <mailto:user@flink.apache.org>
mailto:user@flink.apache.org> >
Subject: Flink Operator in Golang? 

 

Hi,

  I found we already have Flink operator implemented by java. But I have two
questions:

1. If we can implement Flink operator using golang? Is there some hidden
difficult traps?

2. We can submit Java jar jobs or sql jobs, can we submit golang jobs?

 

Thank you.

 



Flink Operator in Golang?

2022-11-17 Thread Mark Lee
Hi,

  I found we already have Flink operator implemented by java. But I have two
questions:

1. If we can implement Flink operator using golang? Is there some hidden
difficult traps?

2. We can submit Java jar jobs or sql jobs, can we submit golang jobs?

 

Thank you.