You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by yidan zhao <hi...@gmail.com> on 2022/04/07 03:41:29 UTC

k8s session cluster flink1.13.6创建后提示的地址啥用。

参考 https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/deployment/resource-providers/native_kubernetes/#starting-a-flink-session-on-kubernetes

基于命令创建k8s flink session集群(flink1.13.6):./bin/kubernetes-session.sh
-Dkubernetes.cluster-id=my-first-flink-cluster 。创建成功,最后提示一句 Create
flink session cluster my-first-flink-cluster successfully, JobManager
Web Interface: http://10.227.137.154:8081。但是这个地址访问不通。

并且通过如下命令提交任务也一样,会检索到如上地址,然后提交任务不成功。
./bin/flink run \
    --target kubernetes-session \
    -Dkubernetes.cluster-id=my-first-flink-cluster \
    ./examples/streaming/TopSpeedWindowing.jar

--- 然后如下方式是可以的,不清楚是啥问题呢。
1 通过 kubectl get svc 拿到 my-first-flink-cluster-rest
的clusterIp:port为192.168.127.57:8081。
2 查看任务
flink list  -m 192.168.127.57:8081
3 提交任务
flink run  -m 192.168.127.57:8081
/home/work/flink/examples/streaming/TopSpeedWindowing.jar

--- 区别:192这个是clusterIp虚拟ip。  10.x那个是我机器ip。

Re: k8s session cluster flink1.13.6创建后提示的地址啥用。

Posted by Zhanghao Chen <zh...@outlook.com>.
Standalone K8s 和 Native K8s 部署模式主要的区别是 Native K8s 模式下的 Flink 具备和 K8s API Server 直接通信来申请所需的资源和感知集群状态的能力,而 Standalone K8s 对底层的 K8s 集群没有直接感知,这带来了两个主要区别:


  1.  在部署上,Standalone K8s 需要你手动去创建集群所需要的 deployment、configmap、service,而 Native K8s 你只需要调用 Flink CLI 就行。
  2.  在资源申请上,Standalone K8s 使用被动资源管理 - 需要你或者其他外部系统分配好资源,Flink 被动接受这些分配好的资源;Native K8s 使用主动资源管理 - Flink 集群启动后自己会根据提交上来的作业的属性去跟 K8s 申请所需要的资源。

Best,
Zhanghao Chen
________________________________
From: yidan zhao <hi...@gmail.com>
Sent: Friday, April 8, 2022 10:52
To: user-zh <us...@flink.apache.org>
Subject: Re: k8s session cluster flink1.13.6创建后提示的地址啥用。

貌似官网对flink k8s情况有2个入口,分别为:
https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/deployment/resource-providers/standalone/kubernetes/#session-mode
和
https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/deployment/resource-providers/native_kubernetes/。

分别对应 Resource Providers/Standalone/Kubernetes 和 Kubernetes Resource
Providers/Native
Kubernetes。有人知道啥区别吗。从文档来看,貌似前者是给了具体的service、deployment等yml描述,然后自己创建集群。后者是脚本一键创建。但如果仅仅是这个区别,为啥有“standalone/kubernetes”和“native
kubernetes”这种区分呢?

>
> 集群是3台物理机搭建,非minikube。
> 不清楚是否和网卡有关,init搭建时就有网络问题,k8s要根据默认路由网卡ip决定监听的地址。
> 但是我感觉这个场景不应该,因为既然是clusterIp,创建后提示信息就应该提示用clusterIp吧,为啥提示的用了本机的网卡ip呢。
>
> yidan zhao <hi...@gmail.com> 于2022年4月8日周五 10:38写道:
> >
> > 如下是 describe svc my-first-flink-cluster-rest 的结果:
> > Name:                     my-first-flink-cluster-rest
> > Namespace:                default
> > Labels:                   app=my-first-flink-cluster
> >                           type=flink-native-kubernetes
> > Annotations:              <none>
> > Selector:
> > app=my-first-flink-cluster,component=jobmanager,type=flink-native-kubernetes
> > Type:                     LoadBalancer
> > IP Family Policy:         SingleStack
> > IP Families:              IPv4
> > IP:                       192.168.127.57
> > IPs:                      192.168.127.57
> > Port:                     rest  8081/TCP
> > TargetPort:               8081/TCP
> > NodePort:                 rest  31419/TCP
> > Endpoints:                192.168.130.11:8081
> > Session Affinity:         None
> > External Traffic Policy:  Cluster
> > Events:                   <none>
> >
> > 如上,其中IP为192.168.127.57,这个是ClusterIp是可以访问的。我是不知道为啥创建之后提示的地址不是这个,而且通过
> > -Dkubernetes.cluster-id=my-first-flink-cluster检索到的地址也不是192那个,导致无法提交任务等。
> >
> > yu'an huang <h....@gmail.com> 于2022年4月8日周五 02:11写道:
> > >
> > > 理论上cluster ip是不可能在集群外访问的,你的Kubernetes环境是怎么搭建的呢?Minikube吗?
> > >
> > > 方便的话可以分享你运行这个命令的结果吗?
> > > 》kubectl describe svc  my-first-flink-cluster-rest
> > >
> > >
> > >
> > > > On 7 Apr 2022, at 4:44 PM, Zhanghao Chen <zh...@outlook.com> wrote:
> > > >
> > > > 你 kubernetes.rest-service.exposed.type 这个参数设置的是什么呢?
> > > >
> > > > Best,
> > > > Zhanghao Chen
> > > > ________________________________
> > > > From: yidan zhao <hi...@gmail.com>
> > > > Sent: Thursday, April 7, 2022 11:41
> > > > To: user-zh <us...@flink.apache.org>
> > > > Subject: k8s session cluster flink1.13.6创建后提示的地址啥用。
> > > >
> > > > 参考 https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/deployment/resource-providers/native_kubernetes/#starting-a-flink-session-on-kubernetes
> > > >
> > > > 基于命令创建k8s flink session集群(flink1.13.6):./bin/kubernetes-session.sh
> > > > -Dkubernetes.cluster-id=my-first-flink-cluster 。创建成功,最后提示一句 Create
> > > > flink session cluster my-first-flink-cluster successfully, JobManager
> > > > Web Interface: http://10.227.137.154:8081。但是这个地址访问不通。
> > > >
> > > > 并且通过如下命令提交任务也一样,会检索到如上地址,然后提交任务不成功。
> > > > ./bin/flink run \
> > > >    --target kubernetes-session \
> > > >    -Dkubernetes.cluster-id=my-first-flink-cluster \
> > > >    ./examples/streaming/TopSpeedWindowing.jar
> > > >
> > > > --- 然后如下方式是可以的,不清楚是啥问题呢。
> > > > 1 通过 kubectl get svc 拿到 my-first-flink-cluster-rest
> > > > 的clusterIp:port为192.168.127.57:8081。
> > > > 2 查看任务
> > > > flink list  -m 192.168.127.57:8081
> > > > 3 提交任务
> > > > flink run  -m 192.168.127.57:8081
> > > > /home/work/flink/examples/streaming/TopSpeedWindowing.jar
> > > >
> > > > --- 区别:192这个是clusterIp虚拟ip。  10.x那个是我机器ip。
> > >

Re: k8s session cluster flink1.13.6创建后提示的地址啥用。

Posted by yidan zhao <hi...@gmail.com>.
貌似官网对flink k8s情况有2个入口,分别为:
https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/deployment/resource-providers/standalone/kubernetes/#session-mode
和
https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/deployment/resource-providers/native_kubernetes/。

分别对应 Resource Providers/Standalone/Kubernetes 和 Kubernetes Resource
Providers/Native
Kubernetes。有人知道啥区别吗。从文档来看,貌似前者是给了具体的service、deployment等yml描述,然后自己创建集群。后者是脚本一键创建。但如果仅仅是这个区别,为啥有“standalone/kubernetes”和“native
kubernetes”这种区分呢?

>
> 集群是3台物理机搭建,非minikube。
> 不清楚是否和网卡有关,init搭建时就有网络问题,k8s要根据默认路由网卡ip决定监听的地址。
> 但是我感觉这个场景不应该,因为既然是clusterIp,创建后提示信息就应该提示用clusterIp吧,为啥提示的用了本机的网卡ip呢。
>
> yidan zhao <hi...@gmail.com> 于2022年4月8日周五 10:38写道:
> >
> > 如下是 describe svc my-first-flink-cluster-rest 的结果:
> > Name:                     my-first-flink-cluster-rest
> > Namespace:                default
> > Labels:                   app=my-first-flink-cluster
> >                           type=flink-native-kubernetes
> > Annotations:              <none>
> > Selector:
> > app=my-first-flink-cluster,component=jobmanager,type=flink-native-kubernetes
> > Type:                     LoadBalancer
> > IP Family Policy:         SingleStack
> > IP Families:              IPv4
> > IP:                       192.168.127.57
> > IPs:                      192.168.127.57
> > Port:                     rest  8081/TCP
> > TargetPort:               8081/TCP
> > NodePort:                 rest  31419/TCP
> > Endpoints:                192.168.130.11:8081
> > Session Affinity:         None
> > External Traffic Policy:  Cluster
> > Events:                   <none>
> >
> > 如上,其中IP为192.168.127.57,这个是ClusterIp是可以访问的。我是不知道为啥创建之后提示的地址不是这个,而且通过
> > -Dkubernetes.cluster-id=my-first-flink-cluster检索到的地址也不是192那个,导致无法提交任务等。
> >
> > yu'an huang <h....@gmail.com> 于2022年4月8日周五 02:11写道:
> > >
> > > 理论上cluster ip是不可能在集群外访问的,你的Kubernetes环境是怎么搭建的呢?Minikube吗?
> > >
> > > 方便的话可以分享你运行这个命令的结果吗?
> > > 》kubectl describe svc  my-first-flink-cluster-rest
> > >
> > >
> > >
> > > > On 7 Apr 2022, at 4:44 PM, Zhanghao Chen <zh...@outlook.com> wrote:
> > > >
> > > > 你 kubernetes.rest-service.exposed.type 这个参数设置的是什么呢?
> > > >
> > > > Best,
> > > > Zhanghao Chen
> > > > ________________________________
> > > > From: yidan zhao <hi...@gmail.com>
> > > > Sent: Thursday, April 7, 2022 11:41
> > > > To: user-zh <us...@flink.apache.org>
> > > > Subject: k8s session cluster flink1.13.6创建后提示的地址啥用。
> > > >
> > > > 参考 https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/deployment/resource-providers/native_kubernetes/#starting-a-flink-session-on-kubernetes
> > > >
> > > > 基于命令创建k8s flink session集群(flink1.13.6):./bin/kubernetes-session.sh
> > > > -Dkubernetes.cluster-id=my-first-flink-cluster 。创建成功,最后提示一句 Create
> > > > flink session cluster my-first-flink-cluster successfully, JobManager
> > > > Web Interface: http://10.227.137.154:8081。但是这个地址访问不通。
> > > >
> > > > 并且通过如下命令提交任务也一样,会检索到如上地址,然后提交任务不成功。
> > > > ./bin/flink run \
> > > >    --target kubernetes-session \
> > > >    -Dkubernetes.cluster-id=my-first-flink-cluster \
> > > >    ./examples/streaming/TopSpeedWindowing.jar
> > > >
> > > > --- 然后如下方式是可以的,不清楚是啥问题呢。
> > > > 1 通过 kubectl get svc 拿到 my-first-flink-cluster-rest
> > > > 的clusterIp:port为192.168.127.57:8081。
> > > > 2 查看任务
> > > > flink list  -m 192.168.127.57:8081
> > > > 3 提交任务
> > > > flink run  -m 192.168.127.57:8081
> > > > /home/work/flink/examples/streaming/TopSpeedWindowing.jar
> > > >
> > > > --- 区别:192这个是clusterIp虚拟ip。  10.x那个是我机器ip。
> > >

Re: k8s session cluster flink1.13.6创建后提示的地址啥用。

Posted by yidan zhao <hi...@gmail.com>.
集群是3台物理机搭建,非minikube。
不清楚是否和网卡有关,init搭建时就有网络问题,k8s要根据默认路由网卡ip决定监听的地址。
但是我感觉这个场景不应该,因为既然是clusterIp,创建后提示信息就应该提示用clusterIp吧,为啥提示的用了本机的网卡ip呢。

yidan zhao <hi...@gmail.com> 于2022年4月8日周五 10:38写道:
>
> 如下是 describe svc my-first-flink-cluster-rest 的结果:
> Name:                     my-first-flink-cluster-rest
> Namespace:                default
> Labels:                   app=my-first-flink-cluster
>                           type=flink-native-kubernetes
> Annotations:              <none>
> Selector:
> app=my-first-flink-cluster,component=jobmanager,type=flink-native-kubernetes
> Type:                     LoadBalancer
> IP Family Policy:         SingleStack
> IP Families:              IPv4
> IP:                       192.168.127.57
> IPs:                      192.168.127.57
> Port:                     rest  8081/TCP
> TargetPort:               8081/TCP
> NodePort:                 rest  31419/TCP
> Endpoints:                192.168.130.11:8081
> Session Affinity:         None
> External Traffic Policy:  Cluster
> Events:                   <none>
>
> 如上,其中IP为192.168.127.57,这个是ClusterIp是可以访问的。我是不知道为啥创建之后提示的地址不是这个,而且通过
> -Dkubernetes.cluster-id=my-first-flink-cluster检索到的地址也不是192那个,导致无法提交任务等。
>
> yu'an huang <h....@gmail.com> 于2022年4月8日周五 02:11写道:
> >
> > 理论上cluster ip是不可能在集群外访问的,你的Kubernetes环境是怎么搭建的呢?Minikube吗?
> >
> > 方便的话可以分享你运行这个命令的结果吗?
> > 》kubectl describe svc  my-first-flink-cluster-rest
> >
> >
> >
> > > On 7 Apr 2022, at 4:44 PM, Zhanghao Chen <zh...@outlook.com> wrote:
> > >
> > > 你 kubernetes.rest-service.exposed.type 这个参数设置的是什么呢?
> > >
> > > Best,
> > > Zhanghao Chen
> > > ________________________________
> > > From: yidan zhao <hi...@gmail.com>
> > > Sent: Thursday, April 7, 2022 11:41
> > > To: user-zh <us...@flink.apache.org>
> > > Subject: k8s session cluster flink1.13.6创建后提示的地址啥用。
> > >
> > > 参考 https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/deployment/resource-providers/native_kubernetes/#starting-a-flink-session-on-kubernetes
> > >
> > > 基于命令创建k8s flink session集群(flink1.13.6):./bin/kubernetes-session.sh
> > > -Dkubernetes.cluster-id=my-first-flink-cluster 。创建成功,最后提示一句 Create
> > > flink session cluster my-first-flink-cluster successfully, JobManager
> > > Web Interface: http://10.227.137.154:8081。但是这个地址访问不通。
> > >
> > > 并且通过如下命令提交任务也一样,会检索到如上地址,然后提交任务不成功。
> > > ./bin/flink run \
> > >    --target kubernetes-session \
> > >    -Dkubernetes.cluster-id=my-first-flink-cluster \
> > >    ./examples/streaming/TopSpeedWindowing.jar
> > >
> > > --- 然后如下方式是可以的,不清楚是啥问题呢。
> > > 1 通过 kubectl get svc 拿到 my-first-flink-cluster-rest
> > > 的clusterIp:port为192.168.127.57:8081。
> > > 2 查看任务
> > > flink list  -m 192.168.127.57:8081
> > > 3 提交任务
> > > flink run  -m 192.168.127.57:8081
> > > /home/work/flink/examples/streaming/TopSpeedWindowing.jar
> > >
> > > --- 区别:192这个是clusterIp虚拟ip。  10.x那个是我机器ip。
> >

Re: k8s session cluster flink1.13.6创建后提示的地址啥用。

Posted by yidan zhao <hi...@gmail.com>.
如下是 describe svc my-first-flink-cluster-rest 的结果:
Name:                     my-first-flink-cluster-rest
Namespace:                default
Labels:                   app=my-first-flink-cluster
                          type=flink-native-kubernetes
Annotations:              <none>
Selector:
app=my-first-flink-cluster,component=jobmanager,type=flink-native-kubernetes
Type:                     LoadBalancer
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       192.168.127.57
IPs:                      192.168.127.57
Port:                     rest  8081/TCP
TargetPort:               8081/TCP
NodePort:                 rest  31419/TCP
Endpoints:                192.168.130.11:8081
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>

如上,其中IP为192.168.127.57,这个是ClusterIp是可以访问的。我是不知道为啥创建之后提示的地址不是这个,而且通过
-Dkubernetes.cluster-id=my-first-flink-cluster检索到的地址也不是192那个,导致无法提交任务等。

yu'an huang <h....@gmail.com> 于2022年4月8日周五 02:11写道:
>
> 理论上cluster ip是不可能在集群外访问的,你的Kubernetes环境是怎么搭建的呢?Minikube吗?
>
> 方便的话可以分享你运行这个命令的结果吗?
> 》kubectl describe svc  my-first-flink-cluster-rest
>
>
>
> > On 7 Apr 2022, at 4:44 PM, Zhanghao Chen <zh...@outlook.com> wrote:
> >
> > 你 kubernetes.rest-service.exposed.type 这个参数设置的是什么呢?
> >
> > Best,
> > Zhanghao Chen
> > ________________________________
> > From: yidan zhao <hi...@gmail.com>
> > Sent: Thursday, April 7, 2022 11:41
> > To: user-zh <us...@flink.apache.org>
> > Subject: k8s session cluster flink1.13.6创建后提示的地址啥用。
> >
> > 参考 https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/deployment/resource-providers/native_kubernetes/#starting-a-flink-session-on-kubernetes
> >
> > 基于命令创建k8s flink session集群(flink1.13.6):./bin/kubernetes-session.sh
> > -Dkubernetes.cluster-id=my-first-flink-cluster 。创建成功,最后提示一句 Create
> > flink session cluster my-first-flink-cluster successfully, JobManager
> > Web Interface: http://10.227.137.154:8081。但是这个地址访问不通。
> >
> > 并且通过如下命令提交任务也一样,会检索到如上地址,然后提交任务不成功。
> > ./bin/flink run \
> >    --target kubernetes-session \
> >    -Dkubernetes.cluster-id=my-first-flink-cluster \
> >    ./examples/streaming/TopSpeedWindowing.jar
> >
> > --- 然后如下方式是可以的,不清楚是啥问题呢。
> > 1 通过 kubectl get svc 拿到 my-first-flink-cluster-rest
> > 的clusterIp:port为192.168.127.57:8081。
> > 2 查看任务
> > flink list  -m 192.168.127.57:8081
> > 3 提交任务
> > flink run  -m 192.168.127.57:8081
> > /home/work/flink/examples/streaming/TopSpeedWindowing.jar
> >
> > --- 区别:192这个是clusterIp虚拟ip。  10.x那个是我机器ip。
>

Re: k8s session cluster flink1.13.6创建后提示的地址啥用。

Posted by yu'an huang <h....@gmail.com>.
理论上cluster ip是不可能在集群外访问的,你的Kubernetes环境是怎么搭建的呢?Minikube吗?

方便的话可以分享你运行这个命令的结果吗?
》kubectl describe svc  my-first-flink-cluster-rest



> On 7 Apr 2022, at 4:44 PM, Zhanghao Chen <zh...@outlook.com> wrote:
> 
> 你 kubernetes.rest-service.exposed.type 这个参数设置的是什么呢?
> 
> Best,
> Zhanghao Chen
> ________________________________
> From: yidan zhao <hi...@gmail.com>
> Sent: Thursday, April 7, 2022 11:41
> To: user-zh <us...@flink.apache.org>
> Subject: k8s session cluster flink1.13.6创建后提示的地址啥用。
> 
> 参考 https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/deployment/resource-providers/native_kubernetes/#starting-a-flink-session-on-kubernetes
> 
> 基于命令创建k8s flink session集群(flink1.13.6):./bin/kubernetes-session.sh
> -Dkubernetes.cluster-id=my-first-flink-cluster 。创建成功,最后提示一句 Create
> flink session cluster my-first-flink-cluster successfully, JobManager
> Web Interface: http://10.227.137.154:8081。但是这个地址访问不通。
> 
> 并且通过如下命令提交任务也一样,会检索到如上地址,然后提交任务不成功。
> ./bin/flink run \
>    --target kubernetes-session \
>    -Dkubernetes.cluster-id=my-first-flink-cluster \
>    ./examples/streaming/TopSpeedWindowing.jar
> 
> --- 然后如下方式是可以的,不清楚是啥问题呢。
> 1 通过 kubectl get svc 拿到 my-first-flink-cluster-rest
> 的clusterIp:port为192.168.127.57:8081。
> 2 查看任务
> flink list  -m 192.168.127.57:8081
> 3 提交任务
> flink run  -m 192.168.127.57:8081
> /home/work/flink/examples/streaming/TopSpeedWindowing.jar
> 
> --- 区别:192这个是clusterIp虚拟ip。  10.x那个是我机器ip。


Re: k8s session cluster flink1.13.6创建后提示的地址啥用。

Posted by Zhanghao Chen <zh...@outlook.com>.
你 kubernetes.rest-service.exposed.type 这个参数设置的是什么呢?

Best,
Zhanghao Chen
________________________________
From: yidan zhao <hi...@gmail.com>
Sent: Thursday, April 7, 2022 11:41
To: user-zh <us...@flink.apache.org>
Subject: k8s session cluster flink1.13.6创建后提示的地址啥用。

参考 https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/deployment/resource-providers/native_kubernetes/#starting-a-flink-session-on-kubernetes

基于命令创建k8s flink session集群(flink1.13.6):./bin/kubernetes-session.sh
-Dkubernetes.cluster-id=my-first-flink-cluster 。创建成功,最后提示一句 Create
flink session cluster my-first-flink-cluster successfully, JobManager
Web Interface: http://10.227.137.154:8081。但是这个地址访问不通。

并且通过如下命令提交任务也一样,会检索到如上地址,然后提交任务不成功。
./bin/flink run \
    --target kubernetes-session \
    -Dkubernetes.cluster-id=my-first-flink-cluster \
    ./examples/streaming/TopSpeedWindowing.jar

--- 然后如下方式是可以的,不清楚是啥问题呢。
1 通过 kubectl get svc 拿到 my-first-flink-cluster-rest
的clusterIp:port为192.168.127.57:8081。
2 查看任务
flink list  -m 192.168.127.57:8081
3 提交任务
flink run  -m 192.168.127.57:8081
/home/work/flink/examples/streaming/TopSpeedWindowing.jar

--- 区别:192这个是clusterIp虚拟ip。  10.x那个是我机器ip。