---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: squidfall-production
  labels:
    app: squidfall
spec:
  replicas: 1
  selector:
    matchLabels:
      app: squidfall
      env: production
  template:
    metadata:
      labels:
        app: squidfall
        env: production
      annotations: 
        instrumentation.opentelemetry.io/inject-python: "true" # used to tell the OTEL agent where to export telemetry
    spec:
      containers:
      - name: squidfall
        image:  squidfall.azurecr.io/squidfall:v1.0.0
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
        startupProbe:
          httpGet:
            path: /healthcheck
            port: 8080
          periodSeconds: 10   # check every 10 seconds
          failureThreshold: 3 # consider the container DOA after 3 failed checks
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: squidfall-staging
  labels:
    app: squidfall
spec:
  replicas: 1
  selector:
    matchLabels:
      app: squidfall
      env: staging
  template:
    metadata:
      labels:
        app: squidfall
        env: staging
      annotations: 
        instrumentation.opentelemetry.io/inject-python: "true" # used to tell the OTEL agent where to export telemetry
    spec:
      containers:
      - name: squidfall
        image:  squidfall.azurecr.io/squidfall:v1.0.0
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
        startupProbe:
          httpGet:
            path: /healthcheck
            port: 8080
          periodSeconds: 10   # check every 10 seconds
          failureThreshold: 3 # consider the container DOA after 3 failed checks
---
apiVersion: v1
kind: Service
metadata:
  name: squidfall
spec:
  type: LoadBalancer
  selector:
    app: squidfall
  ports:
    - protocol: TCP
      port: 80
      targetPort: 8080