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 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:6e0707e2deb796718f432f111cfa96afb60c890ec74c7dc5ab4e7c0ed7904991 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