在Ubuntu K8s中创建vnc用于浏览器调试

拉取vnc镜像:

ctr -n k8s.io image pull docker.io/dorowu/ubuntu-desktop-lxde-vnc:latest --platform:linux/amd64

(导出成镜像包)

ctr -n k8s.io image pull docker.io/dorowu/ubuntu-desktop-lxde-vnc:latest --platform:linux/amd64

deployment

apiVersion: apps/v1
kind: Deployment
metadata:name: ubuntu-desktopnamespace: dmcca-system
spec:replicas: 1selector:matchLabels:app: ubuntu-desktoptemplate:metadata:labels:app: ubuntu-desktopspec:containers:- name: ubuntu-desktopimage: dorowu/ubuntu-desktop-lxde-vnc:latestports:- containerPort: 80- containerPort: 5900

svc

apiVersion: v1
kind: Service
metadata:name: ubuntu-desktop-servicenamespace: dmcca-system
spec:type: NodePortselector:app: ubuntu-desktopports:- protocol: TCPport: 80targetPort: 80name: webui- protocol: TCPport: 5900targetPort: 5900name: cli

通过浏览器访问svc分配的nodePort端口访问vnc