123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- apiVersion: v1
- kind: Service
- metadata:
- name: companion
- namespace: uppy
- labels:
- app: companion
- spec:
- ports:
- - port: 80
- targetPort: 3020
- protocol: TCP
- selector:
- app: companion
- ---
- apiVersion: apps/v1
- kind: StatefulSet
- metadata:
- name: companion
- namespace: uppy
- spec:
- selector:
- matchLabels:
- app: companion
- replicas: 2
- serviceName: "companion"
- template:
- metadata:
- labels:
- app: companion
- spec:
- affinity:
- nodeAffinity:
- requiredDuringSchedulingIgnoredDuringExecution:
- nodeSelectorTerms:
- - matchExpressions:
- - key: cloud.google.com/gke-preemptible
- operator: Exists
- podAntiAffinity:
- requiredDuringSchedulingIgnoredDuringExecution:
- - labelSelector:
- matchExpressions:
- - key: app
- operator: In
- values:
- - companion
- topologyKey: kubernetes.io/hostname
- containers:
- - image: docker.io/transloadit/companion:latest
- imagePullPolicy: Always
- name: companion
- envFrom:
- - configMapRef:
- name: uppy-companion-env
- ports:
- - containerPort: 3020
- volumeMounts:
- - name: companion-data
- mountPath: /mnt/companion-data
- volumeClaimTemplates:
- - metadata:
- name: companion-data
- spec:
- accessModes: [ "ReadWriteOnce" ]
- storageClassName: "standard"
- resources:
- requests:
- storage: 10Gi
- ---
- apiVersion: extensions/v1beta1
- kind: Ingress
- metadata:
- name: companion
- namespace: uppy
- annotations:
- kubernetes.io/tls-acme: "true"
- kubernetes.io/ingress.class: "nginx"
- certmanager.k8s.io/cluster-issuer: "letsencrypt-prod"
- certmanager.k8s.io/acme-http01-edit-in-place: "true"
- nginx.ingress.kubernetes.io/affinity: "cookie"
- nginx.ingress.kubernetes.io/session-cookie-name: "route"
- nginx.ingress.kubernetes.io/session-cookie-hash: "sha1"
- spec:
- tls:
- - secretName: server-tls
- hosts:
- - companion.uppy.io
- - server.uppy.io
- rules:
- - host: server.uppy.io
- http:
- paths:
- - path: /
- backend:
- serviceName: companion
- servicePort: 80
- - host: companion.uppy.io
- http:
- paths:
- - path: /
- backend:
- serviceName: companion
- servicePort: 80
- ---
- apiVersion: autoscaling/v1
- kind: HorizontalPodAutoscaler
- metadata:
- name: companion
- namespace: uppy
- spec:
- scaleTargetRef:
- apiVersion: apps/v1
- kind: Statefulset
- name: companion
- minReplicas: 1
- maxReplicas: 5
- targetCPUUtilizationPercentage: 80
|