apiVersion: v1
kind: Pod
metadata:
  name: my-pod-network-utils
  labels:
    app: my-app-network-utils
spec:
  securityContext:
    runAsUser: 1000
    runAsGroup: 3000
    fsGroup: 2000
  containers:
    - name: mycontainer
      image: amouat/network-utils
      imagePullPolicy: Always
      ports:
        - containerPort: 8080
          name : mon-port-http
      command: ['sh', '-c', 'trap : TERM INT; sleep infinity & wait']
      env:
        - name: SECRET_USERNAME
          valueFrom:
            secretKeyRef:
              name: my-secret
              key: username
        - name: SECRET_PASSWORD
          valueFrom:
            secretKeyRef:
              name: my-secret
              key: password
      volumeMounts:
        - name: secret-volume
          readOnly: true
          mountPath: "/etc/secret-volume"
      resources:
        requests:
          memory: "64Mi"
          cpu: "250m"
        limits:
          memory: "128Mi"
          cpu: "500m"
      securityContext:
        allowPrivilegeEscalation: false
        runAsNonRoot: true
        capabilities:
          drop:
            - all
          #add: ["..."]
  volumes:
    - name: secret-volume
      secret:
        secretName: my-secret
        defaultMode: 256