home-pvc

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: ubuntu-home
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: "500Gi"
  volumeName: 
  storageClassName: nfs

ubuntu-createusers-config

创建用户格式为:用户名:密码是:否有sudo权限

apiVersion: v1
kind: ConfigMap
metadata:
  name: ubuntu-createusers
data:
  createusers.txt: |
        admin:123456:Y

Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: ubuntu-1904
spec:
  replicas: 1
  selector:
    matchLabels:
      name: ubuntu-1904
  template:
    metadata:
      labels:
        name: ubuntu-1904
    spec:
      containers:
      - name: ubuntu-1904
        image: rattydave/docker-ubuntu-xrdp-mate-custom:19.04
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 3389
          name: rdp
        env:
        - name: privileged
          value: "true"
        volumeMounts:
        - name: home-pvc
          mountPath: /home
        volumeMounts:
        - name: createusers
          mountPath: /root/createusers.txt
      volumes:
       - name: home-pvc
         persistentVolumeClaim:
           claimName: ubuntu-home
      volumes:
      - name: createusers
        configMap:
          name: ubuntu-createusers

svc

kind: Service
apiVersion: v1
metadata:
  name: ubuntu-rdp
spec:
  type: NodePort
  ports:
  - name: vnc
    port: 3389
    nodePort: 30084
    targetPort: 3389
    protocol: TCP
  selector:
    name: ubuntu-1904

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code