| apiVersion: apps/v1 |
| kind: StatefulSet |
| metadata: |
| name: gold-{{.INSTANCE_ID}}-ingestion |
| spec: |
| serviceName: "gold-{{.INSTANCE_ID}}-ingestion" |
| replicas: 1 |
| selector: |
| matchLabels: |
| app: gold-{{.INSTANCE_ID}}-ingestion # Label selector that determines which Pods belong to the StatefulSet |
| # Must match spec: template: metadata: labels |
| updateStrategy: |
| type: RollingUpdate |
| template: |
| metadata: |
| labels: |
| app: gold-{{.INSTANCE_ID}}-ingestion # 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-{{.INSTANCE_ID}}-ingestion |
| image: {{.INGESTION_IMAGE}} |
| args: |
| - "--config_filename=/etc/gold-ingestion/gold-{{.INSTANCE_ID}}-ingestion-config.json5" |
| - "--git_bt_instance={{.GIT_BT_INSTANCE}}" |
| - "--git_bt_table={{.GIT_BT_TABLE}}" |
| - "--http_port=:9091" |
| - "--logtostderr" |
| - "--namespace=gold-{{.INSTANCE_ID}}" |
| - "--no_cloud_log" |
| - "--project_id={{.PROJECT_ID}}" |
| - "--prom_port=:20000" |
| ports: |
| - containerPort: 9091 |
| name: http-health |
| volumeMounts: |
| - name: gold-{{.INSTANCE_ID}}-ingestion-config-volume |
| mountPath: /etc/gold-ingestion |
| - name: gold-{{.INSTANCE_ID}}-ingestion-storage-volume |
| mountPath: /data |
| - name: gold-service-account-secrets |
| mountPath: /var/secrets/google |
| env: |
| - name: GOOGLE_APPLICATION_CREDENTIALS |
| value: /var/secrets/google/service-account.json |
| resources: |
| limits: |
| memory: "8Gi" |
| cpu: 4 |
| readinessProbe: |
| httpGet: |
| path: /healthz |
| port: 9091 |
| initialDelaySeconds: 30 |
| periodSeconds: 10 |
| volumes: |
| - name: gold-{{.INSTANCE_ID}}-ingestion-config-volume |
| configMap: |
| defaultMode: 420 |
| name: gold-{{.INSTANCE_ID}}-ingestion-config |
| - name: gold-service-account-secrets |
| secret: |
| secretName: gold-service-account-secrets |
| volumeClaimTemplates: |
| - metadata: |
| name: gold-{{.INSTANCE_ID}}-ingestion-storage-volume |
| spec: |
| storageClassName: ssd-disk |
| accessModes: [ "ReadWriteOnce" ] |
| resources: |
| requests: |
| storage: 50Gi |