apiVersion: v1
kind: Pod
metadata:
  name: user
  namespace: demo
  labels:
    env: dev
spec:
  containers:
  - name: user
    image: jinternals/user:latest
    resources:
      requests:
        cpu: "500m"
        memory: "128Mi"
      limits:
        cpu: "1000m"
        memory: "256Mi"
    ports:
      - containerPort: 8080
        name: http
        protocol: TCP
    readinessProbe:
      httpGet:
        path: /health
        port: 8012
      initialDelaySeconds: 15
      timeoutSeconds: 1
      periodSeconds: 5
      failureThreshold: 3
    livenessProbe:
      httpGet:
        path: /health
        port: 8012
      initialDelaySeconds: 15
      timeoutSeconds: 1
      periodSeconds: 5
      failureThreshold: 3
  initContainers:
    - name: init-mongo
      image: busybox
      command: ['sh', '-c', 'until nslookup mongo; do echo waiting for mongo; sleep 2; done;']
  restartPolicy: Always