k8s部署rustdesk

 因为市面上的treamview,todesk,向日葵收费,数据安全问题,免费版的画质太差,用户体验很不好,并且个人版商用会被收到律师函,应领导要求要部署到公网k8s集群里,用于公司远程访问使用,哎

废话不多说直接上yaml

rustdesk-deploy.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: rustdesk-server
  namespace: data
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rustdesk-server
  template:
    metadata:
      labels:
        app: rustdesk-server
    spec:
      nodeSelector:
        data: enable
      containers:
        - name: hbbr
          env:
            - name: TZ
              value: Asia/Shanghai
          image: rustdesk/rustdesk-server:latest
          command: ["hbbr"]
          ports:
          - containerPort: 21117
            name: hbbr
            protocol: TCP
          livenessProbe:
            failureThreshold: 3
            initialDelaySeconds: 20
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: hbbr
            timeoutSeconds: 2
          readinessProbe:
            failureThreshold: 3
            initialDelaySeconds: 20
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: hbbr
            timeoutSeconds: 2
          volumeMounts:
            - name: shared-root
              mountPath: /root
          resources:
            limits:
              cpu: 1000m
              memory: 2000Mi
            requests:
              cpu: 500m
              memory: 1000Mi
        - name: hbbs
          env:
            - name: TZ
              value: Asia/Shanghai
          image: rustdesk/rustdesk-server:latest
          command: ["hbbs", "-r", "rustdesk-server.data.svc.cluster.local:21117"]
          ports:
          - containerPort: 21115
            name: hbbs
            protocol: TCP
          - containerPort: 21116
            name: hbbs2
            protocol: TCP
          - containerPort: 21116
            name: hbbs3
            protocol: UDP
          livenessProbe:
            failureThreshold: 3
            initialDelaySeconds: 10
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: hbbs
            timeoutSeconds: 2
          readinessProbe:
            failureThreshold: 3
            initialDelaySeconds: 10
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: hbbs
            timeoutSeconds: 2
          volumeMounts:
            - name: shared-root
              mountPath: /root
          resources:
            limits:
              cpu: 1000m
              memory: 2000Mi
            requests:
              cpu: 500m
              memory: 1000Mi
      volumes:
        - name: shared-root
          emptyDir: {}

rustdesk-svc.yaml

apiVersion: v1
kind: Service
metadata:
  name: rustdesk-server
  namespace: data
spec:
  type: NodePort
  selector:
    app: rustdesk-server
  ports:
    - name: hbbs
      port: 21115
      targetPort: 21115
      protocol: TCP
    - name: hbbs2
      port: 21116
      targetPort: 21116
      nodePort: 21116
      protocol: TCP
    - name: hbbs3
      port: 21116
      nodePort: 21116
      targetPort: 21116
      protocol: UDP
    - name: hbbr
      port: 21117
      nodePort: 21117
      targetPort: 21117
      protocol: TCP

rustdesk-ingressroute.yml

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: rustdesk-server
  namespace: data
  labels:
    ingress: rustdesk-server
spec:
  entryPoints:
  - http
  - https
  routes:
    - match: Host(`rustdesk-hbbs.xxxx`)
      kind: Rule
      services:
        - name: rustdesk-server
          namespace: data
          port: 21116
    - match: Host(`rustdesk-hbbr.xxxx`)
      kind: Rule
      services:
        - name: rustdesk-server
          namespace: data
          port: 21117
  tls:
    certResolver: xxxxx

记得开通21116的TCP/UDP还有21117的TCP端口权限

然后就可以在rustdesk里通过域名使用自定义中继啦,效果嘎嘎好,画面清晰速度快

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值