apiVersion: apps/v1
kind: Deployment
metadata:
  name: projet-31
  namespace: projet
  annotations:
    "sidecar.jaegertracing.io/inject": "true" 
  labels:
    app: "projet-31"
spec:
  selector:
    matchLabels:
      app: "projet-31"
      version: "1.0"
  replicas: 3
  template:
    metadata:
      labels:
        app: "projet-31"
        version: "1.0"
    spec:
      containers:
      - name: projet-31
        image: abdelhakverwest/webinar:<VERSION>
        env:
        - name: MONGO_URI
          valueFrom:
            secretKeyRef:
              name: mongouri
              key: mongoUri
        - name: SECRET
          valueFrom:
            secretKeyRef:
              name: passportsecret
              key: secretOrkey
        - name: SENDGRIDUSER
          valueFrom:
            secretKeyRef:
              name: sendgrid
              key: user
        - name: SENDGRIDPASS
          valueFrom:
            secretKeyRef:
              name: sendgrid
              key: pass
        - name: NODE_ENV
          value: "Production"
        - name: FQDN
          value: "projet31.westeurope.cloudapp.azure.com"
        ports:
        - containerPort: 5000
        imagePullPolicy: Always
        resources:
          requests:
            memory: "64Mi"
            cpu: "64m"
          limits:
            memory: "128Mi"
            cpu: "64m"    
        volumeMounts:
        - name: projet-storage
          mountPath: /data/projet31
      volumes:
      - name: projet-storage
        emptyDir: {}
# ---

# apiVersion: apps/v1
# kind: Deployment
# metadata:
#   name: projet-31-v2
#   namespace: projet
#   labels:
#     app: "projet-31-v2"
# spec:
#   selector:
#     matchLabels:
#       app: "projet-31"
#       version: "2.0"
#   replicas: 3
#   template:
#     metadata:
#       labels:
#         app: "projet-31"
#         version: "2.0"
#     spec:
#       containers:
#       - name: projet-31
#         image: abdelhakverwest/projet-31:release-2.0
#         env:
#         - name: MONGO_URI
#           valueFrom:
#             secretKeyRef:
#               name: mongouri
#               key: mongoUri
#         - name: SECRET
#           valueFrom:
#             secretKeyRef:
#               name: passportsecret
#               key: secretOrkey
#         - name: SENDGRIDUSER
#           valueFrom:
#             secretKeyRef:
#               name: sendgrid
#               key: user
#         - name: SENDGRIDPASS
#           valueFrom:
#             secretKeyRef:
#               name: sendgrid
#               key: pass
#         - name: NODE_ENV
#           value: "Production"
#         - name: FQDN
#           value: "projet31.westeurope.cloudapp.azure.com" 
#         ports:
#         - containerPort: 5000
#         imagePullPolicy: Always
#         resources:
#           requests:
#             memory: "64Mi"
#             cpu: "64m"
#           limits:
#             memory: "128Mi"
#             cpu: "64m"    
#         volumeMounts:
#         - name: projet-storage
#           mountPath: /data/projet31
#       volumes:
#       - name: projet-storage
#         emptyDir: {}
# ---
