github.com/oam-dev/kubevela@v1.9.11/pkg/cue/testdata/workloads/webservice.cue (about)

     1  output: {
     2  	apiVersion: "apps/v1"
     3  	kind:       "Deployment"
     4  	spec: {
     5  		selector: matchLabels: {
     6  			"app.oam.dev/component": context.name
     7  		}
     8  		template: {
     9  			metadata: labels: {
    10  				"app.oam.dev/component": context.name
    11  				if parameter.addRevisionLabel {
    12  					"app.oam.dev/appRevision": context.appRevision
    13  				}
    14  			}
    15  			spec: {
    16  				containers: [{
    17  					name:  context.name
    18  					image: parameter.image
    19  					if parameter["env"] != _|_ {
    20  						env: parameter.env
    21  					}
    22  				}]
    23  		  }
    24  		}
    25  	}
    26  }
    27  parameter: {
    28  	// +usage=Which image would you like to use for your service
    29  	// +short=i
    30  	image: string
    31  	// +usage=Define arguments by using environment variables
    32  	env?: [...{
    33  		// +usage=Environment variable name
    34  		name: string
    35  		// +usage=The value of the environment variable
    36  		value?: string
    37  		// +usage=Specifies a source the value of this var should come from
    38  		valueFrom?: {
    39  			// +usage=Selects a key of a secret in the pod's namespace
    40  			secretKeyRef: {
    41  				// +usage=The name of the secret in the pod's namespace to select from
    42  				name: string
    43  				// +ignore
    44  				// +usage=The key of the secret to select from. Must be a valid secret key
    45  				secretKey: string
    46  			}
    47  		}
    48  	}]
    49    // +ignore
    50  	// +usage=If addRevisionLabel is true, the appRevision label will be added to the underlying pods
    51  	addRevisionLabel: *false | bool
    52  }
    53