apiVersion: apps/v1
kind: Deployment
metadata:
  name: iris-web-app
  labels:
    app: iris-web-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: iris-web-app
  template:
    metadata:
      labels:
        app: iris-web-app
    spec:
      containers:
      - name: app
        image: us-central1-docker.pkg.dev/rafay-labs/ai-ml-repo/iris-web-app:latest
        ports:
        - name: http
          containerPort: 8501
          protocol: TCP
        livenessProbe:
          httpGet:
            path: /
            port: http
        readinessProbe:
          httpGet:
            path: /
            port: http
        env:
        - name: INFERENCE_URL
          value: "http://sklearn-irisv2.default.svc.cluster.local/v2/models/sklearn-irisv2/infer"
        resources:
          limits:
            cpu: "100m"
            memory: "128Mi"
---
apiVersion: v1
kind: Service
metadata:
  name: iris-web-app-service
  labels:
    app: iris-web-app
spec:
  type: LoadBalancer
  ports:
  - name: http
    protocol: TCP
    port: 80
    targetPort: 8501
  selector:
    app: iris-web-app
