mirror of
https://github.com/google/nomulus
synced 2025-12-23 06:15:42 +00:00
149 lines
3.7 KiB
YAML
149 lines
3.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: frontend
|
|
annotations:
|
|
tag: "latest"
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
service: frontend
|
|
template:
|
|
metadata:
|
|
labels:
|
|
service: frontend
|
|
spec:
|
|
serviceAccountName: nomulus
|
|
nodeSelector:
|
|
cloud.google.com/machine-family: c4
|
|
containers:
|
|
- name: frontend
|
|
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: "600m"
|
|
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: frontend
|
|
- name: EPP
|
|
image: gcr.io/GCP_PROJECT/proxy
|
|
ports:
|
|
- containerPort: 30002
|
|
name: epp
|
|
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: "600m"
|
|
memory: "512Mi"
|
|
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: [--env, PROXY_ENV, --log, --local]
|
|
env:
|
|
- name: POD_ID
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
- name: NAMESPACE_ID
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
- name: CONTAINER_NAME
|
|
value: EPP
|
|
---
|
|
# Only need to define the service account once per cluster.
|
|
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: nomulus
|
|
annotations:
|
|
iam.gke.io/gcp-service-account: "nomulus-service-account@GCP_PROJECT.iam.gserviceaccount.com"
|
|
---
|
|
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: frontend
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: frontend
|
|
minReplicas: 12
|
|
maxReplicas: 16
|
|
metrics:
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: 80
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: frontend
|
|
spec:
|
|
selector:
|
|
service: frontend
|
|
ports:
|
|
- port: 80
|
|
targetPort: http
|
|
name: http
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: EPP
|
|
annotations:
|
|
cloud.google.com/l4-rbs: enabled
|
|
networking.gke.io/weighted-load-balancing: pods-per-node
|
|
networking.gke.io/load-balancer-ip-addresses: "EPP-ipv6-main,EPP-ipv4-main"
|
|
spec:
|
|
type: LoadBalancer
|
|
# Traffic is directly delivered to a node, preserving the original source IP.
|
|
externalTrafficPolicy: Local
|
|
ipFamilies: [IPv4, IPv6]
|
|
ipFamilyPolicy: RequireDualStack
|
|
selector:
|
|
service: frontend
|
|
ports:
|
|
- port: 700
|
|
targetPort: epp
|
|
name: epp
|
|
---
|
|
apiVersion: net.gke.io/v1
|
|
kind: ServiceExport
|
|
metadata:
|
|
name: frontend
|