Files
k8s/apps/naviya/60-frontend.yaml
T

122 lines
3.3 KiB
YAML

apiVersion: v1
kind: Service
metadata:
name: application-metier-frontend
namespace: application-metier
spec:
ports:
- name: http
port: 8080
targetPort: http
selector:
app.kubernetes.io/name: application-metier
app.kubernetes.io/component: frontend
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: application-metier-frontend
namespace: application-metier
spec:
replicas: 2
revisionHistoryLimit: 5
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
selector:
matchLabels:
app.kubernetes.io/name: application-metier
app.kubernetes.io/component: frontend
template:
metadata:
labels:
app.kubernetes.io/name: application-metier
app.kubernetes.io/component: frontend
app.kubernetes.io/part-of: application-metier
spec:
automountServiceAccountToken: false
terminationGracePeriodSeconds: 20
securityContext:
runAsNonRoot: true
runAsUser: 101
runAsGroup: 101
fsGroup: 101
fsGroupChangePolicy: OnRootMismatch
seccompProfile:
type: RuntimeDefault
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
app.kubernetes.io/name: application-metier
app.kubernetes.io/component: frontend
containers:
- name: frontend
image: git.guillin.ovh/baptiste/application-metier/frontend@sha256:ea245a3e30b1fc7bcad86a9f7b9d0b76c19c21414b9ae5f8df4eb26173a1a39a
imagePullPolicy: IfNotPresent
command: ["nginx"]
args: ["-g", "daemon off;"]
ports:
- name: http
containerPort: 8080
startupProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 2
failureThreshold: 30
livenessProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
readinessProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
resources:
requests:
cpu: 25m
memory: 32Mi
limits:
cpu: 150m
memory: 128Mi
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
volumeMounts:
- name: nginx-cache
mountPath: /var/cache/nginx
- name: tmp
mountPath: /tmp
volumes:
- name: nginx-cache
emptyDir: {}
- name: tmp
emptyDir: {}
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: application-metier-frontend
namespace: application-metier
spec:
minAvailable: 1
selector:
matchLabels:
app.kubernetes.io/name: application-metier
app.kubernetes.io/component: frontend