apiVersion: apps/v1
kind: Deployment
metadata:
  name: sparkyfitness-frontend
  labels:
    app.kubernetes.io/name: sparkyfitness
    app.kubernetes.io/instance: sparkyfitness
    app.kubernetes.io/managed-by: Helm
    helm.sh/chart: sparkyfitness-0.16.5-7
    app.kubernetes.io/component: frontend
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: sparkyfitness
      app.kubernetes.io/instance: sparkyfitness
      app.kubernetes.io/component: frontend
  template:
    metadata:
      labels:
        app.kubernetes.io/name: sparkyfitness
        app.kubernetes.io/instance: sparkyfitness
        app.kubernetes.io/component: frontend
    spec:
      serviceAccountName: sparkyfitness-frontend
      securityContext:
        runAsNonRoot: false
        seccompProfile:
          type: RuntimeDefault
      containers:
        - name: frontend
          image: ghcr.io/codewithcj/sparkyfitness-frontend:v0.16.6.2@sha256:03c27a5e81d666996043f867c2140fbb35e38e07994592fb527ab86a6c808f48
          imagePullPolicy: IfNotPresent
          ports:
            - name: http
              containerPort: 80
              protocol: TCP
          livenessProbe:
            failureThreshold: 5
            httpGet:
              path: /
              port: http
            initialDelaySeconds: 10
            periodSeconds: 10
            timeoutSeconds: 10
          readinessProbe:
            httpGet:
              path: /
              port: http
            initialDelaySeconds: 5
            periodSeconds: 5
            timeoutSeconds: 10
          env:
            - name: SPARKY_FITNESS_FRONTEND_URL
              value: "https://sparkyfitness.alexlebens.net"
            - name: SPARKY_FITNESS_SERVER_HOST
              value: sparkyfitness-server
            - name: SPARKY_FITNESS_SERVER_PORT
              value: "3010"
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              add:
                - CHOWN
                - NET_BIND_SERVICE
                - SETGID
                - SETUID
              drop:
                - ALL
            readOnlyRootFilesystem: true
          resources:
            limits: {}
            requests:
              cpu: 10m
              memory: 40Mi
          volumeMounts:
            - name: tmp
              mountPath: /tmp
            - name: nginx-cache
              mountPath: /var/cache/nginx
            - name: nginx-run
              mountPath: /var/run
            - name: nginx-conf
              mountPath: /etc/nginx/conf.d
      volumes:
        - name: tmp
          emptyDir: {}
        - name: nginx-cache
          emptyDir: {}
        - name: nginx-run
          emptyDir: {}
        - name: nginx-conf
          emptyDir: {}
