# 7900 密码:secret
apiVersion: apps/v1
kind: Deployment
metadata:
  name: sys-selenium-chrome
  namespace: xfqh
  labels:
    app: sys-selenium-chrome
spec:
  replicas: 1
  selector:
    matchLabels:
      app: sys-selenium-chrome
  template:
    metadata:
      labels:
        app: sys-selenium-chrome
    spec:
      securityContext:
        runAsUser: 1000
        runAsGroup: 502
        fsGroup: 502
      hostname: sys-selenium-chrome
      hostAliases:
        - ip: "172.16.0.5"
          hostnames:
            - "xfqhapp.dev.daline.com.cn"
      containers:
        - name: sys-selenium-chrome
          image: dockerhub.daline.com.cn/selenium/standalone-chrome:108.0
          volumeMounts:
            - name: shm
              mountPath: /dev/shm
            - name: localtime
              mountPath: /etc/localtime
              readOnly: true
            - name: resolv
              mountPath: /etc/resolv.conf
              readOnly: true
          ports:
            - containerPort: 4444
              name: "server"
            - containerPort: 7900
              name: "gui"
          resources:
            requests:
              memory: 2Gi
            limits:
              memory: 4Gi
      volumes:
        - name: shm
          hostPath:
            path: "/dev/shm"
        - name: localtime
          hostPath:
            path: "/etc/localtime"
        - name: resolv
          hostPath:
            path: "/etc/resolv.conf"

---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: sys-selenium-chrome
  name: sys-selenium-chrome
  namespace: xfqh
spec:
  type: NodePort
  ports:
    - port: 4444
      targetPort: 4444
      nodePort: 4445
      name: "server"
    - port: 7900
      targetPort: 7900
      nodePort: 7901
      name: "gui"
  selector:
    app: sys-selenium-chrome
