personal-lifecycle-tracker / k8s / frontend.yaml
frontend.yaml
Raw
apiVersion: apps/v1
kind: Deployment
metadata:
  name: lifecycle-frontend
  labels:
    app: lifecycle-frontend
spec:
  replicas: 1
  selector:
    matchLabels:
      app: lifecycle-frontend
  template:
    metadata:
      labels:
        app: lifecycle-frontend
    spec:
      containers:
        - name: frontend
          image: personal-lifecycle-frontend:latest
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 80
          env:
            - name: BACKEND_URL
              value: http://lifecycle-backend:8000
          readinessProbe:
            httpGet:
              path: /health
              port: 80
            initialDelaySeconds: 5
            periodSeconds: 5
          livenessProbe:
            httpGet:
              path: /health
              port: 80
            initialDelaySeconds: 10
            periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: lifecycle-frontend
  labels:
    app: lifecycle-frontend
spec:
  type: NodePort
  selector:
    app: lifecycle-frontend
  ports:
    - port: 80
      targetPort: 80
      nodePort: 30088