apiVersion: apps/v1
kind: Deployment
metadata:
  name: mkm-admin
  labels:
    app: mkm-admin
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mkm-admin
  template:
    metadata:
      labels:
        app: mkm-admin
    spec:
      containers:
      - name: mkm-admin
        image: localhost/mkm-admin:latest
        imagePullPolicy: Never
        ports:
        - containerPort: 8000
        envFrom:
        - configMapRef:
            name: mkm-admin-config
        resources:
          requests:
            cpu: "100m"
            memory: "128Mi"
          limits:
            cpu: "500m"
            memory: "512Mi"
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mkm-admin-worker
  labels:
    app: mkm-admin
    component: worker
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mkm-admin
      component: worker
  template:
    metadata:
      labels:
        app: mkm-admin
        component: worker
    spec:
      containers:
      - name: worker
        image: localhost/mkm-admin:latest
        imagePullPolicy: Never
        command: ["php", "artisan", "horizon"]
        envFrom:
        - configMapRef:
            name: mkm-admin-config
        resources:
          requests:
            cpu: "100m"
            memory: "128Mi"
          limits:
            cpu: "500m"
            memory: "512Mi"
---
apiVersion: v1
kind: Service
metadata:
  name: mkm-admin-service
spec:
  selector:
    app: mkm-admin
  ports:
    - protocol: TCP
      port: 80
      targetPort: 8000
  type: ClusterIP
