# https://kubernetes.io/docs/tutorials/k8s101/
# https://gist.github.com/tallclair/849601a16cebeee581ef2be50c351841
# https://cheatsheet.dennyzhang.com/kubernetes-yaml-templates
apiVersion: v1
kind: Pod
metadata:
  name: www
spec:
  initContainers:
  - name: git-clone
    image: alpine/git
    args:
        - clone
        - --single-branch
        - --
        - https://github.com/dennyzhang/challenges-kubernetes.git
        - /data/challenges-kubernetes
    securityContext:
        runAsUser: 1 # Any non-root user will do. Match to the workload.
        allowPrivilegeEscalation: false
        readOnlyRootFilesystem: true
    volumeMounts:
    - mountPath: /data
      name: www-data
  containers:
  - name: nginx
    image: nginx
    volumeMounts:
    - mountPath: /srv/www
      name: www-data
      readOnly: true
  volumes:
  - name: www-data
    emptyDir: {}
