apiVersion: core.oam.dev/v1alpha2
kind: WorkloadDefinition
metadata:
  name: webservice
  annotations:
    definition.oam.dev/description: "Flight tracker web ui"
spec:
  definitionRef:
    name: podspecworkloads.standard.oam.dev
  childResourceKinds:
    - apiVersion: apps/v1
      kind: Deployment
    - apiVersion: v1
      kind: Service
  extension:
    template: |
      output: {
        apiVersion: "standard.oam.dev/v1alpha1"
        kind:       "PodSpecWorkload"
        metadata: name: parameter.name
        spec: {
          replicas: 1
          podSpec: {
            containers: [{
              image: parameter.image
              name:  parameter.name
              env: parameter.env
              ports: [{
                containerPort: parameter.port
                protocol:      "TCP"
                }]
            }]
          }
        }
      }
      #webservice: {
        name: string
        image: string
        port: int

        env: [...{
          name:  string
          value?: string
          valueFrom?: {
            secretKeyRef: {
              name: string
              key: string
            }
          }
        }]
      }
      parameter: #webservice