apiVersion: apps/v1
kind: Deployment
metadata:
  name: example
  namespace: fake-namespace
  annotations:
    fake-annotation-1: "Hello"
    fake-annotation-2: "World"
spec:
  selector:
    matchLabels:
      run: my-nginx
  template:
    metadata:
      labels:
        app: example
      annotations:
        test: "annotations"
    spec:
      initContainers:
      - name: init-container
        command:
        - echo
        - hello
        env:
        - name: WHATS_THE_WORD
          value: "bird is the word"
        image: bird.word/latest
        volumeMounts:
          - name: configmap-volume
            mountPath: "/thisisthemount"
            readOnly: true
      containers:
      - name: test-container
        command:
        - echo
        - hello
        env:
        - name: WHATS_THE_WORD
          value: "bird is the word"
        image: bird.word/latest
        volumeMounts:
          - name: configmap-volume
            mountPath: "/thisisthemount"
            readOnly: true
        resources:
          limits:
            cpu: 1
            memory: 2
          requests:
            cpu: "3"
            memory: "4"
      - name: test-container-no-resources
        command:
          - echo
      volumes:
        - name: configmap-volume
          configMap:
            name: "my-configmap-name"
            items:
              - key: "hello"
                path: "/my/file/path"
        - name: secret-volume
          secret:
            secretName: "my-secret"
            items:
              - key: "hello"
                path: "/my/file/path"
        - name: empty-volume
          emptyDir:
            medium: "Memory"
        - name: persistent-volume-claim
          persistentVolumeClaim:
            claimName: my-claim-name
