rancher下管理flink

rancher下管理flink,第1张

rancher下管理flink 编排文件3个 jobmanager-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: flink-jobmanager
  namespace: flink
  labels:
    app: flink
    component: jobmanager
spec:
  replicas: 1
  selector:
    matchLabels:
      app: flink
      component: jobmanager
  template:
    metadata:
      labels:
        app: flink
        component: jobmanager
    spec:
      containers:
      - name: jobmanager
        #image: flink:1.8-scala_2.11
        image: 192.168.5.40:5000/qsc/flink:1.8
        args:
        - jobmanager
        ports:
        - containerPort: 6123
          name: rpc
        - containerPort: 6124
          name: blob
        - containerPort: 6125
          name: query
        - containerPort: 8081
          name: ui
        env:
        - name: JOB_MANAGER_RPC_ADDRESS
          value: flink-jobmanager

jobmanager-service.yaml
apiVersion: v1
kind: Service
metadata:
  name: flink-jobmanager
  namespace: flink
  labels:
    app: flink
spec:
  type: NodePort
  ports:
  - name: rpc
    port: 6123
    nodePort: 6123
  - name: blob
    port: 6124
  - name: query
    port: 6125
  - name: ui
    port: 8081
    nodePort: 8081
  selector:
    app: flink
    component: jobmanager

taskmanager-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: flink-taskmanager
  namespace: flink
  labels:
    app: flink
    component: taskmanager
spec:
  replicas: 2
  selector:
    matchLabels:
      app: flink
  template:
    metadata:
      labels:
        app: flink
        component: taskmanager
    spec:
      containers:
      - name: taskmanager
        image: 192.168.5.40:5000/qsc/flink:1.8
        args:
        - taskmanager
        - "-Dtaskmanager.host=$(K8S_POD_IP)"
        ports:
        - containerPort: 6121
          name: data
        - containerPort: 6122
          name: rpc
        - containerPort: 6125
          name: query
        env:
        - name: JOB_MANAGER_RPC_ADDRESS
          value: flink-jobmanager
        - name: K8S_POD_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP

备注

1.配置文件:image: flink:1.8-scala_2.11,无需上传tar包
2.配置文件:image: 192.168.5.40:5000/qsc/flink:1.8 ,先将flink的tar包加载进docker,再打标签,再传至docker仓库
附件:flink的tar包

「flink的tar包」,点击链接保存,或者复制本段内容,打开「阿里云盘」APP ,无需下载极速在线查看,视频原画倍速播放。
链接:https://www.aliyundrive.com/s/tRRc2hoaxx9
depoly.sh 文件
kubectl create -f jobmanager-service.yaml
kubectl create -f jobmanager-deployment.yaml
kubectl create -f taskmanager-deployment.yaml

给权限
chmod 777 depoly.sh
创建命名空间

先rancher页面添加命名空间 flink
后虚拟机执行命令

kubectl --namespace flink create serviceaccount flink-acc
kubectl --namespace flink create clusterrolebinding flink-acc-clusterrolebinding --clusterrole=cluster-admin --serviceaccount=flink:flink-acc
执行
./depoly.sh
rancher 页面

docker传镜像命令
1.sudo docker load -i ***.tar
2.sudo docker tag 上传的tar 仓库位置:仓库端口号/上传的tar
3.sudo docker push  仓库位置:仓库端口号/上传的tar
docker私有仓库安装

1.创建文件夹,在/home/ubuntu/路径下:

 mkdir registry

2.命令1

sudo docker run -d -p 5000:5000 --restart=always --name registry 
-v /home/ubuntu/registry:/var/lib/registry registry:2

3.命令2

sudo docker run -d -p 5001:8080 --restart=always --name registry-web --link registry 
-e REGISTRY_URL=http://registry:5000/v2 -e REGISTRY_NAME=localhost:5000 
hyper/docker-registry-web

3.重启docker

sudo systemctl daemon-reload
sudo systemctl restart docker.service

4.查看进程

netstat -lntp | grep 5000

5.页面查看

ip:5000//v2/_catalog
ip:5001

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5636962.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存