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-jobmanagerjobmanager-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: jobmanagertaskmanager-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/tRRc2hoaxx9depoly.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.shrancher 页面 docker传镜像命令
1.sudo docker load -i ***.tar 2.sudo docker tag 上传的tar 仓库位置:仓库端口号/上传的tar 3.sudo docker push 仓库位置:仓库端口号/上传的tardocker私有仓库安装
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
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)