Files
Job-Info/k8s-frontend-deployment.yaml
T
aewing 42ff3e8f33
Build & Deploy / Test & Lint (push) Has been cancelled
Build & Deploy / Security Scan (push) Has been cancelled
Code Quality / Code Quality Checks (push) Has been cancelled
Code Quality / Dependency Vulnerabilities (push) Has been cancelled
Code Quality / Performance Testing (push) Has been cancelled
Build & Deploy / Build Docker Images (push) Has been cancelled
Build & Deploy / Deploy to Kubernetes (push) Has been cancelled
Add Mode6Test: copy of Mode5Test running on port 3000
2026-01-20 13:43:29 +00:00

204 lines
4.0 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: job-info-frontend
namespace: job-info
labels:
app: job-info
component: frontend
version: v1
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: job-info
component: frontend
template:
metadata:
labels:
app: job-info
component: frontend
version: v1
spec:
serviceAccountName: job-info-frontend
containers:
- name: frontend
image: job-info-frontend:latest
imagePullPolicy: Always
ports:
- name: http
containerPort: 5173
protocol: TCP
env:
- name: NODE_ENV
value: "production"
- name: VITE_API_URL
valueFrom:
configMapKeyRef:
name: frontend-config
key: api-url
- name: VITE_OAUTH_REDIRECT_URI
valueFrom:
configMapKeyRef:
name: frontend-config
key: oauth-redirect-uri
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 200m
memory: 256Mi
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 10
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 2
securityContext:
runAsNonRoot: true
runAsUser: 1000
allowPrivilegeEscalation: false
readOnlyRootFilesystem: false
capabilities:
drop:
- ALL
nodeSelector:
kubernetes.io/os: linux
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- job-info
topologyKey: kubernetes.io/hostname
---
apiVersion: v1
kind: Service
metadata:
name: job-info-frontend
namespace: job-info
labels:
app: job-info
component: frontend
spec:
type: LoadBalancer
ports:
- name: http
port: 80
targetPort: http
protocol: TCP
selector:
app: job-info
component: frontend
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: job-info-frontend
namespace: job-info
labels:
app: job-info
component: frontend
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: job-info-frontend
namespace: job-info
spec:
minAvailable: 1
selector:
matchLabels:
app: job-info
component: frontend
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: job-info-frontend
namespace: job-info
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: job-info-frontend
minReplicas: 2
maxReplicas: 5
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: job-info-frontend
namespace: job-info
spec:
podSelector:
matchLabels:
app: job-info
component: frontend
policyTypes:
- Ingress
- Egress
ingress:
- from:
- namespaceSelector:
matchLabels:
name: ingress-nginx
ports:
- protocol: TCP
port: 5173
egress:
- to:
- podSelector:
matchLabels:
app: job-info
component: backend
ports:
- protocol: TCP
port: 3005
- to:
- namespaceSelector: {}
ports:
- protocol: TCP
port: 53
- protocol: UDP
port: 53