---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: student-frontend
  namespace: academia
  labels:
    app: student-frontend
spec:
  replicas: 1
  selector:
    matchLabels:
      app: student-frontend
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  template:
    metadata:
      labels:
        app: student-frontend
    spec:
      nodeSelector:
        kubernetes.io/hostname: hp62a
      containers:
        - name: frontend
          image: student-frontend:latest
          imagePullPolicy: Never
          ports:
            - containerPort: 80
              name: http
          resources:
            requests:
              memory: "32Mi"
              cpu: "10m"
            limits:
              memory: "64Mi"
              cpu: "100m"
          livenessProbe:
            httpGet:
              path: /
              port: 80
            initialDelaySeconds: 10
            periodSeconds: 60
          readinessProbe:
            httpGet:
              path: /
              port: 80
            initialDelaySeconds: 5
            periodSeconds: 10
          securityContext:
            runAsNonRoot: false
            allowPrivilegeEscalation: false
---
apiVersion: v1
kind: Service
metadata:
  name: student-frontend
  namespace: academia
spec:
  selector:
    app: student-frontend
  ports:
    - port: 80
      targetPort: 80
      name: http
  type: ClusterIP
