diff --git a/pkg/kn/commands/service_create.go b/pkg/kn/commands/service_create.go index 16ef9a096..3069fc293 100644 --- a/pkg/kn/commands/service_create.go +++ b/pkg/kn/commands/service_create.go @@ -31,6 +31,13 @@ func NewServiceCreateCommand(p *KnParams) *cobra.Command { serviceCreateCommand := &cobra.Command{ Use: "create NAME --image IMAGE", Short: "Create a service.", + Example: ` + # Create a service 'mysvc' using image at dev.local/ns/image:latest + kn service create mysvc --image dev.local/ns/image:latest + + # Create a service with multiple environment variables + kn service create mysvc --env KEY1=VALUE1 --env KEY2=VALUE2 --image dev.local/ns/image:latest`, + RunE: func(cmd *cobra.Command, args []string) (err error) { if len(args) != 1 { return errors.New("requires the service name.")