mirror of
https://github.com/google/nomulus
synced 2026-01-03 11:45:39 +00:00
nodeSelector can limit scheduling capabilities of k8s, which leads to delays in assigning new workloads. Since we do not require and particular machine for execution it can be removed.
88 lines
1.9 KiB
YAML
88 lines
1.9 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: backend
|
|
annotations:
|
|
tag: "latest"
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
service: backend
|
|
template:
|
|
metadata:
|
|
labels:
|
|
service: backend
|
|
spec:
|
|
serviceAccountName: nomulus
|
|
containers:
|
|
- name: backend
|
|
image: gcr.io/GCP_PROJECT/nomulus
|
|
ports:
|
|
- containerPort: 8080
|
|
name: http
|
|
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: "1Gi"
|
|
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: backend
|
|
---
|
|
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: backend
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: backend
|
|
minReplicas: 2
|
|
maxReplicas: 5
|
|
metrics:
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: 80
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: backend
|
|
spec:
|
|
selector:
|
|
service: backend
|
|
ports:
|
|
- port: 80
|
|
targetPort: http
|
|
name: http
|
|
---
|
|
apiVersion: net.gke.io/v1
|
|
kind: ServiceExport
|
|
metadata:
|
|
name: backend
|