apiVersion: apps/v1
kind: Deployment
metadata:
  name:  nodejsk8
  namespace: default
  labels:
    app:  nodejsk8
spec:
  selector:
    matchLabels:
      app: nodejsk8
  replicas: 3
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app:  nodejsk8
    spec:
      # initContainers:
        # Init containers are exactly like regular containers, except:
          # - Init containers always run to completion.
          # - Each init container must complete successfully before the next one starts.
      containers:
      - name:  nodejsk8
        image:  jash271/node_k8:latest
        
        env:
        - name: CONN
          valueFrom:
            configMapKeyRef:
              name: nodejsk8cm
              key: CONN
        - name: PORT
          valueFrom:
            configMapKeyRef:
              name: nodejsk8cm
              key: PORT


        ports:
        - containerPort: 5000
          name:  nodejsk8port
        
      restartPolicy: Always