apiVersion: apps/v1
kind: Deployment
metadata:
  name: httpserver
  labels:
    app: httpserver
spec:
  # How many pods we need for this config thos count have to mention here
  replicas: 2
  selector:
    matchLabels:
      app: httpserver
  template:
    metadata:
      labels:
        app: httpserver
    spec:
      containers:
      - name: httpserver
        image: httpserver:0.0.5
        ports:
        - containerPort: 80
          name: httpport
        # configure probes readiness for checking pods health using command method
        readinessProbe:
          exec:
            command:
            - curl
            - http://localhost/healthcheck
            - --http0.9
          initialDelaySeconds: 10  
          periodSeconds: 10
        livenessProbe:
          exec:
            command:
            - curl
            - http://localhost/healthcheck
            - --http0.9
          initialDelaySeconds: 20
          periodSeconds: 5
      #Running the process as non-root
      securityContext:
        runAsUser: 1000
        runAsGroup: 3000
        fsGroup: 2000
