1
0
mirror of https://github.com/google/nomulus synced 2026-01-03 11:45:39 +00:00
Files
nomulus/jetty/kubernetes/nomulus-pubapi.yaml
Pavlo Tkach 18614ba11e Update resource allocation for all Nomulus GKE deployments (#2796)
ALl deployments received update to averageUtilization cpu. This should allow us to stay ahead of the curve of traffic and create instances before we cpu reached the limit.
Frontend cpu allocation has caused "noise neighbors" problem with pods assigned to nodes where there's not enough bursting capacity, so I increased it.
Adjusted rest of the deployments according to their utilization.
2025-08-08 17:55:08 +00:00

97 lines
2.1 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: pubapi
annotations:
tag: "latest"
spec:
selector:
matchLabels:
service: pubapi
template:
metadata:
labels:
service: pubapi
spec:
serviceAccountName: nomulus
containers:
- name: pubapi
image: gcr.io/GCP_PROJECT/nomulus
ports:
- containerPort: 8080
name: http
startupProbe:
httpGet:
port: 8080
path: /ready/pubapi
initialDelaySeconds: 1
timeoutSeconds: 60
successThreshold: 1
failureThreshold: 3
periodSeconds: 30
resources:
requests:
# explicit pod-slots 0 is required in order to downgrade node
# class from performance, which has implicit pod-slots 1
cloud.google.com/pod-slots: 0
cpu: "500m"
memory: "1Gi"
limits:
# explicit pod-slots 0 is required in order to downgrade node
# class from performance, which has implicit pod-slots 1
cloud.google.com/pod-slots: 0
cpu: "1000m"
memory: "2Gi"
args: [ENVIRONMENT]
env:
- name: POD_ID
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: JETTY_WORKER_INSTANCE
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NAMESPACE_ID
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: CONTAINER_NAME
value: pubapi
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: pubapi
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: pubapi
minReplicas: 5
maxReplicas: 15
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80
---
apiVersion: v1
kind: Service
metadata:
name: pubapi
spec:
selector:
service: pubapi
ports:
- port: 80
targetPort: http
name: http
---
apiVersion: net.gke.io/v1
kind: ServiceExport
metadata:
name: pubapi