apiVersion: apps/v1 #{apiVersion.deployment}
kind: Deployment
metadata:
  name: "application" #{"prefix-$(name)-suffix"|s}
spec:
  replicas: 1 #{requests.replicas}
  strategy:
    type: Recreate
  selector:
    matchLabels:
      application: "application" #{name}
  template:
    metadata:
      labels:
        application: "application" #{name}
        custom1: "x" #{test.a}
        custom2: "x" #{custom.x}
        custom3: "x" #{custom.d}

    spec:
      serviceAccountName: serviceAccount #{serviceAccountName}
      containers:
        - name: application-main #{"main-$(name)-$(role)-container"|s}
          image: image #{"$(image):$(tag)|s"}

          env: #[merge-using name]{env.common}
            - name: DEMO_GREETING
              value: "Hello from the environment"
            - name: DEMO_FAREWELL
              value: "Such a sweet sorrow"
        - name: application-secondary #{"secondary-$(name)-$(role)-container"|s}
          image: image #{"$(image2):$(tag)"|s}

          env: #[append]{env.common}
            - name: DEMO_FAREWELL
              value: "Such a sweet sorrow"

        - name: application-third #{"secondary-$(name)-$(role)-container"|s}
          image: image #{image3 ~ ":" ~ tag}

