apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: surfnet-app
  name: surfnet
spec:
  replicas: 2
  selector:
    matchLabels:
      app.kubernetes.io/name: surfnet-app
  template:
    metadata:
      labels:
        app.kubernetes.io/name: surfnet-app
    spec:
      topologySpreadConstraints:
      - maxSkew: 1
        topologyKey: kubernetes.io/hostname
        whenUnsatisfiable: ScheduleAnyway
        labelSelector: 
          matchLabels:
            app.kubernetes.io/name: surfnet-app
      containers:
      - image: ghcr.io/cl3m3nt/surfnet:latest
        name: surfnet
        ports:
        - containerPort: 8000
        env:
          - name: PYTHONPATH
            value: "/src"
      nodeSelector:
        cloud.google.com/gke-nodepool: surfnetpool