apiVersion: apps/v1
kind: Deployment
metadata:
  name: scalable-api
  labels:
    app: scalable-api
    version: 1.0.0
spec:
  replicas: 3
  strategy:
    rollingUpdate:
      maxSurge: "10%"
      maxUnavailable: "50%"
  selector:
    matchLabels:
      app: scalable-api
  template:
    metadata:
      labels:
        app: scalable-api
        version: 1.0.0
    spec:
      containers:
        - name: scalable-srv
          image: khaosdoctor/scalable-node-api:1.0.0
          env:
            - name: PORT
              value: "8080"
          ports:
            - name: http
              containerPort: 8080
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /
              port: http
          readinessProbe:
            httpGet:
              path: /
              port: http