Files
k8s/apps/naviya/50-api.yaml
T

113 lines
3.0 KiB
YAML

apiVersion: v1
kind: Service
metadata:
name: application-metier-api
namespace: application-metier
spec:
ports:
- name: http
port: 8080
targetPort: http
selector:
app.kubernetes.io/name: application-metier
app.kubernetes.io/component: api
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: application-metier-api
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: api
template:
metadata:
labels:
app.kubernetes.io/name: application-metier
app.kubernetes.io/component: api
app.kubernetes.io/part-of: application-metier
spec:
automountServiceAccountToken: false
terminationGracePeriodSeconds: 30
securityContext:
runAsNonRoot: true
runAsUser: 65532
runAsGroup: 65532
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: api
containers:
- name: api
image: git.guillin.ovh/baptiste/application-metier/api@sha256:ac01821f84a2413c6f34589f0f88dc54d4eb6188a0cd9c82267d092a3090b500
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 8080
envFrom:
- configMapRef:
name: application-metier-config
- secretRef:
name: application-metier-secrets
startupProbe:
httpGet:
path: /livez
port: http
periodSeconds: 2
failureThreshold: 30
livenessProbe:
httpGet:
path: /livez
port: http
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
readinessProbe:
httpGet:
path: /readyz
port: http
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: application-metier-api
namespace: application-metier
spec:
minAvailable: 1
selector:
matchLabels:
app.kubernetes.io/name: application-metier
app.kubernetes.io/component: api