apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp-ntest
spec:
  replicas: 4
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 100%
      maxSurge: 100%
  selector:
    matchLabels:
      name: "myapp-ntest"
      test: "true"
  template:
    metadata:
      labels:
        name: "myapp-ntest"
        test: "true"
    spec:
      volumes:
      - name: app-volume
        emptyDir: {}
      initContainers:
      - name: init-ntest-index
        image: busybox
        command: ['sh', '-c', 'wget -O- https://raw.githubusercontent.com/express42/otus-platform-snippets/master/Module-02/Introduction-to-Kubernetes/wget.sh | sh']
        volumeMounts:
        - mountPath: /app
          name: app-volume
      - name: init-ntest-jpg
        image: busybox
        command: ['sh', '-c', 'wget -O /app/img.jpg https://nextcloud.klimdos.ml/s/LPiyB5MJMHDc9gN/preview']
        volumeMounts:
        - mountPath: /app
          name: app-volume
      containers:
      - name: ntest-core
        image: klimdos/ntest
        readinessProbe:
          httpGet:
            path: /index.html
            port: 8000
        livenessProbe:
            tcpSocket:
              port: 8000
        volumeMounts:
        - mountPath: /usr/share/nginx/html/app
          name: app-volume
        resources:
          limits:
            memory: "128Mi"
        ports:
        - containerPort: 8000
