apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend
  labels:
    app: frontend
    {{- include "common.labels" . | nindent 4 }}
spec:
  replicas: 2
  selector:
    matchLabels:
      app: frontend
      {{- include "common.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app: frontend
        {{- include "common.selectorLabels" . | nindent 8 }}
    spec:
      containers:
        - image: {{ .Values.images.frontend }}
          name: frontend
          resources:
            requests:
              cpu: "0.2"
              memory: 64Mi
            limits:
              cpu: "0.6"
              memory: 192Mi
          ports:
            - containerPort: 8080
      imagePullSecrets:
        - name: ghcr
---
apiVersion: v1
kind: Service
metadata:
  name: frontend
  labels:
    app: frontend
    {{- include "common.labels" . | nindent 4 }}
spec:
  ports:
  - port: 80
    targetPort: 8080
    protocol: TCP
  selector:
    app: frontend
    {{- include "common.selectorLabels" . | nindent 4 }}