apiVersion: apps/v1
kind: Deployment
metadata:
  name: demoservice
  labels:
    app: demoservice
    owner: tony
spec:
  replicas: 1
  selector:
    matchLabels:
      app: demoservice
  template:
    metadata:
      labels:
        app: demoservice
    spec:
      securityContext:
        runAsUser: 1000
        runAsGroup: 1000
        fsGroup: 1000
      containers:
      - name: demoservice
        command: ["node", "app.js"]
        image: airwavetechio/demoservice:latest
        env:
          - name: PORT
            value: "5000"
        ports:
        - containerPort: 5000
          name: liveness-port
        livenessProbe:
          httpGet:
            path: /
            port: liveness-port
          initialDelaySeconds: 10
          periodSeconds: 5
        readinessProbe:
          httpGet:
            path: /
            port: liveness-port
          initialDelaySeconds: 5
          periodSeconds: 3
        resources:
          limits:
            cpu: 100m
            memory: 150Mi
          requests:
            cpu: 100m
            memory: 150Mi
      restartPolicy: Always
