apiVersion: apps/v1
kind: Deployment
metadata:
  name: wifi
spec:
  replicas: 1
  selector:
    matchLabels:
      app: wifi
  template:
    metadata:
      labels:
        app: wifi
    spec:
      containers:
        - name: wifi
          image: bang5:5000/wifi_image
          command:
            - pdm
            - run
            - uvicorn
            - "--port=9070"
            - "--host=0.0.0.0"
            - "wifi:app"
          ports:
            - containerPort: 9070
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: "kubernetes.io/hostname"
                    operator: In
                    values: ["bang"]
---
apiVersion: v1
kind: Service
metadata:
  name: wifi
spec:
  ports:
    - { port: 80, targetPort: 9070, name: http }
  selector:
    app: wifi
