Skip to content

Commit

Permalink
doc nits
Browse files Browse the repository at this point in the history
  • Loading branch information
Shashankft9 committed Apr 22, 2024
1 parent cc20921 commit 6677a4e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/cmd/kn_service_apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ kn service apply s0 --filename my-svc.yml
--timeout int Duration in seconds that the request routing layer will wait for a request delivered to a container to begin replying (default 300)
--toleration strings Add toleration to be set - only works if the feature gate is enabled in knative serving. Example: --tolerations Key="key1",Operator="Equal",Value="value1",Effect="NoSchedule"
--user int The user ID to run the container (e.g., 1001).
--volume stringArray Add a volume from a ConfigMap (prefix cm: or config-map:) a Secret (prefix secret: or sc:), an EmptyDir (prefix ed: or emptyDir:) or a PersistentVolumeClaim (prefix pvc: or persistentVolumeClaim). PersistentVolumeClaim and EmptyDir only works if the feature gate is enabled in knative serving. Example: --volume myvolume=cm:myconfigmap, --volume myvolume=secret:mysecret or --volume emptyDir:myvol:size=1Gi,type=Memory. You can use this flag multiple times. To unset a ConfigMap/Secret reference, append "-" to the name, e.g. --volume myvolume-.
--volume stringArray Add a volume from a ConfigMap (prefix cm: or config-map:) a Secret (prefix secret: or sc:), an EmptyDir (prefix ed: or emptyDir:) or a PersistentVolumeClaim (prefix pvc: or persistentVolumeClaim). PersistentVolumeClaim only works if the feature gate is enabled in knative serving. Example: --volume myvolume=cm:myconfigmap, --volume myvolume=secret:mysecret or --volume emptyDir:myvol:size=1Gi,type=Memory. You can use this flag multiple times. To unset a ConfigMap/Secret reference, append "-" to the name, e.g. --volume myvolume-.
--wait Wait for 'service apply' operation to be completed. (default true)
--wait-timeout int Seconds to wait before giving up on waiting for service to be ready. (default 600)
--wait-window int Seconds to wait for service to be ready after a false ready condition is returned (default 2)
Expand Down
11 changes: 5 additions & 6 deletions docs/cmd/kn_service_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,14 @@ kn service create NAME --image IMAGE
# Create a service with profile
kn service create profiletest --image knativesamples/helloworld --profile istio
# Create a service with node selector (if feature flag is enabled here: https://knative.dev/docs/serving/configuration/feature-flags)
# Create a service with node selector
kn service create nodeselectortest --image knativesamples/helloworld --node-selector Disktype="ssd"
# Create a service with toleration (if feature flag is enabled here: https://knative.dev/docs/serving/configuration/feature-flags)
# Create a service with toleration
kn service create tolerationtest --image knativesamples/helloworld --toleration Key="node-role.kubernetes.io/master",Effect="NoSchedule",Operator="Equal",Value=""
# Create a service with node affinity (if feature flag is enabled here: https://knative.dev/docs/serving/configuration/feature-flags)
kn service create nodeaffinitytest --image knativesamples/helloworld --node-affinity Type="Required",Key="topology.kubernetes.io/zone",Operator="In",Values="antarctica-east1 antarctica-east2"
```
# Create a service with node affinity
kn service create nodeaffinitytest --image knativesamples/helloworld --node-affinity Type="Required",Key="topology.kubernetes.io/zone",Operator="In",Values="antarctica-east1 antarctica-east2"````
### Options
Expand Down Expand Up @@ -120,7 +119,7 @@ kn service create NAME --image IMAGE
--timeout int Duration in seconds that the request routing layer will wait for a request delivered to a container to begin replying (default 300)
--toleration strings Add toleration to be set - only works if the feature gate is enabled in knative serving. Example: --tolerations Key="key1",Operator="Equal",Value="value1",Effect="NoSchedule"
--user int The user ID to run the container (e.g., 1001).
--volume stringArray Add a volume from a ConfigMap (prefix cm: or config-map:) a Secret (prefix secret: or sc:), an EmptyDir (prefix ed: or emptyDir:) or a PersistentVolumeClaim (prefix pvc: or persistentVolumeClaim). PersistentVolumeClaim and EmptyDir only works if the feature gate is enabled in knative serving. Example: --volume myvolume=cm:myconfigmap, --volume myvolume=secret:mysecret or --volume emptyDir:myvol:size=1Gi,type=Memory. You can use this flag multiple times. To unset a ConfigMap/Secret reference, append "-" to the name, e.g. --volume myvolume-.
--volume stringArray Add a volume from a ConfigMap (prefix cm: or config-map:) a Secret (prefix secret: or sc:), an EmptyDir (prefix ed: or emptyDir:) or a PersistentVolumeClaim (prefix pvc: or persistentVolumeClaim). PersistentVolumeClaim only works if the feature gate is enabled in knative serving. Example: --volume myvolume=cm:myconfigmap, --volume myvolume=secret:mysecret or --volume emptyDir:myvol:size=1Gi,type=Memory. You can use this flag multiple times. To unset a ConfigMap/Secret reference, append "-" to the name, e.g. --volume myvolume-.
--wait Wait for 'service create' operation to be completed. (default true)
--wait-timeout int Seconds to wait before giving up on waiting for service to be ready. (default 600)
--wait-window int Seconds to wait for service to be ready after a false ready condition is returned (default 2)
Expand Down
6 changes: 3 additions & 3 deletions pkg/kn/commands/service/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ var create_example = `
# Create a service with profile
kn service create profiletest --image knativesamples/helloworld --profile istio
# Create a service with node selector (if feature flag is enabled here: https://knative.dev/docs/serving/configuration/feature-flags)
# Create a service with node selector
kn service create nodeselectortest --image knativesamples/helloworld --node-selector Disktype="ssd"
# Create a service with toleration (if feature flag is enabled here: https://knative.dev/docs/serving/configuration/feature-flags)
# Create a service with toleration
kn service create tolerationtest --image knativesamples/helloworld --toleration Key="node-role.kubernetes.io/master",Effect="NoSchedule",Operator="Equal",Value=""
# Create a service with node affinity (if feature flag is enabled here: https://knative.dev/docs/serving/configuration/feature-flags)
# Create a service with node affinity
kn service create nodeaffinitytest --image knativesamples/helloworld --node-affinity Type="Required",Key="topology.kubernetes.io/zone",Operator="In",Values="antarctica-east1 antarctica-east2"`

func NewServiceCreateCommand(p *commands.KnParams) *cobra.Command {
Expand Down
8 changes: 4 additions & 4 deletions pkg/kn/flags/podspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,18 @@ func (p *PodSpecFlags) AddFlags(flagset *pflag.FlagSet) []string {
"and 'strict' for dropping all capabilities, running as non-root, and no privilege escalation.")
flagNames = append(flagNames, "security-context")

flagset.StringArrayVar(&p.NodeSelector, "node-selector", []string{}, "Add node selector to be set, you may provide this flag any number of times to set multiple node selectors "+
"- only works if the feature gate is enabled in knative serving, example: --node-selector Disktype=\"ssd\". To unset, specify the key name followed by a \"-\", example: --node-selector Disktype- .")
flagset.StringArrayVar(&p.NodeSelector, "node-selector", []string{}, "Add node selector to be set, you may provide this flag any number of times to set multiple node selectors, "+
"works if feature flag is enabled here: https://knative.dev/docs/serving/configuration/feature-flags/#kubernetes-node-selector. Example: --node-selector Disktype=\"ssd\". To unset, specify the key name followed by a \"-\", example: --node-selector Disktype- .")
flagNames = append(flagNames, "node-selector")

flagset.StringSliceVar(&p.Toleration, "toleration", []string{},
"Add toleration to be set - only works if the feature gate is enabled in knative serving. Example: "+
"Add toleration to be set, works if the feature gate is enabled here: https://knative.dev/docs/serving/configuration/feature-flags/#kubernetes-toleration. Example: "+
"--tolerations Key=\"key1\",Operator=\"Equal\",Value=\"value1\",Effect=\"NoSchedule\"")
flagNames = append(flagNames, "toleration")

flagset.StringSliceVar(&p.NodeAffinity, "node-affinity", []string{},
"Add node affinity to be set - only works if the feature gate is enabled in knative serving. When key, operator, values and weight are defined for a type, they will be appended in nodeSelectorTerms in case of Required clause, "+
"implying the terms will be ORed, and for Preferred clause, all of them will be considered a new entry in preferredDuringSchedulingIgnoredDuringExecution. Example: "+
"implying the terms will be ORed, and for Preferred clause, all of them will be considered a new entry in preferredDuringSchedulingIgnoredDuringExecution, works if feature flag is enabled here: https://knative.dev/docs/serving/configuration/feature-flags/#kubernetes-node-affinity. Example: "+
"--node-affinity Type=\"Required\",Key=\"topology.kubernetes.io/zone\",Operator=\"In\",Values=\"antarctica-east1 antarctica-west1\" or"+
"--node-affinity Type=\"Preferred\",Key=\"topology.kubernetes.io/zone\",Operator=\"In\",Values=\"antarctica-east1\",Weight=\"1\"")
flagNames = append(flagNames, "node-affinity")
Expand Down

0 comments on commit 6677a4e

Please sign in to comment.