Skip to content

Commit

Permalink
Improve documentation for syncer flag - sync-labels
Browse files Browse the repository at this point in the history
  • Loading branch information
neogopher committed Feb 27, 2024
1 parent b5f92ac commit 719d506
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion docs/pages/config-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Before using any particular flag mentioned below, we recommend making yourself f
--set-owner If true, will set the same owner the currently running syncer pod has on the synced resources (default true)
--sync strings A list of sync controllers to enable. 'foo' enables the sync controller named 'foo', '-foo' disables the sync controller named 'foo'
--sync-all-nodes If enabled and --fake-nodes is false, the virtual cluster will sync all nodes instead of only the needed ones
--sync-labels strings The specified labels will be synced to physical resources, in addition to their vCluster translated versions. Supports wildcards, e.g --sync-labels=my.company/* will sync all labels that match the given prefix.
--sync-labels strings The specified labels will be synced to physical resources, in addition to their vCluster translated versions. Supported wildcard - '/*'. e.g --sync-labels=my.company/* will sync all labels that match the given prefix 'my.company/'.
--sync-node-changes If enabled and --fake-nodes is false, the virtual cluster will proxy node updates from the virtual cluster to the host cluster. This is not recommended and should only be used if you know what you are doing.
--target-namespace string The namespace to run the virtual cluster in (defaults to current namespace)
--tls-san strings Add additional hostname or IP as a Subject Alternative Name in the TLS cert
Expand All @@ -60,3 +60,10 @@ syncer:
extraArgs:
- --set-owner=false
```

For flags that accept multiple values, the same can be supplied as a comma-seperated string as shown below
```
syncer:
extraArgs:
- --sync-labels=loft.sh/label1,loft.sh/label2
```
2 changes: 1 addition & 1 deletion pkg/options/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func AddFlags(flags *pflag.FlagSet, options *VirtualClusterOptions) {
flags.StringVar(&options.DefaultImageRegistry, "default-image-registry", "", "This address will be prepended to all deployed system images by vcluster")

flags.StringVar(&options.EnforcePodSecurityStandard, "enforce-pod-security-standard", "", "This can be set to 'privileged', 'baseline', or 'restricted' to make vcluster enforce these policies during translation.")
flags.StringSliceVar(&options.SyncLabels, "sync-labels", []string{}, "The specified labels will be synced to physical resources, in addition to their vcluster translated versions. Supports wildcards, e.g --sync-labels=my.company/* will sync all labels that match the given prefix.")
flags.StringSliceVar(&options.SyncLabels, "sync-labels", []string{}, "The specified labels will be synced to physical resources, in addition to their vcluster translated versions. Supported wildcard - '/*'. e.g --sync-labels=my.company/* will sync all labels that match the given prefix 'my.company/'.")
flags.StringSliceVar(&options.Plugins, "plugins", []string{}, "The plugins to wait for during startup")

flags.StringSliceVar(&options.MapVirtualServices, "map-virtual-service", []string{}, "Maps a given service inside the virtual cluster to a service inside the host cluster. E.g. default/test=physical-service")
Expand Down

0 comments on commit 719d506

Please sign in to comment.