blob: dcdef3a870a5ce0370d99f3316cb05ab2adca3a4 [file] [log] [blame]
apiVersion: v1
kind: Service
metadata:
name: gold-{{.INSTANCE_ID}}-skiacorrectness
annotations:
beta.cloud.google.com/backend-config: '{"ports": {"8000":"skia-default-backendconfig"}}'
spec:
ports:
- name: http
port: 8000
- name: metrics
port: 20000
selector:
app: gold-{{.INSTANCE_ID}}-skiacorrectness
type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gold-{{.INSTANCE_ID}}-skiacorrectness
spec:
replicas: 1
selector:
matchLabels:
app: gold-{{.INSTANCE_ID}}-skiacorrectness
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: gold-{{.INSTANCE_ID}}-skiacorrectness
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-{{.INSTANCE_ID}}-skiacorrectness
image: {{.SKIACORRECTNESS_IMAGE}}
args:
- "--common_instance_config=/etc/gold-config/{{.INSTANCE_ID}}.json5"
- "--config=/etc/gold-config/{{.INSTANCE_ID}}-skiacorrectness.json5"
- "--logtostderr"
ports:
- containerPort: 8000
name: http
- containerPort: 20000
name: prom
volumeMounts:
- name: gold-{{.INSTANCE_ID}}-config-volume
mountPath: /etc/gold-config/
- name: gold-service-account-secrets
mountPath: /var/secrets/google/
- name: {{.K8S_LOGIN_SECRETS}}
mountPath: /etc/skia.org/
{{if eq .primary_crs "github"}}
- name: gold-github-token
mountPath: /var/secrets/github/
{{end}}
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/secrets/google/service-account.json
resources:
requests:
memory: "{{.K8S_MEMORY}}"
cpu: "{{.K8S_CPU}}"
readinessProbe:
httpGet:
path: /healthz
port: 8000
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 6
volumes:
- name: gold-{{.INSTANCE_ID}}-config-volume
configMap:
defaultMode: 400
name: gold-{{.INSTANCE_ID}}-config
- name: gold-service-account-secrets
secret:
secretName: gold-service-account-secrets
- name: {{.K8S_LOGIN_SECRETS}}
secret:
secretName: {{.K8S_LOGIN_SECRETS}}
{{if eq .primary_crs "github"}}
- name: gold-github-token
secret:
secretName: gold-github-token
{{end}}