blob: 680055b8fabd3c6fdc484f86a47cf34037875420 [file] [log] [blame]
kind: Service
apiVersion: v1
metadata:
name: gold-{{.INSTANCE_ID}}-diffserver
labels:
app: gold-{{.INSTANCE_ID}}-diffserver
spec:
ports:
- name: grpc
port: 8000
- name: http
port: 8001
- name: metrics
port: 20000
selector:
app: gold-{{.INSTANCE_ID}}-diffserver
type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gold-{{.INSTANCE_ID}}-diffserver
spec:
replicas: 1
selector:
matchLabels:
app: gold-{{.INSTANCE_ID}}-diffserver # Label selector that determines which Pods belong to the StatefulSet
# Must match spec: template: metadata: labels
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: gold-{{.INSTANCE_ID}}-diffserver # Pod template's label selector
appgroup: gold-{{.INSTANCE_ID}}
annotations:
prometheus.io.scrape: "true"
prometheus.io.port: "20000"
spec:
automountServiceAccountToken: false
securityContext:
runAsUser: 2000 # aka skia
fsGroup: 2000 # aka skia
containers:
- name: gold-diffserver
image: {{.DIFF_SERVER_IMAGE}}
args:
- "--cache_size={{.DIFFSERVER_CACHE_SIZE}}"
- "--fs_namespace={{.FIRESTORE_NAMESPACE}}"
- "--fs_project_id={{.FIRESTORE_PROJECT}}"
- "--grpc_port=:8000"
- "--gs_bucket={{.BUCKET}}"
- "--image_port=:8001"
- "--logtostderr"
- "--no_cloud_log"
- "--prom_port=:20000"
ports:
- containerPort: 8000
name: grpc
- containerPort: 8001
name: http
- containerPort: 20000
name: prom
volumeMounts:
- name: gold-service-account-secrets
mountPath: /var/secrets/google/
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/secrets/google/service-account.json
resources:
requests:
memory: "{{.DIFFSERVER_MEMORY}}"
cpu: "{{.DIFFSERVER_CPU}}"
livenessProbe:
httpGet:
path: /healthz
port: 8001
initialDelaySeconds: 15
periodSeconds: 15
failureThreshold: 10
readinessProbe:
httpGet:
path: /healthz
port: 8001
initialDelaySeconds: 5
periodSeconds: 5
volumes:
- name: gold-service-account-secrets
secret:
secretName: gold-service-account-secrets