apiVersion: apps/v1
kind: Deployment
metadata:
  name: weather-api
spec:
  replicas: 1
  selector:
    matchLabels:
      app: weather-api
  template:
    metadata:
      labels:
        app: weather-api
    spec:
      containers:
        - image: replaceme-acr.azurecr.io/hackfest/weather-api:1.0
          imagePullPolicy: Always
          name: weather-api
          resources:
            requests:
              memory: "64Mi"
              cpu: "100m"
            limits:
              memory: "128Mi"
              cpu: "500m"
          securityContext:
            runAsUser: 1000
            allowPrivilegeEscalation: false
            capabilities:
              add: ["NET_ADMIN", "SYS_TIME"]
          env:
            - name: APPINSIGHTS_INSTRUMENTATIONKEY
              valueFrom:
                secretKeyRef:
                  name: cosmos-db-secret
                  key: appinsights
            - name: DATA_SERVICE_URI
              value: http://data-api:3009/
            - name: CACHE_SERVICE_URI
              value: http://cache-api:3006/
          ports:
          - containerPort: 3015
            protocol: TCP
      restartPolicy: Always