apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-server-base-master
  namespace: kube-system
  labels:
    app: api-server-base-master
spec:
  replicas: 1
  selector:
    matchLabels:
      app: api-server-base-master
  template:
    metadata:
      labels:
        app: api-server-base-master
    spec:
      serviceAccountName: api-server-base
      containers:
        - name: api-server-base-master
          image: yogawulala/k8s-api-server-base:latest
          imagePullPolicy: Always
          resources:
            requests:
              cpu: "2"
              memory: "1024M"
          command: ["python"]
          args: ["/main.py"]
          env:
            - name: LISTEN_IP
              value: "0.0.0.0"
            - name: LISTEN_PORT
              value: "8080"
            - name: DEVELOPE
              value: "true"
            - name: DEBUG
              value: "true"
            - name: LOG_LEVEL
              value: "INFO"
          volumeMounts:
            - name: log-dir
              mountPath: /log
            - name: program-file
              mountPath: /main.py
            - name: pkg-dir
              mountPath: /pkg
            - name: deploy-yaml-dir
              mountPath: /deploy
      volumes:
        - name: log-dir
          hostPath:
            type: DirectoryOrCreate
            path: /etc/api-server-base/log
        - name: program-file
          hostPath:
            type: File
            path: /etc/api-server-base/src/master/main.py
        - name: pkg-dir
          hostPath:
            type: Directory
            path: /etc/api-server-base/pkg
        - name: deploy-yaml-dir
          hostPath:
            type: Directory
            path: /etc/api-server-base/deploy
