blob: 724f4830c1fba30470c955b2f9683dc29a8ad94c [file] [log] [blame]
apiVersion: v1
kind: Service
metadata:
labels:
app: gold-{{.INSTANCE_ID}}-periodictasks
name: gold-{{.INSTANCE_ID}}-periodictasks
spec:
ports:
- name: metrics
port: 20000
selector:
app: gold-{{.INSTANCE_ID}}-periodictasks
type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gold-{{.INSTANCE_ID}}-periodictasks
spec:
replicas: 1
selector:
matchLabels:
app: gold-{{.INSTANCE_ID}}-periodictasks
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: gold-{{.INSTANCE_ID}}-periodictasks
appgroup: gold
goldgroup: '{{.INSTANCE_ID}}'
date: "{{.NOW}}" # Forces a re-deploy even if just the config file changes.
annotations:
cluster-autoscaler.kubernetes.io/safe-to-evict: 'true'
spec:
automountServiceAccountToken: false
securityContext:
runAsUser: 2000 # aka skia
fsGroup: 2000 # aka skia
serviceAccountName: gold
containers:
- name: gold-{{.INSTANCE_ID}}-periodictasks
image: {{.PERIODICTASKS_IMAGE}}
args:
- "--common_instance_config=/etc/gold-config/{{.INSTANCE_ID}}.json5"
- "--config=/etc/gold-config/{{.INSTANCE_ID}}-periodictasks.json5"
ports:
- containerPort: 20000
name: prom
volumeMounts:
- name: gold-{{.INSTANCE_ID}}-config-volume
mountPath: /etc/gold-config/
{{if .INCLUDE_GITHUB_CREDS}}
- name: gold-github-token
mountPath: /var/secrets/github/
{{end}}
env:
- name: K8S_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
resources:
requests:
memory: "{{.K8S_MEMORY}}"
cpu: "{{.K8S_CPU}}"
ephemeral-storage: '32M'
readinessProbe:
httpGet:
path: /healthz
port: 8000
initialDelaySeconds: 5
periodSeconds: 3
volumes:
- name: gold-{{.INSTANCE_ID}}-config-volume
configMap:
defaultMode: 400
name: gold-{{.INSTANCE_ID}}-config
{{if .INCLUDE_GITHUB_CREDS}}
- name: gold-github-token
secret:
secretName: gold-github-token
{{end}}